fix: add mobile PWA install metadata (#1663)

This commit is contained in:
Zhicheng Han
2026-06-19 09:00:34 +02:00
committed by GitHub
parent 0de8775f24
commit 66e7bc65ce
3 changed files with 50 additions and 0 deletions
+5
View File
@@ -4,6 +4,11 @@
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<link rel="apple-touch-icon" href="/logo.png" />
<link rel="manifest" href="/manifest.webmanifest" />
<meta name="theme-color" content="#f7f7f4" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-title" content="Hermes Studio" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hermes Studio</title>
<style>
@@ -0,0 +1,18 @@
{
"name": "Hermes Studio",
"short_name": "Hermes",
"description": "Self-hosted AI chat dashboard for Hermes Agent",
"start_url": "/#/hermes/chat",
"scope": "/",
"display": "standalone",
"background_color": "#f7f7f4",
"theme_color": "#f7f7f4",
"icons": [
{
"src": "/logo.png",
"sizes": "1254x1254",
"type": "image/png",
"purpose": "any maskable"
}
]
}
+27
View File
@@ -0,0 +1,27 @@
import { readFileSync } from 'fs'
import { describe, expect, it } from 'vitest'
describe('PWA metadata', () => {
it('links manifest and touch icon from the client shell', () => {
const html = readFileSync('packages/client/index.html', 'utf8')
expect(html).toContain('rel="manifest" href="/manifest.webmanifest"')
expect(html).toContain('rel="apple-touch-icon" href="/logo.png"')
expect(html).toContain('name="apple-mobile-web-app-title" content="Hermes Studio"')
})
it('ships a standalone web manifest with the Hermes icon', () => {
const manifest = JSON.parse(readFileSync('packages/client/public/manifest.webmanifest', 'utf8'))
expect(manifest.name).toBe('Hermes Studio')
expect(manifest.display).toBe('standalone')
expect(manifest.start_url).toBe('/#/hermes/chat')
expect(manifest.icons).toEqual(expect.arrayContaining([
expect.objectContaining({
src: '/logo.png',
type: 'image/png',
purpose: 'any maskable',
}),
]))
})
})