Skip to content

Interop feature badges #1488

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export class WebstatusFeatureBadge extends LitElement {
}

render() {
console.log(this.badgeType);
if (!this.badgeType) {
return html``;
}
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/static/js/components/webstatus-overview-cells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
import {BROWSER_ID_TO_ICON_NAME, FeatureSortOrderType} from '../api/client.js';
import {ifDefined} from 'lit/directives/if-defined.js';
import {
INTEROP_FEATURES,
TOP_CSS_INTEROP_ISSUES,
TOP_HTML_INTEROP_ISSUES,
} from '../utils/constants.js';
Expand Down Expand Up @@ -194,6 +195,13 @@ function getFeatureBadges(featureId: string): TemplateResult[] {
></webstatus-feature-badge>`,
);
}
if (INTEROP_FEATURES.includes(featureId)) {
extraIdentifiers.push(
html`<webstatus-feature-badge
.badgeType=${'interop'}
></webstatus-feature-badge>`,
);
}
return extraIdentifiers;
}

Expand Down
33 changes: 32 additions & 1 deletion frontend/src/static/js/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,36 @@ export const TOP_HTML_INTEROP_ISSUES: string[] = [
'web-bluetooth',
];

// This focus area to web feature mapping is defined at
// https://github.com/web-platform-tests/interop/blob/main/web-features.json
export const INTEROP_FEATURES: string[] = [
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know this is still in draft, but could you add a comment that links to the source for this? In case we need to update for future years

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Great idea, I've added it. 🙂

The file that contains this mapping hasn't landed yet, so we can keep this PR as a draft until it's ready.

'backdrop-filter',
'largest-contentful-paint',
'anchor-positioning',
'details',
'flexbox',
'grid',
'subgrid',
'json-modules',
'navigation',
'pointer-events-api',
'mouse-events',
'mutation-events',
'scope',
'scrollend',
'storage-access',
'text-decoration',
'urlpattern',
'view-transitions',
'view-transitions-class',
'wasm-string-builtins',
'appearance',
'zoom',
'list-style',
'webrtc-encoded-transform',
'writing-mode',
];

export const DEFAULT_GLOBAL_SAVED_SEARCHES: GlobalSavedSearch[] = [
{
name: 'Baseline 2025',
Expand Down Expand Up @@ -243,7 +273,8 @@ export const BADGE_PARAMS_BY_TYPE = {
interop: {
name: 'INTEROP',
url: 'https://wpt.fyi/interop',
description: 'This feature is a focus area for the Interop 2025 effort.',
description:
'This feature is part of a focus area for the Interop 2025 effort.',
variant: 'neutral',
},
} as const satisfies Record<string, BadgeConfig>;
Expand Down