DSH / Atlas
2026-10-13implementedfeature

Web install icons and launch display

Web 安装图标与启动显示

A launcher masks the icon it puts on the home screen and chooses that icon itself. The install manifest advertised the whale favicon: an SVG mark drawn edge to edge on a transparent canvas, with no tile and no background of its own. Handed to a mask, the mark loses its fins and fills the tile at the wrong proportion. iOS reads no manifest icon at all and had no `apple-touch-icon` to fall back on, so an installed web

English

Problem

A launcher masks the icon it puts on the home screen and chooses that icon itself. The install manifest advertised the whale favicon: an SVG mark drawn edge to edge on a transparent canvas, with no tile and no background of its own. Handed to a mask, the mark loses its fins and fills the tile at the wrong proportion. iOS reads no manifest icon at all and had no apple-touch-icon to fall back on, so an installed web app showed a generic tile. The manifest also requested display: "fullscreen", which removes both system bars on Android and leaves a chat surface with no clock, battery, or navigation.

Decision

apps/web/public/ carries four install icons: a 192px and a 512px any raster, a 512px maskable raster, and a 180px apple-touch-icon. render-app-icons.ts renders all four from the official application tile in apps/desktop/resources/icon.svg, and pnpm --filter @deepseek-ai/dsh-web-frontend run render:app-icons regenerates the committed files. Each variant preserves the whale's geometry, gradients, opacity, and filters. Rendering first produces a bitmap at no less than the 1024px source extent and four times the output edge, then reduces it with Lanczos3. This separate rasterization retains the original shading while smoothing the small icon's curves. Every variant crops the tile's desktop drop shadow. The two any variants have transparent rounded corners with a radius of 230/1024 of the tile edge, matching apps/desktop/resources/icon-macos.svg, and leave the whale unscaled. The Apple touch and maskable variants retain opaque square backgrounds for platform masking. The maskable variant scales the whale about the tile centre by MASKABLE_ARTWORK_SCALE while the tile's gradient keeps its own extent, so the border a mask may crop is still the real tile rather than a flat colour meeting it at a seam.

pwa-manifest.e2e.ts uses the browser image decoder to measure the committed maskable whale’s ink radius and rejects artwork outside the platform safe zone or smaller than the intended scale. The unscaled tile exceeds that zone and serves as the negative control.

The manifest requests display: "standalone", names #ffffff as its theme_color and background_color, and lists the three rasters. apps/web/index.html adds the apple-touch-icon link, mobile-web-app-capable, and apple-mobile-web-app-title. It adds no theme-color: ThemePresenter owns the single such node and follows the resolved in-application theme, which a static media query cannot. The tab favicons are unchanged.

This supersedes the icon entry and the display mode in the archived Web install manifest note; its link to the manifest, product name, compact name, and root identity remain current.

Alternatives considered

Keep favicon.svg as the only icon. It leaves iOS, which reads no manifest icon, with a generic tile, and the mark already reaches its own edges, so a launcher's mask crops it. pwa-manifest.e2e.ts keeps the unscaled tile’s overflow as its browser-pixel negative control.

Commit the rasters without a generator. The tile artwork moves with the desktop application's icon. A hand-exported set drifts silently and records neither the crop nor the safe-zone scale that makes it installable.

Draw a separate browser mark. The product has one approved tile. A second mark would need designer approval and would not match the installed desktop application beside it.

Keep display: "fullscreen". Hiding both system bars suits an immersive surface, not a conversation the user reads beside the clock and returns to from the app switcher; fullscreen also offers no way back to the bars without a swipe.

Ship a service worker for offline start. Installation, launch, and reconnect work without one. Offline use is a separate capability with its own cache-invalidation contract, and no current requirement asks for it.

Consequences

The repository carries four committed rasters, all rendered by one script from apps/desktop/resources/icon.svg. Changing the desktop tile means rerunning that script and reviewing the PNG diff. Unit tests check committed PNG dimensions, the rounded SVG's clip rectangle, its radius against the macOS artwork, and rejection of sources missing required SVG elements, without loading the native renderer. Browser tests execute the generator and decode its output and all four built PNGs, checking declared edges, transparent corners on the any icons, opaque corners on the Apple touch and maskable icons, and artwork extents against the source tile with a two-pixel rasterization tolerance. Maskable checks bound its artwork above and below, with the unscaled tile as the safe-zone negative control. Tests also compare fractional coverage along the Apple icon’s curves against direct small-size SVG rendering, which retains the source’s hard pixel edges.

The manifest's theme_color is one value and cannot follow the in-application theme, so a user whose theme differs from the system scheme sees that value until ThemePresenter writes the synchronized node shortly after boot. The presenter stays the only owner of meta[name="theme-color"]: a second static node wins document order and desynchronizes surrounding browser chrome from the rendered palette, which settings-chrome.e2e.ts pins.

iOS ignores background_color and masks the touch icon with its own rounded rectangle; the tile's own margins keep the whale clear of that mask. Android selects the maskable raster for the home screen and an any raster for the install surface. The install icons are not a service worker: an installed Web App still needs the Host reachable.

Real-device installation, launch display, and window mode remain a device check.

中文

Problem

启动器会自行选择放到桌面上的图标,并对它套用蒙层。安装 manifest 使用的却是鲸鱼 favicon:一个铺满整张画布、背景透明的 SVG 标记,既没有底板,也没有自己的背景。交给蒙层后,标记会丢掉尾鳍,并且以错误的比例填满图标。iOS 完全不读 manifest 图标,此前又没有 apple-touch-icon 可回退,因此安装后的 web app 只显示通用图标。manifest 还请求了 display: "fullscreen",这在 Android 上会同时移除两条系统栏,让一个对话界面失去时钟、电量和导航。

Decision

apps/web/public/ 承载四个安装图标:192px 与 512px 的 any 位图、512px 的 maskable 位图,以及 180px 的 apple-touch-icon。render-app-icons.ts 从 apps/desktop/resources/icon.svg 的官方应用底板渲染这四个文件,pnpm --filter @deepseek-ai/dsh-web-frontend run render:app-icons 重新生成已提交的文件。每个变体都保留鲸鱼的几何路径、渐变、透明度和滤镜。渲染先生成不小于源图 1024px、且边长至少为输出尺寸四倍的位图,再以 Lanczos3 下采样。分开的栅格化步骤在平滑小图标曲线的同时保留原有明暗细节。每个变体都会裁掉底板的桌面投影。两个 any 变体采用透明圆角,圆角半径为底板边长的 230/1024,与 apps/desktop/resources/icon-macos.svg 一致,鲸鱼保持原尺寸。Apple touch 和 maskable 变体保留不透明的方形背景,供平台裁切。maskable 变体围绕底板中心按 MASKABLE_ARTWORK_SCALE 缩放鲸鱼,而底板渐变保持自身范围,因此可能被蒙层裁掉的那圈边框仍是真实底板,而不是与其相接的纯色。

pwa-manifest.e2e.ts 使用浏览器图像解码器测量已提交 maskable 图标的鲸鱼墨迹半径,拒绝越出平台安全区或小于预期比例的图案。未缩放图块超出该安全区,用作反向对照。

manifest 请求 display: "standalone",把 theme_color 与 background_color 定为 #ffffff,并列出三个位图。apps/web/index.html 增加 apple-touch-icon 链接、mobile-web-app-capable 与 apple-mobile-web-app-title。它不添加 theme-color:该节点由 ThemePresenter 独占并跟随解析后的应用内主题,这是静态媒体查询做不到的。标签页 favicon 保持不变。

本决策取代已归档的 Web 安装 manifest 记录中的图标条目与显示模式;其指向 manifest 的链接、产品名、简称与根路径身份仍然有效。

Alternatives considered

只保留 favicon.svg 作为图标。 这会让不读 manifest 图标的 iOS 只显示通用图标,而该标记已经抵达自身边界,启动器的蒙层必然裁切它。pwa-manifest.e2e.ts 把未缩放图块的越界保留为浏览器像素反向对照。

不使用生成器,直接提交位图。 底板素材随桌面应用图标变化。手工导出的图标集会静默漂移,也无法记录使其可安装的裁剪方式与安全区缩放。

另画一个浏览器专用标记。 产品只有一个已批准的底板。第二个标记需要设计师批准,并且无法与旁边已安装的桌面应用保持一致。

保留 display: "fullscreen"。 隐藏两条系统栏适合沉浸式界面,而不适合用户对着时钟阅读、并从应用切换器返回的对话;fullscreen 也无法在不滑动的情况下恢复系统栏。

为离线启动引入 service worker。 安装、启动与重连都不需要它。离线使用是独立能力,有自己的缓存失效约定,当前没有需求要求它。

Consequences

仓库携带四张已提交的栅格图,均由同一个脚本从 apps/desktop/resources/icon.svg 渲染。桌面图块变化时,需要重新运行该脚本并审查 PNG diff。单元测试检查已提交 PNG 的尺寸、圆角 SVG 的裁切矩形、与 macOS 素材一致的圆角半径,以及源图缺少所需 SVG 元素时的拒绝行为,不加载原生渲染器。浏览器测试执行生成器,并解码生成结果和全部四张构建后的 PNG,检查声明边长、any 图标的透明圆角、Apple touch 与 maskable 图标的不透明角落,以及相对于源图块的图案范围;图案范围允许两个像素的栅格化容差。maskable 检查同时限制图案范围的上界和下界,并以未缩放图块作为安全区反向对照。测试也将 Apple 图标曲线边缘的部分像素覆盖与直接小尺寸渲染的 SVG 对比;后者保留源图的硬像素边缘。

manifest 的 theme_color 是单个值,无法跟随应用内主题;因此当用户选择的主题与系统方案不同时,该值会一直生效,直到 ThemePresenter 在启动后不久写入同步节点。该 presenter 仍是 meta[name="theme-color"] 的唯一所有者:第二个静态节点会在文档顺序上胜出,使周边浏览器界面与已渲染的配色脱节,这一点由 settings-chrome.e2e.ts 固定。

iOS 忽略 background_color,并用自己的圆角矩形裁切触摸图标;底板自带的留白使鲸鱼避开该蒙层。Android 为桌面选择 maskable 位图,为安装界面选择 any 位图。安装图标不是 service worker:安装后的 Web App 仍要求 Host 可达。

真机安装、启动显示与窗口模式仍属设备检查。