@@ -23,6 +23,9 @@ const pattern = /<!--\s*web-features\s*:\s*([a-z0-9-]+)\s*-->/;
2323const mappingsUrl =
2424 "https://raw.githubusercontent.com/web-platform-dx/web-features-mappings/refs/heads/main/mappings/combined-data.json" ;
2525
26+ const imgDir =
27+ "https://raw.githubusercontent.com/web-platform-dx/developer-signals/refs/heads/main/img" ;
28+
2629interface VendorPosition {
2730 vendor : "mozilla" | "webkit" ;
2831 url : string ;
@@ -72,10 +75,14 @@ const dateFormat = new Intl.DateTimeFormat("en", {
7275} ) ;
7376
7477function issueBody ( id : string , data : ( typeof features ) [ string ] ) {
78+ const supportSummary : Record < string , boolean > = { } ;
7579 const supportLines = [ ] ;
7680 for ( const [ browser , { name, releases } ] of Object . entries ( browsers ) ) {
7781 const version = data . status . support [ browser as keyof typeof browsers ] ;
7882 const v = version ?. replace ( "≤" , "" ) ;
83+ const baseBrowser = browser . split ( "_" ) [ 0 ] ; // browser without OS
84+ supportSummary [ baseBrowser ] ??= true ;
85+ supportSummary [ baseBrowser ] = supportSummary [ baseBrowser ] && ! ! v ;
7986 if ( v ) {
8087 const date = releases . find ( ( r ) => r . version === v ) ! . date ;
8188 const dateString = dateFormat . format ( new Date ( date ) ) ;
@@ -84,7 +91,17 @@ function issueBody(id: string, data: (typeof features)[string]) {
8491 supportLines . push ( `${ name } : not supported` ) ;
8592 }
8693 }
87- const supportBlock = supportLines . map ( ( l ) => `- ${ l } ` ) . join ( "\n" ) ;
94+ const supportIcons = Object . entries ( supportSummary ) . map ( ( [ browser , available ] ) => {
95+ const availability = available ? "available" : "unavailable" ;
96+ return `<img src="${ imgDir } /${ browser } .svg" alt="${ browser } "><img src="${ imgDir } /${ availability } .svg" alt="${ availability } ">` ;
97+ } ) ;
98+ const supportBlock = dedent `
99+ <details>
100+ <summary>${ supportIcons . join ( " " ) } </summary>
101+
102+ ${ supportLines . map ( ( l ) => `- ${ l } ` ) . join ( "\n" ) }
103+ </details>
104+ ` ;
88105
89106 // TODO: include MDN links (before caniuse link) when we have web-features-mappings
90107 // as a dependency (see above).
0 commit comments