Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Display custom widget content titles #1650

Merged
merged 9 commits into from
Dec 11, 2017
Merged

Conversation

rxl881
Copy link
Contributor

@rxl881 rxl881 commented Dec 5, 2017

Use the new scalar page title API to get and display (custom) widget content page titles.

@rxl881 rxl881 requested a review from ara4n December 5, 2017 22:06
}, (err, response, body) => {
if (err) {
defer.reject(err);
} else if (response.statusCode / 100 !== 2) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can 404 fall back to the widget's name, please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only affects the "variable" component of the AppTile title, the widget's name will always be displayed in the AppTile menu bar.

The variable component of the widget name is not displayed if it is the same as the "widget name". Adding it in here would just be unnecessary duplication (unless I am missing something?).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see what this is here for now. I thought it was replacing the existing title, but it's just a hint next to it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep :)

getScalarPageTitle(url) {
const defer = Promise.defer();

let scalarPageLookupUrl = SdkConfig.get().integrations_rest_url + '/api/widgets/title_lookup';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use the URL preview endpoint from the media repo?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh... thanks for pointing that out @turt2live. I'm not really familiar with the media repo, though it looks like you're right, that would have been a simpler solution. It looks like this can be switched over easily at any point though.

I'll have a look in to the URL string duplication now (it's working fine in dev)...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The duplication is because the string in the config.json has the api route defined in the REST endpoint.

Examples:
https://riot.im/develop/config.json
https://riot.im/app/config.json

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, you're absolutely right. Thanks for catching that one! (slightly screwy config. on my end to blame for that one, I think). Fixed now.

@rxl881
Copy link
Contributor Author

rxl881 commented Dec 8, 2017

@ara4n This one should be good to go now. Can you please have a quick look?

@rxl881
Copy link
Contributor Author

rxl881 commented Dec 11, 2017

Matthew has LGTMed this IRL

@rxl881 rxl881 merged commit c1d9df0 into rxl881/titleBar Dec 11, 2017
@rxl881 rxl881 deleted the rxl881/customTitle branch December 11, 2017 12:00
@rxl881 rxl881 mentioned this pull request Dec 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants