-
Notifications
You must be signed in to change notification settings - Fork 198
Add Baseline status to hovercards #428
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
Conversation
|
FYI I was getting a TypeScript error related to my use of the I can fix it by upgrading the tsconfig to es2021, but figured that would need to be part of a separate discussion. For now I worked around it by changing it to |
|
|
@aeschli sure I've removed the |
|
Found an issue with the Actual:
Expected:
I fixed this by removing support strings from the |
|
Thanks for the PR. I think we need to improve the look of the hover.
My suggestion:
|
|
The mockups are good. I still don't like the extra wide baseline icons. It's a bit too large for the text size, also I find the form not very intuitive. Is the shape important to you? Can we not just add a checkmark? Or make it a bit smaller? |
|
BTW I adopted the custom data, but didn't make any changes to the hover. Leaving this to you. |
…e into baseline-status
|
Regarding the use of icons, thank you @aeschli for your feedback on the fact that they're not intuitive. @atopal, let's add this to other feedback we might have received and reflect on whether improvements are needed on the long run. For now, though (i.e., for this PR), I strongly suggest keeping the Baseline icons as they are defined now, and not deviate from them. The reason is that Baseline is an attempt at summarizing the many details of a very fragmented and nuanced web platform, into something that's as simple as 3 statuses only. This is essentially impossible to do, but we believe that doing it in the way we're doing it now still has more benefits than drawbacks if, and only if, Baseline is communicated correctly. Changing the icons to a checkmark and a warning icon would simplify what Baseline is even more, to the point that it becomes dangerous. So, Baseline messages/icons should never appear to developers as something that may steer them away from using a feature. |
|
The smaller baseline icon looks better. Lets go with that! |
|
@aeschli this is ready for another look |
|
@rviscomi Thanks Rick, nice work, it looks great! |
|
Thanks for all your help and can't wait to see it live! 🥳 |
| return status; | ||
| } | ||
|
|
||
| const baselineYear = baseline.baseline_low_date?.split('-')[0]; |
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.
@rviscomi If the status is low, then baseline_low_date is used, but if the status is high, then again baseline_low_date is used, not baseline_high_date. It turns out that baseline_high_date is not used at all. Is this not a bug? Is this by design?
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.
Hi, yes this is by design and is consistent with other Baseline resources. For example, the dialog element is widely available since 2024, and Baseline since 2022:
status:
baseline: high
baseline_low_date: 2022-03-14
baseline_high_date: 2024-09-14
Resources like MDN and the Web Platform Dashboard show the newly available date:
| // TODO: Remove "as any" when tsconfig supports es2021+ | ||
| const missingBaselineBrowserFormatter = new (Intl as any).ListFormat("en", { | ||
| style: "long", | ||
| type: "disjunction", |
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.
@rviscomi Why did you use disjunction instead of conjunction here? 🤔
This makes the text look like Limited availability across major browsers (Not fully implemented in Chrome, Edge, or Safari) instead of Limited availability across major browsers (Not fully implemented in Chrome, Edge, and Safari).
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.
"or" is more correct. Here's Gemini to help articulate exactly why that is 😄
When listing items that share a common negative characteristic, using "or" is generally more grammatically precise and less ambiguous.
So, the more correct phrasing is:
"Not fully implemented in Chrome, Edge, or Safari"Here's why:
- Meaning with "or": This sentence structure implies that the negation ("Not fully implemented") applies to each browser individually:
- It is not fully implemented in Chrome,
- AND it is not fully implemented in Edge,
- AND it is not fully implemented in Safari. This accurately conveys that none of the listed browsers have full implementation. In logic, this corresponds to
¬A ∧ ¬B ∧ ¬C.- Potential ambiguity with "and": The sentence "Not fully implemented in Chrome, Edge, and Safari" could be interpreted to mean: "It is not the case that the feature is fully implemented in all three (Chrome, Edge, and Safari) simultaneously."
- This statement would be true even if the feature was implemented in Chrome and Edge but not in Safari (i.e., at least one of them doesn't have it). In logic, this corresponds to
¬(A ∧ B ∧ C), which is equivalent to¬A ∨ ¬B ∨ ¬C(at least one is not implemented).- While readers might often infer the intended meaning (that none of them have it), the "and" phrasing is technically ambiguous and not as precise for indicating that each listed item lacks the feature.
For clear technical documentation, where precision is important, "or" is the preferred conjunction in this negative context to ensure the meaning is that each of the browsers listed does not support the feature.
| } | ||
| }; | ||
|
|
||
| const shortCompatPattern = /(E|FFA|FF|SM|S|CA|C|IE|O)([\d|\.]+)?/; |
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.
@rviscomi Why are we looking for the | character in the [\d|\.] part? 🤔
I've analyzed the browsers.css-data.json file from the @vscode/web-custom-data package and haven't found a single property that has this character in the browsers or values.browsers field.
But I've found 5 properties that have values in the browsers field, that don't match current pattern:
overflow-anchor: 'Spreview'
-moz-background-clip: 'FF1-3.6'
-ms-filter: 'IE8-9'
-ms-transform: 'IE9-9'
-ms-transform-origin: 'IE9-9'
Actually, we are not interested in the version value (the second part of the regexp), only the browser name (the first part of the regexp).
Maybe we can do with a simpler regexp or without using a regexp at all?
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.
I included the regex here in its original form for compatibility with customData.schema.json. It seems the | character was intended to be used as an "or" operator, so it could probably be safely removed.
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.
@aeschli PTAL.
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.
You can remove the |...
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.
@aeschli I've opened microsoft/vscode-custom-data#117.













Progress on #427
Hovercard changes:
Demo:
baseline-vscode.mov
Screenshots...
Widely available
Before:

After (dark mode):

After (light mode):

Newly available
Before:

After (dark mode):

After (light mode):

Limited availability
Before:

After (dark mode):

After (light mode):

Experimental
Before:

After (dark mode):

After (light mode):

(experimental warning removed, as it's redundant with the limited availability message)
Obsolete
Before:

After (dark mode):

After (light mode):

(obsolete warning kept)