revert(web): drop the 32x32 PNG favicon fallback
The SVG media query alone fixes the dark-mode icon for every SVG-capable browser (Chrome, Edge, Firefox, Safari 26+); the PNG only served Safari versions before 26, which is a shrinking legacy audience not worth a second asset, its manifest/link declarations, and the extra test surface. index.html and the manifest are back to the single SVG icon.
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<link rel="manifest" href="/manifest.webmanifest" />
|
<link rel="manifest" href="/manifest.webmanifest" />
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
|
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
<title>DeepSeek Harness</title>
|
<title>DeepSeek Harness</title>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -6,12 +6,6 @@
|
|||||||
"scope": "/",
|
"scope": "/",
|
||||||
"display": "fullscreen",
|
"display": "fullscreen",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
|
||||||
"src": "/favicon-32x32.png",
|
|
||||||
"sizes": "32x32",
|
|
||||||
"type": "image/png",
|
|
||||||
"purpose": "any"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"src": "/favicon.svg",
|
"src": "/favicon.svg",
|
||||||
"sizes": "any",
|
"sizes": "any",
|
||||||
|
|||||||
@@ -5,17 +5,9 @@ import { expect, it } from 'vitest'
|
|||||||
|
|
||||||
const DIST_ROOT = fileURLToPath(new URL('../dist', import.meta.url))
|
const DIST_ROOT = fileURLToPath(new URL('../dist', import.meta.url))
|
||||||
|
|
||||||
/** PNG signature per the PNG specification. */
|
|
||||||
const PNG_SIGNATURE = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]
|
|
||||||
|
|
||||||
it('ships install metadata with the built web application', async () => {
|
it('ships install metadata with the built web application', async () => {
|
||||||
const index = await readFile(join(DIST_ROOT, 'index.html'), 'utf8')
|
const index = await readFile(join(DIST_ROOT, 'index.html'), 'utf8')
|
||||||
expect(index).toContain('<link rel="manifest" href="/manifest.webmanifest" />')
|
expect(index).toContain('<link rel="manifest" href="/manifest.webmanifest" />')
|
||||||
expect(index).toContain('<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />')
|
|
||||||
// The SVG must stay declared after the PNG: the HTML spec selects the last
|
|
||||||
// equally appropriate icon, so SVG-capable browsers get the adaptive SVG
|
|
||||||
// while Safari versions before 26 fall back to the PNG.
|
|
||||||
expect(index.indexOf('/favicon-32x32.png')).toBeLessThan(index.indexOf('/favicon.svg'))
|
|
||||||
|
|
||||||
const manifest: unknown = JSON.parse(await readFile(join(DIST_ROOT, 'manifest.webmanifest'), 'utf8'))
|
const manifest: unknown = JSON.parse(await readFile(join(DIST_ROOT, 'manifest.webmanifest'), 'utf8'))
|
||||||
expect(manifest).toEqual({
|
expect(manifest).toEqual({
|
||||||
@@ -25,31 +17,15 @@ it('ships install metadata with the built web application', async () => {
|
|||||||
start_url: '/',
|
start_url: '/',
|
||||||
scope: '/',
|
scope: '/',
|
||||||
display: 'fullscreen',
|
display: 'fullscreen',
|
||||||
icons: [
|
icons: [{
|
||||||
{
|
src: '/favicon.svg',
|
||||||
src: '/favicon-32x32.png',
|
sizes: 'any',
|
||||||
sizes: '32x32',
|
type: 'image/svg+xml',
|
||||||
type: 'image/png',
|
purpose: 'any',
|
||||||
purpose: 'any',
|
}],
|
||||||
},
|
|
||||||
{
|
|
||||||
src: '/favicon.svg',
|
|
||||||
sizes: 'any',
|
|
||||||
type: 'image/svg+xml',
|
|
||||||
purpose: 'any',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
it('ships the PNG fallback as a valid non-empty 32x32 image', async () => {
|
|
||||||
const png = await readFile(join(DIST_ROOT, 'favicon-32x32.png'))
|
|
||||||
expect([...png.subarray(0, 8)]).toEqual(PNG_SIGNATURE)
|
|
||||||
expect(png.readUInt32BE(16)).toBe(32)
|
|
||||||
expect(png.readUInt32BE(20)).toBe(32)
|
|
||||||
expect(png.length).toBeGreaterThan(0)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('ships a favicon that switches to a light mark under dark color scheme', async () => {
|
it('ships a favicon that switches to a light mark under dark color scheme', async () => {
|
||||||
const favicon = await readFile(join(DIST_ROOT, 'favicon.svg'), 'utf8')
|
const favicon = await readFile(join(DIST_ROOT, 'favicon.svg'), 'utf8')
|
||||||
// The light fill must live inside the dark-scheme media query, so the icon
|
// The light fill must live inside the dark-scheme media query, so the icon
|
||||||
|
|||||||
Reference in New Issue
Block a user