-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Framework] Complete implementation info with badges #216
Conversation
The code now renders more specific implementation information on screen using visual badges on top of browser icons. Badges are: - Feature available on desktop only / mobile only / desktop and mobile - Features requires using a prefix - Feature is behind a flag Essentially, there will always be a desktop/mobile badge and, most of the time, that badge will be the "desktop and mobile" one, because most recent features are developed on all platforms. A tooltip explains what the implementation info means, for instance: "Experimental in Chrome (mobile). Feature requires using a prefix. Source: Chrome Platform Status." That text also appears in a span element for accessibility readers. Clicking on the browser icon takes the reader to the right page on the Platform Status Web site where the implementation info comes from. Some changes made to the `extract-impl-data.js` script to make things possible: - The script now sets a `selected` flag on the implementation info that is considered to be the right one for each user agent. - The script also sets the URL to look at on the underlyin Platform Status Web site to get additional info. - The script only runs the selection logic once (it incorrectly ran after each step) - The Chrome Platform Status platform was marked as authoritative for Chrome for Android (it was only considered as authoritative for Chrome for Desktop) The styles of the generated table have been slightly updated to set some minimum width to the implementation column (enough to render 5 browsers), and some maximum width to the feature column (to keep it short). Also created a `tr` function to translate strings instead of passing the translations object around.
To save some width in generated table for implementation info, and keep all of our tables consistent, the name of the group(s) responsible for a given spec or feature is (are) listed below the specification title in the same column. Styles used are similar to those in the new /TR/ page, the group name appearing in light grey below using a smaller font size. Links now use consistent styles throughout the roadmap, regardless of whether they appear in the body of the text or in generated tables. No underline in the tables in particular to improve readability. The update also removes and sanitizes a few styles that were defined twice in `theme.css` and `roadmap.css`. More work would be needed on that front, but we'll do that later on (for once, I'm not sure why we have two files). Updates to link styles meant the remaining `<strong><a>...</a></strong>` constructs rendered in bold again. I dropped the `<strong>` element everwhere.
- Add the following browsers to the list displayed in the implementations column: Baidu Browser, QQ Browser, Samsung Internet, UC Browser. - Split browsers between "main" (the four main codebases) and "secondary" (those based on one of the main codebases), and display main ones first. - Add a filtering menu to the implementation column that lets the user select which browsers she wants to see displayed. Choices are saved to session storage so that they are preserved when the user navigates between roadmap pages but reset between sessions. - The four main browsers are displayed by default.
I added missing icons for Baidu, QQ, Samsung Internet, UC. They can probably still be improved (I could not really find a good logo for Baidu's browser in particular). The implementation column now exposes a filtering menu using a I did not add any mechanism to let the author specify a list of UAs to render by default. I propose to postpone that to another PR. The current default is to display the four main codebases, because that's where the bulk of the implementation info is. The translation logic for the filtering menu is still missing. That still needs to be done before the PR can be merged. |
The implementation filtering mechanism now uses the JSON translation files to display the filtering menu label and the browser names. Code re-shuffled accordingly to put JavaScript functions common to the generation script and to the filtering script in the `utils.js` script and put JavaScript functions that are only useful for the generation script in a separate `generate-utils.js` script. Translation function also updated to fallback to English translations in all cases and record all missing translations in a global `warnings` array displayed when the page is generated at the end of the scripts' initialization to help with translations.
Translation logic now done. The PR should now be ready for full review and merge. Note: The need to handle translations for the filtering menu means that the |
Avoid underlines on category links in the main page, and make sure there is only one underline in the "See anything missing" section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is too large for me to effectively review, so I just reviewed the major parts (the code logic), and trust you for the rest of the patch.
Thanks! I'll push a fix to the Baidu Browser's logo. |
Thanks @xfq, the PR started small, it just grew out of control ;-) I realized last night that making This would have the benefit of keeping the logic once the page is generated simple. I'll try to craft another PR. |
NB: PR is not yet ready to merge!
Some updates on the way to improve the implementation info rendered on screen (#13, #128, #143, #211)
The code now renders more specific implementation information on screen using visual badges on top of browser icons. Badges are:
Essentially, there will always be a desktop/mobile badge and, most of the time, that badge will be the "desktop and mobile" one, because most recent features are developed on all platforms. FWIW, I tried different ideas there, including separating the desktop and mobile info completely, or using "not on desktop/mobile" badges to be able to use bare browser icons most of the time. The solution proposed here is the best I found so far...
A tooltip explains what the implementation info means, for instance:
"Experimental in Chrome (mobile). Feature requires using a prefix. Source: Chrome Platform Status."
That text also appears in a span element for accessibility readers.
Clicking on the browser icon takes the reader to the right page on the Platform Status Web site where the implementation info comes from.
Some changes made to the
extract-impl-data.js
script to make things possible:selected
flag on the implementation info that is considered to be the right one for each user agent.The styles of the generated table have been slightly updated to set some minimum width to the implementation column (enough to render 5 browsers), and some maximum width to the feature column (to keep it short).
Also created a
tr
function to translate strings instead of passing the translations object around.What still needs to be done: