Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
feat(desktop): stop shipping bundled UI fonts
vastsafb37f9c26d91
diff --git a/apps/desktop/src/assets/fonts/geist.woff2 b/apps/desktop/src/assets/fonts/geist.woff2deleted file mode 100644index 5c5999d61..000000000Binary files a/apps/desktop/src/assets/fonts/geist.woff2 and /dev/null differdiff --git a/apps/desktop/src/assets/fonts/inter.woff2 b/apps/desktop/src/assets/fonts/inter.woff2deleted file mode 100644index 5a8d3e72a..000000000Binary files a/apps/desktop/src/assets/fonts/inter.woff2 and /dev/null differdiff --git a/apps/desktop/src/assets/fonts/licenses/OFL-Geist.txt b/apps/desktop/src/assets/fonts/licenses/OFL-Geist.txtdeleted file mode 100644index 8d003fec6..000000000--- a/apps/desktop/src/assets/fonts/licenses/OFL-Geist.txt+++ /dev/null@@ -1,92 +0,0 @@-Copyright (c) 2023 Vercel, in collaboration with basement.studio--This Font Software is licensed under the SIL Open Font License, Version 1.1.-This license is copied below, and is also available with a FAQ at:-http://scripts.sil.org/OFL--------------------------------------------------------------SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007--------------------------------------------------------------PREAMBLE-The goals of the Open Font License (OFL) are to stimulate worldwide-development of collaborative font projects, to support the font creation-efforts of academic and linguistic communities, and to provide a free and-open framework in which fonts may be shared and improved in partnership-with others.--The OFL allows the licensed fonts to be used, studied, modified and-redistributed freely as long as they are not sold by themselves. The-fonts, including any derivative works, can be bundled, embedded,-redistributed and/or sold with any software provided that any reserved-names are not used by derivative works. The fonts and derivatives,-however, cannot be released under any other type of license. The-requirement for fonts to remain under this license does not apply-to any document created using the fonts or their derivatives.--DEFINITIONS-"Font Software" refers to the set of files released by the Copyright-Holder(s) under this license and clearly marked as such. This may-include source files, build scripts and documentation.--"Reserved Font Name" refers to any names specified as such after the-copyright statement(s).--"Original Version" refers to the collection of Font Software components as-distributed by the Copyright Holder(s).--"Modified Version" refers to any derivative made by adding to, deleting,-or substituting -- in part or in whole -- any of the components of the-Original Version, by changing formats or by porting the Font Software to a-new environment.--"Author" refers to any designer, engineer, programmer, technical-writer or other person who contributed to the Font Software.--PERMISSION AND CONDITIONS-Permission is hereby granted, free of charge, to any person obtaining-a copy of the Font Software, to use, study, copy, merge, embed, modify,-redistribute, and sell modified and unmodified copies of the Font-Software, subject to the following conditions:--1) Neither the Font Software nor any of its individual components,-in Original or Modified Versions, may be sold by itself.--2) Original or Modified Versions of the Font Software may be bundled,-redistributed and/or sold with any software, provided that each copy-contains the above copyright notice and this license. These can be-included either as stand-alone text files, human-readable headers or-in the appropriate machine-readable metadata fields within text or-binary files as long as those fields can be easily viewed by the user.--3) No Modified Version of the Font Software may use the Reserved Font-Name(s) unless explicit written permission is granted by the corresponding-Copyright Holder. This restriction only applies to the primary font name as-presented to the users.--4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font-Software shall not be used to promote, endorse or advertise any-Modified Version, except to acknowledge the contribution(s) of the-Copyright Holder(s) and the Author(s) or with their explicit written-permission.--5) The Font Software, modified or unmodified, in part or in whole,-must be distributed entirely under this license, and must not be-distributed under any other license. The requirement for fonts to-remain under this license does not apply to any document created-using the Font Software.--TERMINATION-This license becomes null and void if any of the above conditions are-not met.--DISCLAIMER-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM-OTHER DEALINGS IN THE FONT SOFTWARE.diff --git a/apps/desktop/src/assets/fonts/licenses/OFL-Inter.txt b/apps/desktop/src/assets/fonts/licenses/OFL-Inter.txtdeleted file mode 100644index 9b2ca37b3..000000000--- a/apps/desktop/src/assets/fonts/licenses/OFL-Inter.txt+++ /dev/null@@ -1,92 +0,0 @@-Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter)--This Font Software is licensed under the SIL Open Font License, Version 1.1.-This license is copied below, and is also available with a FAQ at:-http://scripts.sil.org/OFL--------------------------------------------------------------SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007--------------------------------------------------------------PREAMBLE-The goals of the Open Font License (OFL) are to stimulate worldwide-development of collaborative font projects, to support the font creation-efforts of academic and linguistic communities, and to provide a free and-open framework in which fonts may be shared and improved in partnership-with others.--The OFL allows the licensed fonts to be used, studied, modified and-redistributed freely as long as they are not sold by themselves. The-fonts, including any derivative works, can be bundled, embedded,-redistributed and/or sold with any software provided that any reserved-names are not used by derivative works. The fonts and derivatives,-however, cannot be released under any other type of license. The-requirement for fonts to remain under this license does not apply-to any document created using the fonts or their derivatives.--DEFINITIONS-"Font Software" refers to the set of files released by the Copyright-Holder(s) under this license and clearly marked as such. This may-include source files, build scripts and documentation.--"Reserved Font Name" refers to any names specified as such after the-copyright statement(s).--"Original Version" refers to the collection of Font Software components as-distributed by the Copyright Holder(s).--"Modified Version" refers to any derivative made by adding to, deleting,-or substituting -- in part or in whole -- any of the components of the-Original Version, by changing formats or by porting the Font Software to a-new environment.--"Author" refers to any designer, engineer, programmer, technical-writer or other person who contributed to the Font Software.--PERMISSION AND CONDITIONS-Permission is hereby granted, free of charge, to any person obtaining-a copy of the Font Software, to use, study, copy, merge, embed, modify,-redistribute, and sell modified and unmodified copies of the Font-Software, subject to the following conditions:--1) Neither the Font Software nor any of its individual components,-in Original or Modified Versions, may be sold by itself.--2) Original or Modified Versions of the Font Software may be bundled,-redistributed and/or sold with any software, provided that each copy-contains the above copyright notice and this license. These can be-included either as stand-alone text files, human-readable headers or-in the appropriate machine-readable metadata fields within text or-binary files as long as those fields can be easily viewed by the user.--3) No Modified Version of the Font Software may use the Reserved Font-Name(s) unless explicit written permission is granted by the corresponding-Copyright Holder. This restriction only applies to the primary font name as-presented to the users.--4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font-Software shall not be used to promote, endorse or advertise any-Modified Version, except to acknowledge the contribution(s) of the-Copyright Holder(s) and the Author(s) or with their explicit written-permission.--5) The Font Software, modified or unmodified, in part or in whole,-must be distributed entirely under this license, and must not be-distributed under any other license. The requirement for fonts to-remain under this license does not apply to any document created-using the Font Software.--TERMINATION-This license becomes null and void if any of the above conditions are-not met.--DISCLAIMER-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM-OTHER DEALINGS IN THE FONT SOFTWARE.diff --git a/apps/desktop/src/assets/fonts/licenses/OFL-LXGWWenKai.txt b/apps/desktop/src/assets/fonts/licenses/OFL-LXGWWenKai.txtdeleted file mode 100644index f170b5c5f..000000000--- a/apps/desktop/src/assets/fonts/licenses/OFL-LXGWWenKai.txt+++ /dev/null@@ -1,94 +0,0 @@-Copyright 2021-2026 LXGW (https://github.com/lxgw/LxgwWenKai)-Copyright 2020 The Klee Project Authors (https://github.com/fontworks-fonts/Klee)--This Font Software is licensed under the SIL Open Font License, Version 1.1.-This license is copied below, and is also available with a FAQ at:-https://openfontlicense.org---------------------------------------------------------------SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007--------------------------------------------------------------PREAMBLE-The goals of the Open Font License (OFL) are to stimulate worldwide-development of collaborative font projects, to support the font creation-efforts of academic and linguistic communities, and to provide a free and-open framework in which fonts may be shared and improved in partnership-with others.--The OFL allows the licensed fonts to be used, studied, modified and-redistributed freely as long as they are not sold by themselves. The-fonts, including any derivative works, can be bundled, embedded,-redistributed and/or sold with any software provided that any reserved-names are not used by derivative works. The fonts and derivatives,-however, cannot be released under any other type of license. The-requirement for fonts to remain under this license does not apply-to any document created using the fonts or their derivatives.--DEFINITIONS-"Font Software" refers to the set of files released by the Copyright-Holder(s) under this license and clearly marked as such. This may-include source files, build scripts and documentation.--"Reserved Font Name" refers to any names specified as such after the-copyright statement(s).--"Original Version" refers to the collection of Font Software components as-distributed by the Copyright Holder(s).--"Modified Version" refers to any derivative made by adding to, deleting,-or substituting -- in part or in whole -- any of the components of the-Original Version, by changing formats or by porting the Font Software to a-new environment.--"Author" refers to any designer, engineer, programmer, technical-writer or other person who contributed to the Font Software.--PERMISSION & CONDITIONS-Permission is hereby granted, free of charge, to any person obtaining-a copy of the Font Software, to use, study, copy, merge, embed, modify,-redistribute, and sell modified and unmodified copies of the Font-Software, subject to the following conditions:--1) Neither the Font Software nor any of its individual components,-in Original or Modified Versions, may be sold by itself.--2) Original or Modified Versions of the Font Software may be bundled,-redistributed and/or sold with any software, provided that each copy-contains the above copyright notice and this license. These can be-included either as stand-alone text files, human-readable headers or-in the appropriate machine-readable metadata fields within text or-binary files as long as those fields can be easily viewed by the user.--3) No Modified Version of the Font Software may use the Reserved Font-Name(s) unless explicit written permission is granted by the corresponding-Copyright Holder. This restriction only applies to the primary font name as-presented to the users.--4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font-Software shall not be used to promote, endorse or advertise any-Modified Version, except to acknowledge the contribution(s) of the-Copyright Holder(s) and the Author(s) or with their explicit written-permission.--5) The Font Software, modified or unmodified, in part or in whole,-must be distributed entirely under this license, and must not be-distributed under any other license. The requirement for fonts to-remain under this license does not apply to any document created-using the Font Software.--TERMINATION-This license becomes null and void if any of the above conditions are-not met.--DISCLAIMER-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM-OTHER DEALINGS IN THE FONT SOFTWARE.diff --git a/apps/desktop/src/assets/fonts/licenses/OFL-NotoSansSC.txt b/apps/desktop/src/assets/fonts/licenses/OFL-NotoSansSC.txtdeleted file mode 100644index 1c9f43281..000000000--- a/apps/desktop/src/assets/fonts/licenses/OFL-NotoSansSC.txt+++ /dev/null@@ -1,93 +0,0 @@-Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'--This Font Software is licensed under the SIL Open Font License, Version 1.1.-This license is copied below, and is also available with a FAQ at:-https://scripts.sil.org/OFL---------------------------------------------------------------SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007--------------------------------------------------------------PREAMBLE-The goals of the Open Font License (OFL) are to stimulate worldwide-development of collaborative font projects, to support the font creation-efforts of academic and linguistic communities, and to provide a free and-open framework in which fonts may be shared and improved in partnership-with others.--The OFL allows the licensed fonts to be used, studied, modified and-redistributed freely as long as they are not sold by themselves. The-fonts, including any derivative works, can be bundled, embedded,-redistributed and/or sold with any software provided that any reserved-names are not used by derivative works. The fonts and derivatives,-however, cannot be released under any other type of license. The-requirement for fonts to remain under this license does not apply-to any document created using the fonts or their derivatives.--DEFINITIONS-"Font Software" refers to the set of files released by the Copyright-Holder(s) under this license and clearly marked as such. This may-include source files, build scripts and documentation.--"Reserved Font Name" refers to any names specified as such after the-copyright statement(s).--"Original Version" refers to the collection of Font Software components as-distributed by the Copyright Holder(s).--"Modified Version" refers to any derivative made by adding to, deleting,-or substituting -- in part or in whole -- any of the components of the-Original Version, by changing formats or by porting the Font Software to a-new environment.--"Author" refers to any designer, engineer, programmer, technical-writer or other person who contributed to the Font Software.--PERMISSION & CONDITIONS-Permission is hereby granted, free of charge, to any person obtaining-a copy of the Font Software, to use, study, copy, merge, embed, modify,-redistribute, and sell modified and unmodified copies of the Font-Software, subject to the following conditions:--1) Neither the Font Software nor any of its individual components,-in Original or Modified Versions, may be sold by itself.--2) Original or Modified Versions of the Font Software may be bundled,-redistributed and/or sold with any software, provided that each copy-contains the above copyright notice and this license. These can be-included either as stand-alone text files, human-readable headers or-in the appropriate machine-readable metadata fields within text or-binary files as long as those fields can be easily viewed by the user.--3) No Modified Version of the Font Software may use the Reserved Font-Name(s) unless explicit written permission is granted by the corresponding-Copyright Holder. This restriction only applies to the primary font name as-presented to the users.--4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font-Software shall not be used to promote, endorse or advertise any-Modified Version, except to acknowledge the contribution(s) of the-Copyright Holder(s) and the Author(s) or with their explicit written-permission.--5) The Font Software, modified or unmodified, in part or in whole,-must be distributed entirely under this license, and must not be-distributed under any other license. The requirement for fonts to-remain under this license does not apply to any document created-using the Font Software.--TERMINATION-This license becomes null and void if any of the above conditions are-not met.--DISCLAIMER-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM-OTHER DEALINGS IN THE FONT SOFTWARE.diff --git a/apps/desktop/src/assets/fonts/lxgw-wenkai.woff2 b/apps/desktop/src/assets/fonts/lxgw-wenkai.woff2deleted file mode 100644index ac18bd2cd..000000000Binary files a/apps/desktop/src/assets/fonts/lxgw-wenkai.woff2 and /dev/null differdiff --git a/apps/desktop/src/assets/fonts/noto-sans-sc.woff2 b/apps/desktop/src/assets/fonts/noto-sans-sc.woff2deleted file mode 100644index 0dbe6f17b..000000000Binary files a/apps/desktop/src/assets/fonts/noto-sans-sc.woff2 and /dev/null differdiff --git a/apps/desktop/src/components/settings/FontFamilyRow.tsx b/apps/desktop/src/components/settings/FontFamilyRow.tsxindex 98bb248b1..0ffdddfa3 100644--- a/apps/desktop/src/components/settings/FontFamilyRow.tsx+++ b/apps/desktop/src/components/settings/FontFamilyRow.tsx@@ -24,8 +24,8 @@ import { IconCheck, IconChevronDown, IconSearch } from "../icons";/*** Global UI font picker (Settings → Basics → Appearance). Offers the- * system default, bundled open-licensed families, and installed system- * families; the selected stack is persisted as `AppSettings.fontFamily`+ * system default and installed system families; the app bundles no fonts of+ * its own. The selected stack is persisted as `AppSettings.fontFamily`* and applied to `--font-sans` by App. Selecting the localized system-default* option persists an empty stack, which every consumer treats as the built-in* token stack. The closed trigger and search haystack use `settings.fontSystemDefault`@@ -175,7 +175,6 @@ export function FontFamilyRow({}, [defaultLabel, options, query]);const groupLabel = useCallback((group: string) => {- if (group === "bundled") return t("settings.fontBundled");if (group === "system") return t("settings.fontSystem");if (group === "custom") return t("settings.fontCustom");return t("settings.fontSystemDefault");@@ -413,11 +412,6 @@ export function FontFamilyRow({? t("settings.fontSystemDefault"): row.option.label}</span>- {row.option.license ? (- <span className="settings-font-item-license">- {row.option.license}- </span>- ) : null}{row.option.value === selectedValue ? (<IconChecksize={14}diff --git a/apps/desktop/src/lib/fonts.ts b/apps/desktop/src/lib/fonts.tsindex 1e8be43e8..e06b59a2b 100644--- a/apps/desktop/src/lib/fonts.ts+++ b/apps/desktop/src/lib/fonts.ts@@ -2,60 +2,15 @@* Global UI font model for the Settings picker.** A selection is stored as a CSS `font-family` stack string in- * `AppSettings.fontFamily`. Bundled families are open-licensed- * (SIL OFL 1.1) and shipped with the app; system families are enumerated- * by Electron main. Every stack keeps CJK fallbacks so Chinese text stays- * readable when the selected family has no CJK glyphs.+ * `AppSettings.fontFamily`. Only installed system families are offered — the+ * app ships no fonts of its own — and every stack keeps system CJK fallbacks+ * so Chinese text stays readable when the selected family has no CJK glyphs.*//**- * CJK fallback tier appended to every custom stack. Noto Sans SC is bundled- * (OFL); PingFang/YaHei cover platforms where it is not installed.+ * CJK fallback tier appended to every custom stack. All three families are+ * provided by the platform; the app bundles no CJK face of its own.*/-const CJK_FALLBACK = `"Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif`;--export type BundledFont = {- /** Stable id used only for option keys, never persisted. */- id: string;- /** Human-readable family name shown in the picker. */- label: string;- /** CSS family name registered by @font-face (fonts.css). */- family: string;- /** Full CSS stack persisted when the option is selected. */- stack: string;- /** Short license note shown under the option. */- license: string;-};--export const BUNDLED_FONTS: readonly BundledFont[] = [- {- id: "geist",- label: "Geist",- family: "Geist",- license: "OFL",- stack: `"Geist", ${CJK_FALLBACK}`,- },- {- id: "inter",- label: "Inter",- family: "Inter",- license: "OFL",- stack: `"Inter", ${CJK_FALLBACK}`,- },- {- id: "noto-sans-sc",- label: "Noto Sans SC",- family: "Noto Sans SC",- license: "OFL",- stack: `"Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif`,- },- {- id: "lxgw-wenkai",- label: "LXGW WenKai",- family: "LXGW WenKai",- license: "OFL",- stack: `"LXGW WenKai", ${CJK_FALLBACK}`,- },-];+const CJK_FALLBACK = `"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif`;export type FontOption = {/** CSS stack persisted on selection; `""` selects the system default. */@@ -64,8 +19,7 @@ export type FontOption = {label: string;/** Family used to render the picker preview in the chosen face. */family: string;- group: "default" | "bundled" | "system" | "custom";- license?: string;+ group: "default" | "system" | "custom";};/** Quote a bare family name for use inside a CSS font-family stack. */@@ -84,9 +38,11 @@ function systemStack(family: string): string {}/**- * Build the picker options: system default, bundled open-licensed families,- * then installed system families. The current stored stack is re-added first- * when it no longer matches any known option (e.g. the font was uninstalled).+ * Build the picker options: the system default, then installed system+ * families. The current stored stack is re-added first when it no longer+ * matches any known option — the family was uninstalled, or the stack names+ * one of the bundled faces an earlier build shipped and this one no longer+ * does.*/export function buildFontOptions(systemFonts: readonly string[],@@ -94,13 +50,6 @@ export function buildFontOptions(): FontOption[] {const options: FontOption[] = [{ value: "", label: "System default", family: "", group: "default" },- ...BUNDLED_FONTS.map((font) => ({- value: font.stack,- label: font.label,- family: font.family,- license: font.license,- group: "bundled" as const,- })),...systemFonts.map((family) => ({value: systemStack(family),label: family,diff --git a/apps/desktop/src/styles/fonts.css b/apps/desktop/src/styles/fonts.cssdeleted file mode 100644index 4979f2172..000000000--- a/apps/desktop/src/styles/fonts.css+++ /dev/null@@ -1,38 +0,0 @@-/*- Bundled open-licensed UI fonts (SIL OFL 1.1 — commercial use and- redistribution are permitted). License texts ship in- src/assets/fonts/licenses/. The Settings font picker writes a CSS stack- whose first family is one of these; the @font-face rules below stay loaded- so a persisted selection renders offline and across restarts.-*/-@font-face {- font-family: "Geist";- src: url("../assets/fonts/geist.woff2") format("woff2-variations");- font-weight: 100 900;- font-style: normal;- font-display: swap;-}--@font-face {- font-family: "Inter";- src: url("../assets/fonts/inter.woff2") format("woff2-variations");- font-weight: 100 900;- font-style: normal;- font-display: swap;-}--@font-face {- font-family: "Noto Sans SC";- src: url("../assets/fonts/noto-sans-sc.woff2") format("woff2-variations");- font-weight: 100 900;- font-style: normal;- font-display: swap;-}--@font-face {- font-family: "LXGW WenKai";- src: url("../assets/fonts/lxgw-wenkai.woff2") format("woff2");- font-weight: 400;- font-style: normal;- font-display: swap;-}diff --git a/apps/desktop/src/styles/globals.css b/apps/desktop/src/styles/globals.cssindex f26469bf1..74b5ad231 100644--- a/apps/desktop/src/styles/globals.css+++ b/apps/desktop/src/styles/globals.css@@ -9,7 +9,6 @@responsive/reduced-motion tail last so it can override what precedes it.Reordering these imports changes rendering.*/-@import "./fonts.css";@import "./tokens.css";@import "./base.css";@import "./chrome.css";diff --git a/apps/desktop/src/styles/settings.css b/apps/desktop/src/styles/settings.cssindex a8d888585..454907e03 100644--- a/apps/desktop/src/styles/settings.css+++ b/apps/desktop/src/styles/settings.css@@ -1122,15 +1122,6 @@white-space: nowrap;}-.settings-font-item-license {- flex: 0 0 auto;- color: var(--ds-text-muted);- font-size: var(--text-2xs);- font-weight: var(--font-weight-strong);- letter-spacing: var(--tracking-wide);- text-transform: uppercase;-}-.settings-font-check {flex: 0 0 auto;color: var(--ds-accent);diff --git a/apps/desktop/test/font-list.test.mjs b/apps/desktop/test/font-list.test.mjsindex f8bbc55e8..236cf1bb0 100644--- a/apps/desktop/test/font-list.test.mjs+++ b/apps/desktop/test/font-list.test.mjs@@ -44,7 +44,7 @@ test("buildFontListLayout emits a group row before each group and fixed heights"test("buildFontListLayout places group rows only at group boundaries", () => {const options = [option("System default", "default"),- option("Geist", "bundled"),+ option("Geist", "custom"),option("Arial", "system"),option("Verdana", "system"),];@@ -53,7 +53,7 @@ test("buildFontListLayout places group rows only at group boundaries", () => {layout.rows.filter((row) => row.kind === "group").map((row) => row.label),- ["[default]", "[bundled]", "[system]"],+ ["[default]", "[custom]", "[system]"],);assert.equal(layout.rows.length, 3 + 4);assert.deepEqual(layout.optionRowIndex, [1, 3, 5, 6]);diff --git a/apps/desktop/test/fonts.test.mjs b/apps/desktop/test/fonts.test.mjsindex a7ae83951..33c50000e 100644--- a/apps/desktop/test/fonts.test.mjs+++ b/apps/desktop/test/fonts.test.mjs@@ -1,12 +1,13 @@import assert from "node:assert/strict";import test from "node:test";import {- BUNDLED_FONTS,buildFontOptions,cssFamilyForName,readableFontFamily,} from "../src/lib/fonts.ts";+const CJK_FALLBACK = `"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif`;+test("cssFamilyForName quotes names and escapes single quotes", () => {assert.equal(cssFamilyForName("PingFang SC"), "'PingFang SC'");assert.equal(cssFamilyForName("O'Brien"), "'O\\'Brien'");@@ -18,24 +19,33 @@ test("readableFontFamily extracts the first family without quotes", () => {assert.equal(readableFontFamily("Arial"), "Arial");});-test("bundled fonts are OFL-licensed and keep CJK fallbacks", () => {- for (const font of BUNDLED_FONTS) {- assert.match(font.license, /OFL/);- assert.ok(font.stack.startsWith(`"${font.family}"`));- assert.match(font.stack, /Noto Sans SC|PingFang SC|Microsoft YaHei/);- }-});--test("buildFontOptions orders default, bundled, then system fonts", () => {+test("buildFontOptions orders the default before system fonts", () => {const options = buildFontOptions(["PingFang SC", "Arial"], undefined);assert.equal(options[0].value, "");assert.equal(options[0].group, "default");- const bundled = options.filter((option) => option.group === "bundled");- assert.equal(bundled.length, BUNDLED_FONTS.length);+ assert.deepEqual(+ options.map((option) => option.group),+ ["default", "system", "system"],+ );const system = options.filter((option) => option.group === "system");assert.deepEqual(system.map((option) => option.label), ["PingFang SC", "Arial"]);});+test("the app offers no bundled family", () => {+ const options = buildFontOptions(["Arial"], undefined);+ assert.ok(options.every((option) => option.group !== "bundled"));+});++test("every offered stack ends in the system CJK fallback tier", () => {+ const options = buildFontOptions(["Arial"], undefined);+ for (const option of options.slice(1)) {+ assert.ok(+ option.value.endsWith(CJK_FALLBACK),+ `${option.label} does not end in the CJK fallback tier`,+ );+ }+});+test("buildFontOptions keeps a stored selection that is no longer known", () => {const stored = `"Removed Font", "Noto Sans SC", sans-serif`;const options = buildFontOptions([], stored);@@ -44,17 +54,17 @@ test("buildFontOptions keeps a stored selection that is no longer known", () =>assert.equal(options[0].label, "Removed Font");});+test("buildFontOptions keeps a stack naming a formerly bundled family", () => {+ const stored = `"Geist", ${CJK_FALLBACK}`;+ const options = buildFontOptions(["PingFang SC"], stored);+ assert.equal(options[0].value, stored);+ assert.equal(options[0].group, "custom");+ assert.equal(options[0].label, "Geist");+});+test("buildFontOptions treats an empty stored stack as the system default", () => {const options = buildFontOptions(["PingFang SC"], "");assert.equal(options[0].value, "");assert.equal(options[0].group, "default");assert.ok(options.every((option) => option.group !== "custom"));});--test("buildFontOptions matches a bundled selection by its stack", () => {- const geist = BUNDLED_FONTS.find((font) => font.id === "geist");- const options = buildFontOptions([], geist.stack);- const match = options.find((option) => option.value === geist.stack);- assert.ok(match);- assert.equal(match.group, "bundled");-});diff --git a/apps/desktop/test/packaging-footprint.test.mjs b/apps/desktop/test/packaging-footprint.test.mjsindex 69e4871d2..9a9fe7caa 100644--- a/apps/desktop/test/packaging-footprint.test.mjs+++ b/apps/desktop/test/packaging-footprint.test.mjs@@ -95,7 +95,7 @@ test("legacy font fallback stripping only removes redundant fallback sources", ('src:url(a.woff2) format("woff2");',);- // The bundled faces use woff2-variations and must survive untouched.+ // A variable face declaring only woff2-variations must survive untouched.const variations = 'src: url("../f.woff2") format("woff2-variations");';assert.equal(strip(variations), variations);diff --git a/apps/desktop/test/settings-font-picker.test.mjs b/apps/desktop/test/settings-font-picker.test.mjsindex d8c6ad347..ed2724830 100644--- a/apps/desktop/test/settings-font-picker.test.mjs+++ b/apps/desktop/test/settings-font-picker.test.mjs@@ -82,3 +82,11 @@ test("menu repositioning ignores scrolls inside the font list", () => {/menuRef\.current\?\.contains\(target\)/,);});++test("the picker has no bundled group, license badge, or fontBundled copy", () => {+ assert.doesNotMatch(rowSource, /group === "bundled"/);+ assert.doesNotMatch(rowSource, /settings\.fontBundled/);+ assert.doesNotMatch(rowSource, /settings-font-item-license/);+ assert.doesNotMatch(rowSource, /option\.license/);+ assert.doesNotMatch(styles, /\.settings-font-item-license\s*\{/);+});diff --git a/docs/adr/0083-custom-global-ui-font.md b/docs/adr/0083-custom-global-ui-font.mdindex d3baa461b..7c0c37f0c 100644--- a/docs/adr/0083-custom-global-ui-font.md+++ b/docs/adr/0083-custom-global-ui-font.md@@ -1,6 +1,6 @@# ADR 0083: Custom global UI font-- Status: Accepted for implementation+- Status: Superseded in part by ADR 0298- Date: 2026-08-14- Baseline: `0.4.16`- Protocol: v9 (one additive Electron-main IPC channel; host RPC unchanged)@@ -34,10 +34,14 @@ layer (measured against the trigger and clamped to the viewport), so thesettings card's `overflow` cannot clip or squeeze it; it follows the body-levelfloating-layer contract in the component spec.-### 2. Bundled open-licensed families+### 2. Bundled open-licensed families (superseded by ADR 0298)-Four families ship with the app as `woff2`, all under the SIL Open Font-License 1.1 (free for commercial use and redistribution; license texts are+*(Historical. [ADR 0298](0298-remove-bundled-fonts.md) removed every bundled+family, so the picker offers System default plus installed system families and+nothing is loaded from disk.)*++Four families shipped with the app as `woff2`, all under the SIL Open Font+License 1.1 (free for commercial use and redistribution; license texts wereshipped under `apps/desktop/src/assets/fonts/licenses/`):| Family | Script coverage | Source |@@ -47,10 +51,11 @@ shipped under `apps/desktop/src/assets/fonts/licenses/`):| Noto Sans SC | CJK (variable) | google/fonts (Source Han Sans lineage) || LXGW WenKai | CJK kai (regular) | lxgw/LxgwWenKai |-Every stack appends a CJK fallback tier (`Noto Sans SC`, `PingFang SC`,-`Hiragino Sans GB`, `Microsoft YaHei`, `sans-serif`) so Chinese text stays-readable when the selected family has no CJK glyphs. The mono stack-(`--font-mono`) is unchanged.+Every stack appends a CJK fallback tier so Chinese text stays readable when the+selected family has no CJK glyphs. The tier was (`Noto Sans SC`, `PingFang SC`,+`Hiragino Sans GB`, `Microsoft YaHei`, `sans-serif`) and is now the system-only+(`PingFang SC`, `Hiragino Sans GB`, `Microsoft YaHei`, `sans-serif`) after ADR+0298. The mono stack (`--font-mono`) is unchanged.### 3. System font enumeration in Electron main@@ -73,20 +78,25 @@ through one new allowlisted IPC channel, `pi-desktop/app/systemFonts`.The renderer overrides `--font-sans` on `document.documentElement` from`AppSettings.fontFamily`; `body` and every `var(--font-sans)` consumer pick it-up without a reload. `@font-face` rules for the bundled families live in-`apps/desktop/src/styles/fonts.css`, imported before the token layer.+up without a reload. *(Superseded by [ADR 0298](0298-remove-bundled-fonts.md):+the `@font-face` rules, `apps/desktop/src/styles/fonts.css`, and its+`@import` in `globals.css` are deleted, so a stored stack resolves through+installed families.)*## Consequences- Users pick a global UI font once; it persists across restarts and renders- offline from the bundled files.+ offline from installed families ([ADR 0298](0298-remove-bundled-fonts.md) ships+ no font files).- CJK coverage stays correct for every option via the appended fallback tier.- macOS enumeration resolves through the fast CoreText path in tens ofmilliseconds (the previous `system_profiler` path took 2–5 s and is now onlya fallback); the result is cached 60 s per process and returns canonicalfamily names such as `PingFang SC` rather than system_profiler's localizedaliases such as `苹方-简`.-- The installer grows by roughly 16 MB from the bundled font files.+- The installer carried roughly 16 MB of bundled font files; ADR 0298 removed+ them, so `out/renderer` emits no application font face and only KaTeX's+ `woff2` glyphs remain (see `06-delivery/06-release-runbook.md`).- `@font-face` `font-weight` descriptors are exempted from the style-tokenguard because they describe font files, not UI typography.diff --git a/docs/adr/0125-renderer-derived-brand-marks-and-minified-output.md b/docs/adr/0125-renderer-derived-brand-marks-and-minified-output.mdindex ac8f9b0d4..c77b72dd0 100644--- a/docs/adr/0125-renderer-derived-brand-marks-and-minified-output.md+++ b/docs/adr/0125-renderer-derived-brand-marks-and-minified-output.md@@ -45,15 +45,20 @@ about 277 MB, so the renderer is the only part worth tuning.device pixel ratio. Regenerate them from the masters with `sips -Z 192`whenever the canonical marks change; the visual identity is unchanged.-The two bundled CJK faces stay unsubset. ADR 0083 section 2 appends-`Noto Sans SC` to every font stack so Chinese text stays readable offline, and-subsetting would drop glyphs from user-supplied content. Reducing those 15 MiB-requires revising ADR 0083, not a build-config change.+*(Superseded by [ADR 0298](0298-remove-bundled-fonts.md): the app ships no+fonts, so there is nothing to subset.)* The two bundled CJK faces stayed+unsubset while they existed. ADR 0083 section 2 appended `Noto Sans SC` to+every font stack so Chinese text stayed readable offline, and subsetting would+have dropped glyphs from user-supplied content; reducing those 15 MiB required+revising ADR 0083, not a build-config change. ADR 0298 removed the faces+instead, and `out/renderer` now keeps only KaTeX's `woff2` glyphs.## Consequences- `out/renderer` drops from 31 MiB to 24 MiB: JavaScript 12.53 to 7.72 MiB,legacy font fallbacks 0.78 MiB to 0, PNG brand assets 1.23 to 0.06 MiB.+ Measured before [ADR 0298](0298-remove-bundled-fonts.md); the bundled+ `woff2` payload is no longer part of the renderer.- Minified renderer stack traces need the devtools source view; no sourcemapsare emitted, which matches the previous release behavior.- The brand marks now exist in two places. `packaging-footprint.test.mjs`diff --git a/docs/adr/0298-remove-bundled-fonts.md b/docs/adr/0298-remove-bundled-fonts.mdnew file mode 100644index 000000000..f946e438a--- /dev/null+++ b/docs/adr/0298-remove-bundled-fonts.md@@ -0,0 +1,126 @@+# ADR 0298: The app ships no fonts++- Status: Accepted+- Date: 2026-09-20+- Deciders: PI-Desktop UX and desktop maintainers+- Baseline: `0.15.1-beta.7` (frozen baseline `0.4.18`)+- Protocol: v11 (unchanged; the `pi-desktop/app/systemFonts` channel is untouched)+- Storage schema: v19 (unchanged; `AppSettings.fontFamily` keeps its shape and semantics)+- Amends: [ADR 0083](0083-custom-global-ui-font.md) — its §2 bundled families, its+ `@font-face`/offline-rendering clauses, and its installer-size consequence — and D232+- Related: D598, E2E-126, E2E-092,+ [04-ux/06-settings-ia.md](../spec/04-ux/06-settings-ia.md) ·+ [04-ux/07-ui-design-system.md](../spec/04-ux/07-ui-design-system.md) ·+ [06-delivery/06-release-runbook.md](../spec/06-delivery/06-release-runbook.md)++## Context++ADR 0083 shipped the global UI font picker together with four bundled `woff2`+families — Geist, Inter, Noto Sans SC, and LXGW WenKai — all under the SIL Open+Font License 1.1, with their license texts under+`apps/desktop/src/assets/fonts/licenses/` and a `@font-face` layer in+`apps/desktop/src/styles/fonts.css` imported before the token layer. Every+custom stack was prefixed with `Noto Sans SC` so Chinese text stayed readable+offline, and the picker gained a **Bundled** group whose rows carried the+license badge.++Those files are the bulk of the renderer's remaining weight: ADR 0125 measured+`woff2` at 15.71 MiB in `out/renderer`, 7.6 MiB of it `lxgw-wenkai.woff2` and+7.4 MiB `noto-sans-sc.woff2`+([06-delivery/06-release-runbook.md](../spec/06-delivery/06-release-runbook.md)).+Every platform the desktop targets already resolves the same coverage from its+own fonts — PingFang SC on macOS, Microsoft YaHei on Windows, and fontconfig+CJK families on Linux — so the app paid for a duplicate copy in every installer+and carried the OFL notice obligations that come with redistributing font+files, while offering only four faces next to the hundreds the OS already+installs. The product wants the picker, not the payload.++## Decision++1. **Nothing is bundled.** `apps/desktop/src/assets/fonts/` (the four `woff2`+ files and their `licenses/` texts), `apps/desktop/src/styles/fonts.css`, and+ the `@import "./fonts.css";` line in+ `apps/desktop/src/styles/globals.css` are deleted. `BUNDLED_FONTS`, the+ `BundledFont` type, the `license` field on `FontOption`, the+ `settings-font-item-license` badge, and the `settings.fontBundled` key in+ all eight shipped locale catalogs are deleted with them.++2. **The picker keeps two kinds of option.** `buildFontOptions` returns+ **System default** — persisted as the empty string `""`, which every consumer+ treats as the built-in `--font-sans` token stack — followed by installed+ system families. Enumeration is exactly ADR 0083 §3 and is unchanged:+ Electron main uses platform tooling only (`osascript` JXA CoreText on macOS+ with `system_profiler` as a fallback, PowerShell on Windows, `fc-list` on+ Linux), deduplicated, filtered, sorted, cached 60 s, and reached through the+ additive allowlisted channel `pi-desktop/app/systemFonts`. A stored stack+ that matches no option is still re-added first under the existing **Saved**+ (`custom`) group.++3. **The CJK fallback tier is system-only.** Every stack generated by the+ picker appends+ `"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif`. No+ bundled family precedes it, so Chinese text resolves to fonts the operating+ system provides and no selection can depend on a file the app no longer+ ships.++4. **Stored stacks are preserved, not migrated.** A `AppSettings.fontFamily`+ written while a bundled option existed (for example+ `"Geist", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif`)+ stays byte for byte. It matches no known option any more, so the picker shows+ the stored value first under **Saved**, and at render time the first family is+ simply unknown to the platform and the cascade falls through to the system+ fallback tier. No storage migration runs, no stored value changes shape, and+ `settings.set` semantics, the protocol version, and the schema version are+ untouched.++## Consequences++- `out/renderer` no longer emits an application font face; the only `woff2` files+ left are KaTeX's math glyphs. Measured from a clean+ `pnpm install --frozen-lockfile`, the `woff2` group fell from 23 files /+ 15.71 MiB to 19 files / 0.24 MiB and the `out/renderer` total from 25.36 MiB+ to 9.89 MiB — a 15.47 MiB drop that is the four deleted faces+ ([06-delivery/06-release-runbook.md](../spec/06-delivery/06-release-runbook.md)).+- A face the app used to supply now comes from the operating system. A user who+ wants Geist, Inter, or LXGW WenKai installs it on the OS, after which the+ picker lists it like any other installed family; LXGW WenKai ships on no+ platform by default, so that face is no longer available out of the box.+- Chinese text still renders on every supported platform through the fallback+ tier, and no part of it reads a file the app ships.+- The app no longer redistributes OFL-licensed font files, so the four shipped+ license texts and their notice obligations leave the bundle with the faces.+- The picker's option list becomes "System default plus whatever this machine+ has", which is the same list every other System-style picker in the app shows;+ the license badge and the **Bundled** group heading go away.+- E2E-126 describes the two-group picker and the saved-stack fallback, and+ E2E-092's packaging checks expect no application `woff2` beyond KaTeX.++## Alternatives considered++### Keep the bundled families and subset them++Rejected: subsetting would drop glyphs from user-supplied content, which is why+ADR 0125 kept the CJK faces unsubset in the first place, and it leaves the+`@font-face` layer, the license tree, and the build wiring in place for a+saving the platform fonts already provide.++### Keep the bundled families behind a build flag or setting++Rejected: the files would still be built and shipped, so the installer cost and+the notice obligations stay, and the app would gain a second font configuration+surface for a four-item list.++### Keep `Noto Sans SC` at the head of the CJK fallback tier++Rejected: the tier must not name a family the app pretends to provide. It would+only take effect on machines where the user installed Noto Sans SC separately,+and it would silently change which face a Chinese glyph resolves to on exactly+those machines.++### Migrate stored bundled stacks to a system equivalent++Rejected: there is no honest mapping from a removed face to a system face, and+rewriting the value would change the user's rendering without their action.+Keeping the stored stack lets the picker show what was chosen under **Saved**+and lets the cascade resolve it, and the user can pick a replacement at any+time.diff --git a/docs/adr/README.md b/docs/adr/README.mdindex 9e55b770e..c913f8f2a 100644--- a/docs/adr/README.md+++ b/docs/adr/README.md@@ -104,7 +104,7 @@ Each ADR includes:| 0080 | Prewarm the global plugin launcher after boot | Accepted || 0081 | Host-owned cross-platform plugin panel chrome | Accepted || 0082 | Localized and page-adaptive plugin panel chrome | Accepted |-| 0083 | Custom global UI font | Accepted |+| 0083 | Custom global UI font | Superseded in part by 0298 || 0084 | Defer new-task session creation until the first message | Accepted || 0085 | Make the work panel shortcut a toggle | Accepted (amends 0068) || 0086 | Keep macOS on the regular activation policy | Accepted |@@ -325,5 +325,6 @@ Each ADR includes:| 0295 | [Session thinking-parameter omission](0295-session-thinking-parameter-omission.md) | Accepted (D456; amends ADR 0194 / ADR 0144 / ADR 0221) || 0296 | [Signed macOS DMG is a two-icon install](0296-macos-signed-dmg-two-icon-install.md) | Accepted (D457; amends ADR 0232 / ADR 0204) || 0297 | [Provider-hosted web search as an adapter capability](0297-provider-hosted-web-search-adapter-capability.md) | Accepted |+| 0298 | [The app ships no fonts](0298-remove-bundled-fonts.md) | Accepted (D598; amends ADR 0083 / D232) || turn-process-and-thinking-display | [Turn process and thinking presentation](turn-process-and-thinking-display.md) | Accepted || provider-display-order | [Provider display order](provider-display-order.md) | Accepted |diff --git a/docs/spec/00-baseline.md b/docs/spec/00-baseline.mdindex f9a4595a9..f720905a8 100644--- a/docs/spec/00-baseline.md+++ b/docs/spec/00-baseline.md@@ -73,10 +73,12 @@> Settings Appearance card gains a searchable Font picker; the selection> persists as `AppSettings.fontFamily` and overrides `--font-sans`. Four> open-licensed (SIL OFL 1.1) families — Geist, Inter, Noto Sans SC, and-> LXGW WenKai — ship locally with license texts, and installed system+> LXGW WenKai — shipped locally with license texts, and installed system> families are enumerated by Electron main through the additive allowlisted-> channel `pi-desktop/app/systemFonts`. No host protocol or storage schema-> changes.+> channel `pi-desktop/app/systemFonts`. D598 / ADR 0298 later removed the+> bundled families: the app ships no font, the picker offers System default+> plus installed system families, and every stack ends in the system-only CJK+> fallback tier. No host protocol or storage schema changes.> `0.4.17` replaces the renderer-owned multi-folder tab projection with> ChatGPT-style host-owned logical project groups through ADR 0249. A group> owns its name, ordered local roots, shared instructions, shared memory, anddiff --git a/docs/spec/04-ux/06-settings-ia.md b/docs/spec/04-ux/06-settings-ia.mdindex 76d2209e4..aee6d0afc 100644--- a/docs/spec/04-ux/06-settings-ia.md+++ b/docs/spec/04-ux/06-settings-ia.md@@ -97,11 +97,14 @@ Settings is a **full-window page** that replaces the app sidebar + main chrome (Adding a locale is a catalog plus a registry row; the picker does nothard-code the option list.- **Font**: a searchable picker row (trigger shows the current family rendered- in that face) offering the System default, bundled open-licensed families- (Geist, Inter, Noto Sans SC, LXGW WenKai — SIL OFL 1.1, shipped locally),- and installed system families enumerated by Electron main; selection+ in that face) offering the System default and installed system families+ enumerated by Electron main; the app ships no fonts of its own (ADR 0298),+ so there is no bundled group and no license badge, and a stack saved while+ a removed family existed still appears under Saved; selectionpersists as `AppSettings.fontFamily` and applies to the global UI stack(`--font-sans`) without a reload; System default clears the override;+ every stack ends in the system-only CJK fallback tier (`PingFang SC`,+ `Hiragino Sans GB`, `Microsoft YaHei`, `sans-serif`);long system lists are windowed so only the visible slice is in the DOM(bounded font loading) and opening the picker never blocks input- **Font size**: Starbucks-style cup presets (Tall / Grande / Venti /diff --git a/docs/spec/04-ux/07-ui-design-system.md b/docs/spec/04-ux/07-ui-design-system.mdindex fed2ab379..e127c33e2 100644--- a/docs/spec/04-ux/07-ui-design-system.md+++ b/docs/spec/04-ux/07-ui-design-system.md@@ -346,12 +346,13 @@ Implementation note: Tailwind v4 supports CSS-first configuration. The `@theme`The UI stack is user-overridable from Settings → Basics → Appearance(ADR 0083). The Font row persists a CSS stack in `AppSettings.fontFamily`;-an absent or empty value keeps the token stack above. Bundled open-licensed-families (Geist, Inter, Noto Sans SC, LXGW WenKai — SIL OFL 1.1) ship locally-under `apps/desktop/src/assets/fonts/` with license texts, and installed-system families are enumerated by Electron main. Every custom stack appends a-CJK fallback tier so Chinese text stays readable. The mono stack-(`--font-mono`) is not user-configurable.+an absent or empty value keeps the token stack above. The app ships no font+files (ADR 0298): the picker offers the System default and the installed+system families enumerated by Electron main, and a stack saved while a+removed family existed still appears under Saved. Every generated stack ends+in the system-only CJK fallback tier (`PingFang SC`, `Hiragino Sans GB`,+`Microsoft YaHei`, `sans-serif`) so Chinese text stays readable. The mono+stack (`--font-mono`) is not user-configurable.The Font size row (D343 / ADR 0180) persists an optional multiplier in`AppSettings.fontScale` (default 1, range 0.8–1.5). The renderer setsdiff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex 460d3386e..781e2c1fe 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -5225,7 +5225,8 @@ identify the platform validation still needed.DMG and ZIP artifacts and one merged `latest-mac.yml` feed whose URLs andchecksums match those generated assets.4. Inspect the renderer output for its size controls: emitted JS is minified,- no `.woff` or `.ttf` files are present, the KaTeX `woff2` faces remain, and+ no `.woff` or `.ttf` files are present, only the KaTeX `woff2` faces remain+ (no application font face is emitted any more), andthe brand marks are the renderer-sized `assets/brand/logo-*.png` ratherthan the 1024px installer icons.5. Configure the loopback fixture provider, disable external egress, and@@ -5236,8 +5237,8 @@ identify the platform validation still needed.host and agent-sidecar health.6. Confirm typography and branding survive the stripped font fallbacks: KaTeXmath renders with its own faces, Chinese text in both the UI chrome and- assistant output stays readable under each bundled font selection, and the- sidebar plus startup-splash logos render crisply on a HiDPI display.+ assistant output stays readable through the system CJK fallback tier, and+ the sidebar plus startup-splash logos render crisply on a HiDPI display.- **Expected**: Each macOS package contains exactly one bundled agent sidecar,one Rust host matching its declared architecture, and only configuredChromium locale packs. The release output contains both native macOS@@ -5251,9 +5252,10 @@ identify the platform validation still needed.a second agent-runtime tree, and reliably excludable non-target native assetsare absent. Curated Shiki grammars highlight locally while an unknown fencestays readable as plain text. The renderer ships minified chunks, carries no- legacy `woff`/`truetype` payload, keeps every KaTeX `woff2` face, and imports- only renderer-sized brand marks; math, Chinese text under each bundled font,- and the chrome logos all render correctly. The offline shell starts and all+ legacy `woff`/`truetype` payload, emits no application font face (only the+ KaTeX `woff2` faces remain), and imports only renderer-sized brand marks;+ math, Chinese text under the CJK fallback tier, and the chrome logos all+ render correctly. The offline shell starts and allfixture capabilities use local packaged assets; provider/update networkfailures do not block startup.- **Specs linked**: `02-architecture/01-architecture.md`,@@ -8837,44 +8839,50 @@ This test plan spec is accepted when:#### E2E-126: Appearance card selects a global UI font- **Preconditions**: App running on macOS with an installed system font- distinct from the bundled families (for example PingFang SC); a clean+ distinct from the built-in token stack (for example PingFang SC); a clean`~/.pi-desktop` profile.- **Steps**:1) Open Settings → Basics and confirm the Appearance card shows a Font rowbelow Theme and Language with a trigger labeled "System default".- 2) Open the Font picker and confirm it lists System default, the bundled- open-licensed families (Geist, Inter, Noto Sans SC, LXGW WenKai) marked- with their license, and installed system families; confirm the search- input filters families and the current selection shows a check badge;- confirm the menu opens as a floating layer above the card (not clipped or- squeezed inside it) and stays readable when the card is near the bottom- edge of the window; with many installed families, confirm the list opens- without an input stall and scrolls immediately (only the visible rows- are rendered, with an overscan buffer).- 3) Select Geist and confirm the trigger label and the whole UI re-render in- Geist without a reload, including CJK fallback rendering for Chinese text.- 4) Select an installed system family and confirm the UI switches to it; the- family stays selected after reopening the picker.- 5) Restart the app, reopen Settings, and confirm the selected font is still- applied (persisted `AppSettings.fontFamily`).- 6) Select System default and confirm the UI returns to the built-in token- stack immediately; restart, reopen Settings, and confirm the default is- still applied (the override is cleared, persisting an empty+ 2) Open the Font picker and confirm it lists System default followed by+ installed system families only — no bundled open-licensed families and no+ license badge on any row; confirm the search input filters families and the+ current selection shows a check badge; confirm the menu opens as a floating+ layer above the card (not clipped or squeezed inside it) and stays readable+ when the card is near the bottom edge of the window; with many installed+ families, confirm the list opens without an input stall and scrolls+ immediately (only the visible rows are rendered, with an overscan buffer).+ 3) Select an installed system family (for example PingFang SC) and confirm the+ trigger label and the whole UI re-render in that family without a reload,+ including CJK fallback rendering for Chinese text.+ 4) Reopen the picker and confirm the family is still selected, then select+ System default and confirm the UI returns to the built-in token stack+ immediately.+ 5) Restart the app and reopen Settings and confirm the default is still+ applied (the override is cleared, persisting an empty`AppSettings.fontFamily`).+ 6) With a profile whose stored stack names a formerly bundled family (for+ example `"Geist", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",+ sans-serif`), confirm the Font row shows that family under the Saved group,+ that no font file is loaded from the app, and that the UI renders through+ the system CJK fallback tier.- **Expected**: The Font row is a searchable picker whose trigger previews the- current family in that face; options are System default, bundled OFL families,- and installed system families enumerated by Electron main via+ current family in that face; options are System default and the installed+ system families enumerated by Electron main via`pi-desktop/app/systemFonts` (cached 60 s, hidden `.`-prefixed families- excluded); selection persists as a CSS stack in `AppSettings.fontFamily` and- overrides `--font-sans` live; Chinese text stays readable through the CJK- fallback tier; the menu is a body-level floating layer that is never clipped- by the settings card; the option list is windowed with fixed row heights- and an overscan buffer so only the visible slice is in the DOM, keeping+ excluded); the app ships no font files, so no bundled group and no license+ badge appear, and a stored stack that matches no option stays listed first+ under Saved; selection persists as a CSS stack in `AppSettings.fontFamily` and+ overrides `--font-sans` live; Chinese text stays readable through the+ system-only CJK fallback tier; the menu is a body-level floating layer that is+ never clipped by the settings card; the option list is windowed with fixed row+ heights and an overscan buffer so only the visible slice is in the DOM, keepingopening, scrolling, and typing responsive regardless of how many familiesare installed; System default clears the override by persisting an emptystack.+- **Specs linked**: `04-ux/06-settings-ia.md`, `04-ux/07-ui-design-system.md`,- `03-runtime/01-ipc-protocol.md`, ADR 0083+ `03-runtime/01-ipc-protocol.md`, ADR 0083, ADR 0298- **Acceptance**: A (core shell), H (localization)- **Milestone**: M5+- **Status**: Documenteddiff --git a/docs/spec/06-delivery/06-release-runbook.md b/docs/spec/06-delivery/06-release-runbook.mdindex 8303cb22a..9d3cf8373 100644--- a/docs/spec/06-delivery/06-release-runbook.md+++ b/docs/spec/06-delivery/06-release-runbook.md@@ -511,11 +511,32 @@ against the same tree at `v0.10.8`:| CSS | 0.42 MiB | 0.35 MiB || **Total `out/renderer`** | **31 MiB** | **24 MiB** |-The two bundled CJK faces (`lxgw-wenkai.woff2` 7.6 MiB, `noto-sans-sc.woff2`-7.4 MiB) dominate the remainder. They stay unsubset on purpose: ADR 0083 §2-appends `Noto Sans SC` to every font stack so Chinese text stays readable-offline, and subsetting would drop glyphs from user-supplied content. Reducing-them requires an ADR revision, not a build-config change.+The renderer no longer emits any application font face. D598 / ADR 0298 removed+the four bundled families (Geist, Inter, Noto Sans SC, LXGW WenKai), so the only+`woff2` files left in `out/renderer` are KaTeX's math glyphs. Measured on this+machine from a clean `pnpm install --frozen-lockfile`, with and without the+removal:++| Renderer group | Bundled fonts | After D598 |+|---|---:|---:|+| JavaScript (121 chunks) | 9.04 MiB | 9.04 MiB |+| `woff2` (23 → 19 files) | 15.71 MiB | 0.24 MiB |+| CSS (1 file) | 0.48 MiB | 0.48 MiB |+| PNG brand assets (4 files) | 0.08 MiB | 0.08 MiB |+| GIF (2 files) | 0.05 MiB | 0.05 MiB |+| **Total `out/renderer`** (152 → 148 files) | **25.36 MiB** | **9.89 MiB** |++The entire difference is the four deleted faces, at the sizes the build reports:+`lxgw-wenkai.woff2` 8,016.75 kB, `noto-sans-sc.woff2` 7,782.07 kB,+`inter.woff2` 352.24 kB, and `geist.woff2` 69.65 kB — 16,220.71 kB, which is the+whole 15.47 MiB drop in the total. Chinese text now renders from the system tier+(`PingFang SC`, `Hiragino Sans GB`, `Microsoft YaHei`), so no glyph coverage is+lost to subsetting: no face ships.+The other two controls are unchanged: minification stays explicit, and the+legacy `woff`/`truetype` strip stays because KaTeX still declares those sources.++The three-controls table above is the `v0.10.8` record and predates the removal,+so its `woff2` row is no longer current.Manual smoke on a clean profile (`PI_DESKTOP_DATA_DIR=$(mktemp -d)`):diff --git a/docs/spec/08-meta/decisions-log.md b/docs/spec/08-meta/decisions-log.mdindex ee4023b35..eaf7b1ea3 100644--- a/docs/spec/08-meta/decisions-log.md+++ b/docs/spec/08-meta/decisions-log.md@@ -379,7 +379,8 @@ Gold source: local Codex electron captures; latest row wins where rows conflict.| D234 | Plugin-owned panel surface with a host window-control capsule | **Plugin panels use frameless windows on macOS, Windows, and Linux. The sandboxed preload reserves a transparent 46px safe area and renders only one fixed top-right capsule with exactly three buttons — minimize, maximize/restore, and close — in a closed Shadow DOM. It no longer renders a panel title or development reminder. The plugin owns its title, toolbar, background, and all other visible UI; normal-flow content is offset automatically, fixed/sticky UI uses `--pi-plugin-titlebar-height: 46px`, and plugin-owned drag regions use `-webkit-app-region: drag` with interactive controls opting out. The private sender-validated control channel, localized labels, page-adaptive colors, `window.pluginBridge`, per-plugin partition, host protocol v9, and storage schema remain unchanged. This amends D218 / ADR 0081 and D232 / ADR 0082.** | The host titlebar consumed the plugin's visual hierarchy and still made macOS different from Windows/Linux. A compact host capsule preserves safe native window actions while leaving the panel surface to the plugin. || D235 | Strict 46px plugin drag band with a minimal capsule | **Plugin panels reserve exactly 46px for a transparent host drag band on every platform. Normal-flow content is offset by that value, the band blocks plugin clicks outside the capsule, and development panels show a localized reminder that the top 46px is drag-only. The host renders no panel title. The fixed top-right capsule stays inside the band, contains exactly minimize, maximize/restore, and close, and uses a subtle page-adaptive surface without heavy shadow or blur. This amends D234 / ADR 0092; the private sender-validated control channel, closed Shadow DOM, `window.pluginBridge`, protocol v9, and storage schema remain unchanged.** | Frameless panels need a reliable drag target and a clear authoring constraint, but the host band must not grow or compete with the plugin's visual hierarchy. || D343 | Custom global UI type scale | **Settings → General → Appearance gains a Font size row under Font. Starbucks-style cup presets (Tall / Grande / Venti / Trenta) plus a percentage slider persist as optional `AppSettings.fontScale` (`1` = product ramp, absent = 1, range 0.8–1.5 in 0.025 steps). The renderer sets `--font-scale` on the root; every `--text-*` token and `--leading-row` is `calc(<product px> * var(--font-scale))`, and shared Lucide wrappers size glyphs with the same multiplier, so body, chrome, headings, code, and icons stay in proportion without a reload. The UI never asks for a px value. Window Zoom In/Out/Reset stays independent. An unreleased leftover `fontSize` px field migrates as `px / 14` when `fontScale` is absent. No host protocol or storage schema version bump.** | The `--text-*` ramp is a frozen set of relative sizes; a single multiplier scales every step at once. Window zoom still scales layout. A reading-only px field would leave two type sizes in one window and force the user to pick a number that only matches `--text-base` (ADR 0180). |-| D232 | Custom global UI font | **Settings → Basics → Appearance gains a searchable Font picker (trigger previews the current family). Selections persist as `AppSettings.fontFamily`, a CSS stack; absent means the built-in `--font-sans` token stack, and the renderer applies the stack by overriding `--font-sans` on the root element without a reload. Four bundled families — Geist, Inter, Noto Sans SC, LXGW WenKai — ship locally as woff2 under the SIL OFL 1.1 with license texts; every custom stack appends a CJK fallback tier and the mono stack is unchanged. Installed system families are enumerated by Electron main using platform tooling only (macOS: `osascript` JXA bridging the CoreText query `CTFontManagerCopyAvailableFontFamilyNames` — the same API dbx's `font_kit::all_families()` calls — with `system_profiler` as a slow fallback; Windows: PowerShell; Linux: `fc-list`), deduplicated/sorted/filtered and cached 60 s, exposed through the additive allowlisted channel `pi-desktop/app/systemFonts`; host protocol v9 and storage schema v10 are unchanged.** | Users want a Codex/dbx-style global font preference, but the sandboxed renderer cannot enumerate OS fonts and the host RPC should stay unchanged for a renderer-only preference. Bundling OFL-licensed families keeps every offered font commercially safe and offline, while the fast CoreText path returns the canonical CSS family names (e.g. PingFang SC) in tens of milliseconds and the 60 s cache bounds repeated enumeration (ADR 0083). |+| D232 | Custom global UI font | *(amended by D598)* **Settings → Basics → Appearance gains a searchable Font picker (trigger previews the current family). Selections persist as `AppSettings.fontFamily`, a CSS stack; absent means the built-in `--font-sans` token stack, and the renderer applies the stack by overriding `--font-sans` on the root element without a reload. Four bundled families — Geist, Inter, Noto Sans SC, LXGW WenKai — ship locally as woff2 under the SIL OFL 1.1 with license texts; every custom stack appends a CJK fallback tier and the mono stack is unchanged. Installed system families are enumerated by Electron main using platform tooling only (macOS: `osascript` JXA bridging the CoreText query `CTFontManagerCopyAvailableFontFamilyNames` — the same API dbx's `font_kit::all_families()` calls — with `system_profiler` as a slow fallback; Windows: PowerShell; Linux: `fc-list`), deduplicated/sorted/filtered and cached 60 s, exposed through the additive allowlisted channel `pi-desktop/app/systemFonts`; host protocol v9 and storage schema v10 are unchanged.** | Users want a Codex/dbx-style global font preference, but the sandboxed renderer cannot enumerate OS fonts and the host RPC should stay unchanged for a renderer-only preference. Bundling OFL-licensed families keeps every offered font commercially safe and offline, while the fast CoreText path returns the canonical CSS family names (e.g. PingFang SC) in tens of milliseconds and the 60 s cache bounds repeated enumeration (ADR 0083). |+| D598 | The app ships no fonts | **Amend D232 / ADR 0083: every bundled family is removed. `apps/desktop/src/assets/fonts/` (the four `woff2` files and their OFL license texts), `apps/desktop/src/styles/fonts.css`, and the `@import "./fonts.css";` line in `styles/globals.css` are deleted, and `BUNDLED_FONTS`, the `BundledFont` type, `FontOption.license`, the picker's license badge, and `settings.fontBundled` in all eight locale catalogs go with them. The picker keeps System default (persisted as the empty string) followed by installed system families, enumerated exactly as before through the allowlisted `pi-desktop/app/systemFonts` channel, and a stored stack that matches no option still appears first under Saved (`custom`). Every generated stack now appends the system-only CJK tier `"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif` with no bundled family in front of it. A previously stored bundled stack (e.g. `"Geist", "PingFang SC", …`) is preserved byte for byte, shows under Saved, and renders through that tier. No protocol version, schema version, or storage migration change.** | Four OFL faces duplicated coverage every target OS already provides, cost about 15.7 MiB of `woff2` in `out/renderer` (7.6 MiB LXGW WenKai plus 7.4 MiB Noto Sans SC), and carried font-file notice obligations for four options beside the list the OS already installs. See ADR 0298, E2E-126, and E2E-092. || D230 | User-configurable close behavior with close-to-tray | **Windows/Linux close behavior is a persisted preference stored by Electron main in `<data>/close-behavior.json`. `ask` is the transient unset state: the first close shows a native modal (Cancel / Close to tray / Quit); picking one persists it forever, Cancel keeps the window open and unset. Only `tray` and `quit` are ever settable — Settings -> General renders a two-option radio segment (Close to tray / Quit app) for Windows/Linux only, and `pi-desktop/window/closeBehavior/set` rejects `ask`, so a choice can be switched but never reverted to prompting. `tray` hides the window under the resident D216 tray icon (click restores, menu shows or quits); switching to `quit` leaves that icon in place, because minimize-to-tray still needs it. Close interception runs for every non-macOS close that is not already an approved quit; `quitting` and macOS closes fall through, a `quit` close calls `app.quit()` itself, and `window-all-closed` stays silent only under `tray`, so the boot probe and explicit quits are unaffected and a resident tray never keeps a `quit` session alive. `closeBehavior/set` also fails with `INVALID_ARGUMENT` on macOS. The bounds watchdog skips minimized and hidden windows so a tray-hidden window is never force-restored. macOS keeps the native Dock lifecycle (D216, ADR 0078, ADR 0090).** | Minimizing already hides the window into the D216 tray; the gap was close: it quit outright on Windows/Linux. A fixed close-to-tray would surprise users who expect exit, so the choice is asked once, remembered, and revisitable in Settings — matching how Codex-style shells keep long-running sessions alive without taking over the close button. || D363 | Explicit quit confirms before shutdown | **Amend D230 / D216: Cmd+Q, the application-menu Quit item, and the tray Quit item show one native warning (Cancel / Quit). Cancel leaves the app running and allows a later quit to prompt again. Confirm runs the ordered `before-quit` shutdown. A window-close path that already chose Quit in the D230 dialog sets `quitConfirmed` and does not ask again. Boot, supervision, and capture probes skip the dialog, and so does the quit an in-app update performs: `autoUpdater.quitAndInstall()` spawns the platform installer before `app.quit()`, and that installer aborts once the app outlives its wait window, so the update restart must reach the ordered shutdown without a prompt. No IPC, storage, or host-protocol change. See E2E-204.** | An explicit quit tears down host-core, the sidecar, and in-flight work; a one-step confirm prevents an accidental Cmd+Q or tray Quit from doing that, without re-prompting a user who already chose Quit on the close-behavior dialog. || D252 | Windows taskbar preserves native minimize/restore | *(Explicit renderer/menu minimize clauses superseded by D256 / ADR 0123)* **Amend D216 / ADR 0078: when the focused Windows main window is toggled from its taskbar button, Electron lets the native `minimize` transition complete instead of hiding the window. The taskbar entry remains available and the next taskbar click restores/focuses it. Explicit renderer/menu minimize actions still hide to the resident tray; macOS/Linux native minimize remains tray-resident. No IPC, storage, host protocol, or background-work changes.** | D216's unconditional `window.hide()` handled the taskbar-originated Windows `minimize` event as a tray hide, unexpectedly removing the taskbar entry and leaving the user with only the tray restore path. |@@ -440,7 +441,7 @@ section mirrors only marketplace/catalog items still blocking nothing.| D215 | Windows-reserved global shortcut fallback | **On Windows, host-core installs a narrow `WH_KEYBOARD_LL` hook for the effective `Alt+Space` default binding because the shell may reserve it from Electron's `globalShortcut`. The hook consumes only the matching chord and emits `keyboard.shortcut({ binding: "Alt+Space" })`; Electron toggles the existing plugin launcher. Electron calls additive `keyboard.setGlobalShortcut({ binding })` whenever settings change, and host-core enables the hook only for that exact binding. Other platforms and custom bindings remain on Electron's global shortcut path.** | Windows' active-window system menu reservation made the shipped global launcher unavailable whenever PI-Desktop was unfocused. A narrowly scoped host fallback preserves the shortcut without reading text or expanding plugin/renderer privileges (ADR 0076). || D217 | Early plugin launcher warm-up | **As soon as Electron is ready, before backend/plugin boot completes, Electron starts creating and loading the retained plugin launcher while it remains hidden. Window creation uses one shared in-flight promise, so a shortcut received during warm-up joins the same renderer load; failures destroy the incomplete window, clear the promise, and remain retryable on the next invocation. Each show still refreshes the live plugin catalog. On macOS, showing the panel relies on its normal activation and skips a redundant application activation/window-stack move.** | Overlapping launcher renderer startup with backend boot and avoiding duplicate macOS activation work removes first-invocation delay and visible stutter without weakening plugin freshness, IPC, or sandbox boundaries (ADR 0080). || D219 | Plugin launcher most-recently-used history | **The launcher renderer records each successfully opened plugin id with a timestamp in renderer-local `localStorage` (key `pi.desktop.pluginLaunchHistory`, capped at 24) and presents an empty query in most-recently-used order. A typed query ranks search relevance first and uses recency only as a tiebreaker, so unused plugins sort after the recent ones by name. Corrupted or unavailable storage degrades to the existing name order without breaking launching. This refines D211's presentation without changing IPC, host RPC, permissions, protocol v9, or storage schema v11.** | Keyboard-first launcher users reopen the same plugins repeatedly; remembering the last-used order keeps the most frequent target one Enter away while relevance stays authoritative once the user types. |-| D221 | Renderer output size controls | **The renderer build sets `minify: "esbuild"` explicitly because `electron-vite` hard-defaults its renderer preset to `minify: false`. A `pi-drop-legacy-font-fallbacks` plugin strips comma-prefixed `woff`/`truetype` `src` entries with `enforce: "pre"`, before Vite registers them as assets, since the bundled Chromium always supports `woff2`; a face whose only source is a legacy format keeps it. `BrandLogo` imports 192x192 marks derived from the canonical masters at `src/assets/brand/logo-{light,dark}.png` rather than the 1024px installer icons in `build/`, refining D079/D094 without changing the visual identity. `packaging-footprint.test.mjs` asserts all three so a framework default or a reverted import cannot silently regress them. The two bundled CJK faces stay unsubset per ADR 0083 section 2.** | `out/renderer` fell from 31 MiB to 24 MiB with no feature loss; the unminified default and the installer-icon import were accidental costs, while CJK subsetting would drop glyphs from user content and needs an ADR revision |+| D221 | Renderer output size controls | *(bundled CJK clause superseded by D598)* **The renderer build sets `minify: "esbuild"` explicitly because `electron-vite` hard-defaults its renderer preset to `minify: false`. A `pi-drop-legacy-font-fallbacks` plugin strips comma-prefixed `woff`/`truetype` `src` entries with `enforce: "pre"`, before Vite registers them as assets, since the bundled Chromium always supports `woff2`; a face whose only source is a legacy format keeps it. `BrandLogo` imports 192x192 marks derived from the canonical masters at `src/assets/brand/logo-{light,dark}.png` rather than the 1024px installer icons in `build/`, refining D079/D094 without changing the visual identity. `packaging-footprint.test.mjs` asserts all three so a framework default or a reverted import cannot silently regress them. The two bundled CJK faces stay unsubset per ADR 0083 section 2.** | `out/renderer` fell from 31 MiB to 24 MiB with no feature loss; the unminified default and the installer-icon import were accidental costs, while CJK subsetting would drop glyphs from user content and needs an ADR revision || D198 | Goal mode is the second contract mode | **Goal is a third durable operating mode (`agent` / `plan` / `goal`) that reuses the Plan approval pipeline end to end. `EnterGoalMode` switches an active Agent turn into the Goal contract state; `SubmitGoal(title, markdown, question)` writes an immutable host-owned `.pi/goal/<unique-name>.md` artifact and inserts one pending `plan_approvals` row. The single approval table gains a `kind` column (`plan` or `goal`, defaulting to `plan`) in schema v11; the kind — not the projected planning state — selects the prompt, artifact directory, submit tool, and i18n namespace, so one approval bar and one execution queue serve both. Plan and Goal are together the contract modes: they share one tool allowlist (Read/Glob/Grep/BrowserPreview/Bash plus their own submit tool), one host hard deny for Write/Edit/plugin/unknown tools evaluated against the durable mode, the shared `*_IN_PLAN` error codes, and the `PLAN_REQUIRES_INTERACTIVE_SESSION` rejection of unattended runs. An approved Goal executes autonomously in Agent: it chooses its own approach and keeps working until every acceptance criterion is verified or a boundary blocks it, then reports criterion by criterion. The wire `kind` is optional and absent means `plan`, so this is additive inside protocol v9.** | Plan answers "carry out these steps"; users also need "reach this outcome, decide the steps yourself" (Claude Code's plan mode and Codex's goal-shaped runs). Making the goal statement, acceptance criteria, and boundaries an approved contract keeps autonomy auditable, and discriminating one pipeline by kind avoids a parallel table, approval surface, and permission boundary that would inevitably drift. || D144 | Sidebar primary chrome at 14px | **Expanded sidebar primary chrome (New task, Plugins, session titles, footer identity name, profile menu actions) uses `--text-base` (14px). Project/group titles and empty-state copy use `--text-md` (13px). Section labels use `--text-sm` (12px). Primary sidebar content must not use the micro `--text-xs` band.** | 13px sidebar body felt undersized next to the 14px chat surface; bumping only primary chrome keeps density while restoring visual balance without a global type-scale change. || D145 | Disable browser text correction on editable fields | **Every text `input` and `textarea` in the desktop renderer disables browser text correction: `spellCheck={false}`, `autoCorrect="off"`, and `autoCapitalize="off"`. Shared `Input`/`Textarea` primitives default these values; raw fields (composer, message edit, command palette, global search, settings/plugins/projects search, model search, browser URL bar, provider model combo) set them explicitly. Checkboxes and non-text controls are unchanged.** | Coding prompts, paths, model ids, and URLs must not be red-underlined or auto-mutated by Chromium/OS text correction; the shell is an application, not a document editor. |@@ -6377,3 +6378,24 @@ that was sitting at the bottom — including after the turn had finished.storage schema, or packaged-installation path changed. See`03-runtime/07-process-model.md`, `03-runtime/04-data-storage.md`, and`02-architecture/03-repo-structure.md`.++## 2026-09-20 — The app ships no fonts (D598)++- Decision D598 amends D232 / ADR 0083. The four bundled families (Geist,+ Inter, Noto Sans SC, LXGW WenKai), their `woff2` files, their OFL license+ texts, `styles/fonts.css`, and its `@import` are gone, together with+ `BUNDLED_FONTS`, the `BundledFont` type, `FontOption.license`, the picker's+ license badge, and the `settings.fontBundled` key in all eight catalogs.+- The Settings Font picker keeps its shape: System default persists the empty+ string, then the installed system families Electron main enumerates over+ `pi-desktop/app/systemFonts` using platform tooling only (deduplicated,+ filtered, sorted, cached 60 s). The `bundled` group is gone; a stored stack+ that matches no option still leads the list under Saved.+- Every generated stack appends the system-only CJK tier `"PingFang SC",+ "Hiragino Sans GB", "Microsoft YaHei", sans-serif`, with no bundled family in+ front of it. A previously stored bundled stack (for example `"Geist",+ "PingFang SC", …`) is kept byte for byte, shows under Saved, and renders+ through that tier. No migration, protocol, or schema change.+- `out/renderer` emits no application font face any more; only KaTeX's `woff2`+ glyphs remain. See ADR 0298, `04-ux/06-settings-ia.md`,+ `04-ux/07-ui-design-system.md`, and E2E-126.diff --git a/docs/zh-CN/adr/index.md b/docs/zh-CN/adr/index.mdindex c583f8bc7..82fe0bc63 100644--- a/docs/zh-CN/adr/index.md+++ b/docs/zh-CN/adr/index.md@@ -17,7 +17,7 @@ ADR 记录那些不应被静默改变的架构选择。中文入口与英文索| [ADR 0010:Rust host core](/adr/0010-rust-backend-host-core) | 特权进程、RPC 与持久化的宿主边界 || [ADR 0053:Plan checkpoint](/adr/0053-plan-checkpoint-artifact-and-execution-epoch) | 计划审批、artifact 和执行 epoch || [ADR 0079:VitePress 文档站](/adr/0079-vitepress-documentation-site) | 双语文档站的结构与部署方式 |-| [ADR 0083:自定义全局界面字体](/adr/0083-custom-global-ui-font) | 设置字体选择器、内置开源字体与系统字体枚举 |+| [ADR 0083:自定义全局界面字体](/adr/0083-custom-global-ui-font) | 设置字体选择器与系统字体枚举(内置字体已由 ADR 0298 移除) || [ADR 0089:主动后台子代理委托](/adr/0089-proactive-background-subagent-delegation) | 非阻塞 Task、TaskWait/TaskList/TaskStop 生命周期与权限作用域 || [ADR 0090:用户可配置的关闭行为](/adr/0090-user-configurable-close-behavior-close-to-tray) | 首次关闭只问一次,关闭到托盘或退出,设置里可改 || [ADR 0095:用厂商账户登录](/adr/0095-vendor-account-oauth-login) | 用订阅账户代替 API 密钥,凭据留在主进程,sidecar 按请求取短时令牌 |@@ -150,7 +150,7 @@ ADR 记录那些不应被静默改变的架构选择。中文入口与英文索| 0080 | [启动后预热全局插件启动器](/adr/0080-prewarm-global-plugin-launcher) | 已接受 || 0081 | [宿主拥有的跨平台插件面板外壳](/adr/0081-host-owned-plugin-panel-chrome) | 已接受 || 0082 | [本地化且随页面自适应的插件面板外壳](/adr/0082-localized-plugin-panel-chrome) | 已接受 |-| 0083 | [自定义全局界面字体](/adr/0083-custom-global-ui-font) | 已接受 |+| 0083 | [自定义全局界面字体](/adr/0083-custom-global-ui-font) | 部分被 ADR 0298 取代 || 0084 | [推迟新任务会话创建直到首条消息](/adr/0084-deferred-new-task-session-creation) | 已接受 || 0085 | [让工作面板快捷键成为开关](/adr/0085-work-panel-shortcut-toggle) | 已接受(修订 ADR 0068) || 0086 | [macOS 保持常规激活策略](/adr/0086-macos-regular-activation-policy) | 已接受 |@@ -303,6 +303,7 @@ ADR 记录那些不应被静默改变的架构选择。中文入口与英文索| 0295 | [会话思考参数不发送](/adr/0295-session-thinking-parameter-omission) | 已接受(D456;修订 ADR 0194 / ADR 0144 / ADR 0221) || 0296 | [已签名 macOS DMG 改为双图标安装](/adr/0296-macos-signed-dmg-two-icon-install) | 已接受(D457;修订 ADR 0232 / ADR 0204) || 0297 | [提供商托管联网搜索作为适配器能力](/adr/0297-provider-hosted-web-search-adapter-capability) | 已接受 |+| 0298 | [应用不再随包发布任何字体](/adr/0298-remove-bundled-fonts) | 已接受(D598;修订 ADR 0083 / D232) |## 什么时候看 ADRdiff --git a/docs/zh-CN/spec/00-baseline.md b/docs/zh-CN/spec/00-baseline.mdindex 6764c46ed..f548ad149 100644--- a/docs/zh-CN/spec/00-baseline.md+++ b/docs/zh-CN/spec/00-baseline.md@@ -74,6 +74,8 @@> (SIL OFL 1.1)字体——Geist、Inter、Noto Sans SC 和 LXGW WenKai——> 随应用本地发布并附带许可证文本,系统已安装字体由 Electron> 主进程通过新增的白名单通道 `pi-desktop/app/systemFonts` 枚举。+> D598 / ADR 0298 后来移除了内置字体:应用不再自带任何字体,+> 选择器只提供「跟随系统」与系统已安装字体,每个字体栈以纯系统 CJK 回退层收尾。> 主机协议或存储架构没有更改。> 当前基线后的修订通过 ADR 0200 / D367 增加了 P0/P1 宿主拥有的插件会话diff --git a/docs/zh-CN/spec/04-ux/06-settings-ia.md b/docs/zh-CN/spec/04-ux/06-settings-ia.mdindex ef0a09976..62e37dc71 100644--- a/docs/zh-CN/spec/04-ux/06-settings-ia.md+++ b/docs/zh-CN/spec/04-ux/06-settings-ia.md@@ -56,10 +56,13 @@- **主题**:可搜索的选择行(与语言相同的锚定菜单)。关闭时的触发器按当前文案收缩,不超过设置控件列,并显示当前名称。菜单把系统、浅色、深色钉在顶部,插件主题在分隔线之后列出,并带「由…提供」提示。搜索匹配名称、描述、id 和插件 id。选择更新 `settings.theme`。- **语言**:可搜索的选择行(不是卡片网格)。关闭时的触发器按当前文案收缩,不超过设置控件列,显示当前语言的本地名称,或「跟随系统」。菜单把「跟随系统」钉在顶部并内嵌显示检测到的语言(例如「当前:简体中文」),然后按本地名称(永不翻译的 endonym)和英文名称列出每个已发布语言,供搜索和排序。选择更新 `settings.language`。新增语言只需加一份目录和一行注册表;选择器不硬编码选项列表。- **字体**:可搜索的选择行(触发器以该字体的字样显示当前字体)- 提供系统默认、内置开源字体(Geist、Inter、Noto Sans SC、- LXGW WenKai——SIL OFL 1.1,本地发布)以及由 Electron 主进程枚举的- 系统已安装字体;选择结果持久化为 `AppSettings.fontFamily`,- 无需重载即可应用到全局界面字体栈(`--font-sans`)+ 提供「跟随系统」以及由 Electron 主进程枚举的系统已安装字体;+ 应用不再自带任何字体(ADR 0298),因此没有内置分组、也没有许可证角标,+ 此前保存的指向已移除字体的字体栈仍显示在「已保存」分组;+ 选择结果持久化为 `AppSettings.fontFamily`,+ 无需重载即可应用到全局界面字体栈(`--font-sans`);+ 每个字体栈以纯系统 CJK 回退层收尾(`PingFang SC`、`Hiragino Sans GB`、+ `Microsoft YaHei`、`sans-serif`)- **字体大小**:星巴克式杯型档位(中杯 / 大杯 / 超大杯 / 超超大杯)加上百分比滑杆(80%–150%)。杯型标签单行显示、不换行。选择持久化为 `AppSettings.fontScale`(`1` = 产品字号阶;缺失表示 1)。渲染器在根元素设置 `--font-scale`,全部 `--text-*` 阶和共享 Lucide 图标diff --git a/docs/zh-CN/spec/04-ux/07-ui-design-system.md b/docs/zh-CN/spec/04-ux/07-ui-design-system.mdindex 657e3cc72..3fd20d71a 100644--- a/docs/zh-CN/spec/04-ux/07-ui-design-system.md+++ b/docs/zh-CN/spec/04-ux/07-ui-design-system.md@@ -322,9 +322,10 @@ UI 字体栈可从设置 → 基础 → 外观中由用户覆盖(ADR 0083)(默认 1,范围 0.8–1.5)。渲染器在根元素设置 `--font-scale`,全部`--text-*` 令牌(以及 `--leading-row`)按比例缩放。共享 Lucide 图标使用同一倍率。窗口缩放仍独立。界面不出现 px 输入。-内置开源字体(Geist、Inter、Noto Sans SC、LXGW WenKai — SIL OFL 1.1)-在 `apps/desktop/src/assets/fonts/` 下本地发布并附许可证文本,系统已安装-字体由 Electron 主进程枚举。每个自定义字体栈都会追加 CJK 回退层,+应用不再随包发布任何字体文件(ADR 0298):选择器提供「跟随系统」与+由 Electron 主进程枚举的系统已安装字体,此前保存的指向已移除字体的字体栈+仍显示在「已保存」分组。每个生成的字体栈以纯系统 CJK 回退层收尾+(`PingFang SC`、`Hiragino Sans GB`、`Microsoft YaHei`、`sans-serif`),确保中文文本保持可读。等宽字体栈(`--font-mono`)不可由用户配置。### 5. 2 类型规模diff --git a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.mdindex 0e3df55d3..380ebcf99 100644--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md@@ -6030,28 +6030,34 @@ IPC 请求无法关闭。#### E2E-126:外观卡片选择全局界面字体-- **前置条件**:应用在 macOS 上运行,系统装有与内置字体不同的字体+- **前置条件**:应用在 macOS 上运行,系统装有与内置令牌栈不同的字体(例如 PingFang SC);使用干净的 `~/.pi-desktop` 配置。- **步骤**:1) 打开设置 → 基础,确认外观卡片在主题与语言下方显示一个字体行,触发器标签为「跟随系统」。- 2) 打开字体选择器,确认列出跟随系统、内置开源字体(Geist、Inter、- Noto Sans SC、LXGW WenKai,并标注许可证)以及系统已安装字体;+ 2) 打开字体选择器,确认只列出跟随系统与系统已安装字体——+ 没有内置开源字体,任何一行都没有许可证角标;确认搜索框可过滤字体系列,当前选择显示选中徽章。- 3) 选择 Geist,确认触发器标签与整个界面无需重载即以 Geist 渲染,- 中文文本通过 CJK 回退层正常显示。- 4) 选择某个系统已安装字体,确认界面切换为该字体;重新打开选择器后- 该字体仍为选中状态。- 5) 重启应用并重新打开设置,确认所选字体仍然生效- (持久化的 `AppSettings.fontFamily`)。- 6) 选择跟随系统并重启,确认界面恢复为内置令牌栈。+ 3) 选择某个系统已安装字体(例如 PingFang SC),确认触发器标签与整个界面+ 无需重载即以该字体渲染,中文文本通过 CJK 回退层正常显示。+ 4) 重新打开选择器确认该字体仍为选中状态,然后选择跟随系统,+ 确认界面立即恢复为内置令牌栈。+ 5) 重启应用并重新打开设置,确认默认字体仍然生效+ (覆盖已被清除,持久化为空的 `AppSettings.fontFamily`)。+ 6) 在保存过内置字体栈的配置上(例如+ `"Geist", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif`),+ 确认字体行把该字体显示在「已保存」分组,应用没有加载任何自带字体文件,+ 且界面穿过系统 CJK 回退层渲染。- **预期**:字体行为可搜索的选择器,触发器以该字体的字样预览当前字体;- 选项包含跟随系统、内置 OFL 字体与通过 `pi-desktop/app/systemFonts`- (缓存 60 秒、排除隐藏 `.` 前缀字体)枚举的系统已安装字体;选择结果- 以 CSS 字体栈持久化到 `AppSettings.fontFamily` 并实时覆盖 `--font-sans`;- 中文文本通过 CJK 回退层保持可读;跟随系统清除覆盖。+ 选项只有跟随系统与通过 `pi-desktop/app/systemFonts`+ (缓存 60 秒、排除隐藏 `.` 前缀字体)枚举的系统已安装字体;应用不再自带字体文件,+ 因此没有内置分组、也没有许可证角标,不再匹配任何选项的已保存字体栈+ 仍排在「已保存」分组首位;选择结果以 CSS 字体栈持久化到+ `AppSettings.fontFamily` 并实时覆盖 `--font-sans`;+ 中文文本通过纯系统 CJK 回退层保持可读;跟随系统清除覆盖。+- **关联规格**:`04-ux/06-settings-ia.md`、`04-ux/07-ui-design-system.md`、- `03-runtime/01-ipc-protocol.md`、ADR 0083+ `03-runtime/01-ipc-protocol.md`、ADR 0083、ADR 0298- **验收**:A(核心 shell)、H(本地化)- **里程碑**:M5+- **状态**:已记录diff --git a/docs/zh-CN/spec/06-delivery/06-release-runbook.md b/docs/zh-CN/spec/06-delivery/06-release-runbook.mdindex 364bcee82..6a81eab7d 100644--- a/docs/zh-CN/spec/06-delivery/06-release-runbook.md+++ b/docs/zh-CN/spec/06-delivery/06-release-runbook.md@@ -432,10 +432,29 @@ Electron 目标布局。| CSS | 0.42 MiB | 0.35 MiB || **`out/renderer` 合计** | **31 MiB** | **24 MiB** |-余下体积主要来自两款随包 CJK 字体(`lxgw-wenkai.woff2` 7.6 MiB、-`noto-sans-sc.woff2` 7.4 MiB)。它们故意不做子集化:ADR 0083 §2 在每个字体栈-末尾追加 `Noto Sans SC`,以保证中文在离线状态下依然可读,而子集化会丢掉用户-提供内容中的字形。压缩它们需要修订 ADR,而不是改构建配置。+渲染器不再产出任何应用字体面。D598 / ADR 0298 移除了四款内置字体(Geist、+Inter、Noto Sans SC、LXGW WenKai),因此 `out/renderer` 中只剩 KaTeX 的数学+字形 `woff2`。以下为本机实测,两次均在干净的 `pnpm install --frozen-lockfile`+之后构建:++| 渲染器分组 | 含内置字体 | 移除后(D598) |+|---|---:|---:|+| JavaScript(121 个 chunk) | 9.04 MiB | 9.04 MiB |+| `woff2`(23 → 19 个文件) | 15.71 MiB | 0.24 MiB |+| CSS(1 个文件) | 0.48 MiB | 0.48 MiB |+| PNG 品牌资源(4 个文件) | 0.08 MiB | 0.08 MiB |+| GIF(2 个文件) | 0.05 MiB | 0.05 MiB |+| **`out/renderer` 合计**(152 → 148 个文件) | **25.36 MiB** | **9.89 MiB** |++差异完全来自被删除的四个字体面,以下为构建报告的实际大小:+`lxgw-wenkai.woff2` 8,016.75 kB、`noto-sans-sc.woff2` 7,782.07 kB、+`inter.woff2` 352.24 kB、`geist.woff2` 69.65 kB,合计 16,220.71 kB,+即合计体积下降的全部 15.47 MiB。中文现在由系统字体层+(`PingFang SC`、`Hiragino Sans GB`、`Microsoft YaHei`)渲染,因此不存在因+子集化而丢失字形的问题:根本不再随包发布字体面。+开启,旧 `woff`/`truetype` 剔除仍然保留,因为 KaTeX 仍会声明这些来源。++上表是三控件的 `v0.10.8` 记录,早于本次移除,其 `woff2` 行已不再反映现状。在干净的轮廓上手动烟雾 (`PI_DESKTOP_DATA_DIR=$(mktemp -d)`):diff --git a/docs/zh-CN/spec/08-meta/decisions-log.md b/docs/zh-CN/spec/08-meta/decisions-log.mdindex c3aa09ced..d3849b62d 100644--- a/docs/zh-CN/spec/08-meta/decisions-log.md+++ b/docs/zh-CN/spec/08-meta/decisions-log.md@@ -381,7 +381,8 @@| D234 | 插件拥有的面板表面与主机窗口控制胶囊 | **插件面板在 macOS、Windows 和 Linux 上均使用无框窗口。沙盒化 preload 在每个平台预留相同的透明 46px 安全区,并在右上角的封闭 Shadow DOM 中仅渲染一个固定胶囊,胶囊恰好包含最小化、最大化或还原、关闭三个按钮。主机不再渲染面板标题或开发安全区提示;插件拥有标题、工具栏、背景以及其他所有可见面板界面。普通流内容会自动偏移,固定或粘性界面使用现有的 `--pi-plugin-titlebar-height: 46px`,插件自己的拖拽区域使用 `-webkit-app-region: drag`,交互控件退出拖拽。私有的验证发送方控制通道、本地化标签、页面自适应颜色、`window.pluginBridge`、每插件 partition、host protocol v9 和存储架构保持不变。本决策修订 D218 / ADR 0081 以及 D232 / ADR 0082。** | 主机标题栏占用了插件自己的视觉层级,并且仍然让 macOS 与 Windows/Linux 表现不同。紧凑的主机控制胶囊保留安全的原生窗口操作,同时把面板表面交还给插件。 || D235 | 严格 46px 插件拖拽带与简约胶囊 | **插件面板在每个平台均严格预留 46px 的透明主机拖拽带。普通流内容按该数值偏移,拖拽带内除胶囊外不接受插件点击,开发面板显示本地化提示,说明顶部 46px 仅用于拖拽。主机不渲染面板标题。固定在右上角的胶囊保持在拖拽带内,恰好包含最小化、最大化或还原、关闭三个按钮,并使用简洁的页面自适应表面,不添加厚重阴影或模糊效果。本决策修订 D234 / ADR 0092;私有的验证发送方控制通道、封闭 Shadow DOM、`window.pluginBridge`、protocol v9 和存储架构保持不变。** | 无框面板需要可靠的拖拽目标和清晰的开发约束,但主机拖拽带不能增长,也不能抢占插件自己的视觉层级。 || D343 | 自定义全局文字缩放 | **设置 → 常规 → 外观在字体行下增加字体大小。星巴克式杯型档位(中杯 / 大杯 / 超大杯 / 超超大杯)加上百分比滑杆,持久化为可选 `AppSettings.fontScale`(`1` = 产品字号阶,缺失 = 1,范围 0.8–1.5、步进 0.025)。渲染器在根元素设置 `--font-scale`;每个 `--text-*` 令牌和 `--leading-row` 都是 `calc(<产品 px> * var(--font-scale))`,共享 Lucide 图标使用同一倍率,正文、chrome、标题、代码和图标无需重载即保持相对阶。界面不出现 px 输入。窗口放大/缩小/重置仍独立。未发布的遗留 `fontSize` px 字段在没有 `fontScale` 时按 `px / 14` 迁移。无协议/存储版本升级。** | `--text-*` 阶本身就是一组相对尺寸;一个倍率可以一次缩放所有台阶。窗口缩放仍会缩放布局。只改阅读区的 px 会让同一窗口出现两套字号,还强迫用户填一个只对应 `--text-base` 的数字(ADR 0180)。 |-| D232 | 自定义全局界面字体 | **设置 → 基础 → 外观新增可搜索的字体选择器(触发器以当前字体的字样预览)。选择结果持久化为 `AppSettings.fontFamily`(CSS 字体栈);缺失时保持内置 `--font-sans` 令牌栈,渲染器通过覆盖根元素的 `--font-sans` 应用字体栈,无需重载。四款内置字体——Geist、Inter、Noto Sans SC、LXGW WenKai——以 woff2 格式按 SIL OFL 1.1 本地发布并附许可证文本;每个自定义字体栈都追加 CJK 回退层,等宽字体栈保持不变。系统已安装字体由 Electron 主进程仅使用平台工具枚举(macOS 用 `system_profiler`、Windows 用 PowerShell、Linux 用 `fc-list`),去重/排序/过滤并缓存 60 秒,通过新增的允许通道 `pi-desktop/app/systemFonts` 暴露;主机协议 v9 与存储架构 v10 不变。** | 用户需要 Codex/dbx 风格的全局字体偏好,但沙盒化渲染器无法枚举系统字体,而针对仅渲染器偏好不应扩大主机 RPC 面。内置 OFL 许可字体保证每个可选字体均商用安全且可离线使用,60 秒缓存限制了 macOS 枚举的耗时(ADR 0083)。 |+| D232 | 自定义全局界面字体 | *(由 D598 修订)* **设置 → 基础 → 外观新增可搜索的字体选择器(触发器以当前字体的字样预览)。选择结果持久化为 `AppSettings.fontFamily`(CSS 字体栈);缺失时保持内置 `--font-sans` 令牌栈,渲染器通过覆盖根元素的 `--font-sans` 应用字体栈,无需重载。四款内置字体——Geist、Inter、Noto Sans SC、LXGW WenKai——以 woff2 格式按 SIL OFL 1.1 本地发布并附许可证文本;每个自定义字体栈都追加 CJK 回退层,等宽字体栈保持不变。系统已安装字体由 Electron 主进程仅使用平台工具枚举(macOS 用 `system_profiler`、Windows 用 PowerShell、Linux 用 `fc-list`),去重/排序/过滤并缓存 60 秒,通过新增的允许通道 `pi-desktop/app/systemFonts` 暴露;主机协议 v9 与存储架构 v10 不变。** | 用户需要 Codex/dbx 风格的全局字体偏好,但沙盒化渲染器无法枚举系统字体,而针对仅渲染器偏好不应扩大主机 RPC 面。内置 OFL 许可字体保证每个可选字体均商用安全且可离线使用,60 秒缓存限制了 macOS 枚举的耗时(ADR 0083)。 |+| D598 | 应用不再随包发布任何字体 | **修订 D232 / ADR 0083:所有内置字体全部移除。`apps/desktop/src/assets/fonts/`(四个 `woff2` 文件及其 OFL 许可证文本)、`apps/desktop/src/styles/fonts.css` 以及 `styles/globals.css` 中的 `@import "./fonts.css";` 均已删除,`BUNDLED_FONTS`、`BundledFont` 类型、`FontOption.license`、选择器上的许可证角标,以及全部八份语言目录中的 `settings.fontBundled` 一并移除。选择器保留「跟随系统」(持久化为空字符串)与系统已安装字体两类选项,枚举机制完全不变,仍通过白名单通道 `pi-desktop/app/systemFonts` 获取;已保存的字体栈若不再匹配任何选项,仍在「已保存」(`custom`)分组中排在首位。每个生成的字体栈现在追加纯系统 CJK 回退层 `"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif`,前面不再有内置字体。此前保存的指向内置字体的字体栈(例如 `"Geist", "PingFang SC", …`)按原样保留,显示在「已保存」分组,并穿过该回退层渲染。协议版本、schema 版本与存储迁移均不变。** | 四款 OFL 字体重复提供每个目标操作系统本就具备的字形覆盖,占用 `out/renderer` 约 15.7 MiB 的 `woff2`(LXGW WenKai 7.6 MiB、Noto Sans SC 7.4 MiB),并为操作系统已安装列表之外的四个选项承担字体文件许可证告知义务。见 ADR 0298、E2E-126 与 E2E-092。 || D230 | 用户可配置的关闭行为与关闭到托盘 | **Windows/Linux 的关闭行为是由 Electron 主进程存放在 `<data>/close-behavior.json` 的持久化偏好。`ask` 是尚未设置的过渡态:首次关闭弹出原生模态框(取消 / 关闭到托盘 / 退出),选定其一即永久保存,取消则保持窗口打开且偏好仍未设置。可设置的只有 `tray` 和 `quit` —— 设置 → 通用仅在 Windows/Linux 渲染两项单选段(关闭到托盘 / 退出应用),`pi-desktop/window/closeBehavior/set` 拒绝 `ask`,因此选择可以切换但无法退回到每次询问。`tray` 把窗口隐藏到 D216 常驻的托盘图标之下(点击恢复,菜单显示或退出);切换到 `quit` 不会销毁该图标,因为最小化到托盘仍然需要它。除了已经获准的退出之外,每一次非 macOS 的关闭都会被拦截;`quitting` 与 macOS 的关闭直接放行,`quit` 分支自己调用 `app.quit()`,而 `window-all-closed` 只在 `tray` 下保持沉默,因此启动探针与显式退出不受影响,常驻托盘也不会让 `quit` 会话继续活着。在 macOS 上 `closeBehavior/set` 同样以 `INVALID_ARGUMENT` 失败。边界看门狗跳过最小化和隐藏的窗口,所以隐藏到托盘的窗口不会被强制恢复。macOS 保持原生 Dock 生命周期(D216、ADR 0078、ADR 0090)。** | 最小化本来就把窗口收进 D216 的托盘;缺口在关闭:它在 Windows/Linux 上直接退出。固定的关闭到托盘会让期待退出的用户意外,所以这个选择只问一次、记住、并可在设置里回访 —— 与 Codex 风格外壳让长时会话继续存活但不接管关闭按钮的做法一致。 || D363 | 显式退出在关机前确认 | **修订 D230 / D216:Cmd+Q、应用菜单退出和托盘退出显示一次原生警告(取消 / 退出)。取消让应用继续运行,之后的退出会再次询问。确认走有序 `before-quit` 关机。已在 D230 对话框选择退出的关窗路径设置 `quitConfirmed`,不再问第二次。boot、supervision 和 capture 探针跳过对话框,应用内更新所执行的退出同样跳过:`autoUpdater.quitAndInstall()` 会先于 `app.quit()` 启动平台安装器,而该安装器一旦发现应用超出等待窗口就会中止,因此更新重启必须不经询问直接进入有序关机。见 E2E-204。** | 显式退出会拆掉 host-core、sidecar 和进行中的工作;一步确认避免误触 Cmd+Q 或托盘退出。 || D252 | Windows 任务栏保留原生最小化/恢复 | *(显式的渲染器/菜单最小化条款被 D256 / ADR 0123 取代)* **修订 D216 / ADR 0078:当聚焦的 Windows 主窗口从它的任务栏按钮被切换时,Electron 让原生 `minimize` 过渡走完,而不是隐藏窗口。任务栏条目保持可用,下一次点击任务栏会恢复并聚焦它。显式的渲染器/菜单最小化操作仍然隐藏到常驻托盘;macOS/Linux 的原生最小化仍然驻留托盘。不改动 IPC、存储、主机协议或后台工作。** | D216 无条件的 `window.hide()` 把任务栏发起的 Windows `minimize` 事件当成托盘隐藏处理,意外移除了任务栏条目,只给用户留下托盘恢复这一条路。 |@@ -442,7 +443,7 @@| D215 | Windows 保留的全局快捷方式回退 | **在 Windows 上,host-core 为有效的 `Alt+Space` 默认绑定安装一个狭窄的 `WH_KEYBOARD_LL` 挂钩,因为 shell 可能会从 Electron 的 `globalShortcut` 中保留它。 hook 仅消耗匹配的和弦并发出 `keyboard.shortcut({ binding: "Alt+Space" })`; Electron 切换现有插件启动器。每当设置更改时,Electron 都会调用附加的 `keyboard.setGlobalShortcut({ binding })`,而 host-core 仅针对该精确绑定启用挂钩。其他平台和自定义绑定保留在 Electron 的全局快捷路径上。** | 每当 PI-Desktop 未获得焦点时,Windows 的活动窗口系统菜单保留都会导致附带的全局启动器不可用。范围狭窄的主机回退会保留快捷方式,而不读取文本或扩展 plugin/renderer 权限 (ADR 0076)。 || D217 | 启动完成后预热插件启动器 | **主应用及后端完成启动后,Electron 创建并加载保留的插件启动器,同时保持窗口隐藏。窗口创建使用一个共享的进行中 promise,因此预热期间收到的快捷键会复用同一次渲染器加载;若预热失败,则销毁未完成的窗口、清除 promise,并允许下次调用重试。每次显示窗口时仍会刷新实时插件目录。** | 将 BrowserWindow 分配和渲染器启动移出首次可见调用,使启动器的显示延迟更稳定,同时不拖慢主应用启动,也不削弱插件目录的新鲜度、IPC 或沙盒边界(ADR 0080)。 || D219 | 插件启动器的最近使用历史 | **启动器渲染器把每个成功打开过的插件 id 连同时间戳记录在渲染器本地的 `localStorage` 里(键 `pi.desktop.pluginLaunchHistory`,上限 24 条),并在查询为空时按最近使用顺序呈现。键入查询后,先按搜索相关性排序,仅在同等相关时用最近使用作为决胜条件,因此未用过的插件按名称排在最近使用的之后。存储损坏或不可用时降级为原有的名称顺序,不影响启动。这只是细化 D211 的呈现,不改变 IPC、主机 RPC、权限、协议 v9 或存储架构 v11。** | 以键盘为先的启动器用户会反复打开同一批插件;记住上次使用顺序让最常用的目标始终只差一个 Enter,而用户一旦键入,相关性仍然是权威。 |-| D221 | 渲染器产物体积控制 | **渲染器构建显式设置 `minify: "esbuild"`,因为 `electron-vite` 将其渲染器预设硬编码为 `minify: false`。`pi-drop-legacy-font-fallbacks` 插件以 `enforce: "pre"` 在 Vite 将 `url()` 登记为资源之前剥离逗号前缀的 `woff`/`truetype` `src` 条目,因为内置 Chromium 始终支持 `woff2`;唯一来源为旧格式的字体保持不变。`BrandLogo` 导入由规范母版派生的 192x192 标记 `src/assets/brand/logo-{light,dark}.png`,而非 `build/` 中的 1024px 安装器图标,在不改变视觉标识的前提下细化 D079/D094。`packaging-footprint.test.mjs` 对这三项均有断言,使框架默认值或被回退的导入无法静默回归。两个内置 CJK 字体依据 ADR 0083 第 2 节保持不裁剪。** | `out/renderer` 从 31 MiB 降至 24 MiB 且无功能损失;未压缩的默认值与安装器图标导入属于意外成本,而 CJK 子集化会丢失用户内容中的字形,需要修订 ADR |+| D221 | 渲染器产物体积控制 | *(内置 CJK 字体条款由 D598 取代)* **渲染器构建显式设置 `minify: "esbuild"`,因为 `electron-vite` 将其渲染器预设硬编码为 `minify: false`。`pi-drop-legacy-font-fallbacks` 插件以 `enforce: "pre"` 在 Vite 将 `url()` 登记为资源之前剥离逗号前缀的 `woff`/`truetype` `src` 条目,因为内置 Chromium 始终支持 `woff2`;唯一来源为旧格式的字体保持不变。`BrandLogo` 导入由规范母版派生的 192x192 标记 `src/assets/brand/logo-{light,dark}.png`,而非 `build/` 中的 1024px 安装器图标,在不改变视觉标识的前提下细化 D079/D094。`packaging-footprint.test.mjs` 对这三项均有断言,使框架默认值或被回退的导入无法静默回归。两个内置 CJK 字体依据 ADR 0083 第 2 节保持不裁剪。** | `out/renderer` 从 31 MiB 降至 24 MiB 且无功能损失;未压缩的默认值与安装器图标导入属于意外成本,而 CJK 子集化会丢失用户内容中的字形,需要修订 ADR || D198 | Goal模式为第二种合约模式 | **Goal 是第三种持久操作模式 (`agent` / `plan` / `goal`),它端到端地重用 Plan 审批管道。 `EnterGoalMode` 将活跃的 Agent 切换为 Goal 合约状态; `SubmitGoal(title, markdown, question)` 写入主机拥有的不可变 `.pi/goal/<unique-name>.md` 工件并插入一个待处理的 `plan_approvals` 行。单个审批表在 schema v11 中获得 `kind` 列(`plan` 或 `goal`,默认为 `plan`);这种类型(而不是预计的计划状态)选择提示、工件目录、提交工具和 i18n 命名空间,因此一个批准栏和一个执行队列同时服务于这两者。 Plan 和 Goal 是合约模式:它们共享一个工具白名单(Read/Glob/Grep/BrowserPreview/Bash 加上他们自己的提交工具)、针对持久模式评估的 Write/Edit/plugin/unknown 工具的一台主机硬拒绝、共享 `*_IN_PLAN` 错误代码以及对无人值守运行的 `PLAN_REQUIRES_INTERACTIVE_SESSION` 拒绝。经批准的 Goal 在 Agent 中自主执行:它选择自己的方法并继续工作,直到验证每个验收标准或边界阻止它,然后逐个报告标准。线 `kind` 是可选的,不存在意味着 `plan`,因此这是协议 v9 中的附加内容。** | Plan 回答“执行这些步骤”;用户还需要“达到这个结果,自己决定步骤”(Claude Code的计划模式和Codex的目标型运行)。在批准的合同中制定目标声明、验收标准和边界可以保持自治的可审核性,并且按类型区分一条管道可以避免出现不可避免的漂移的平行表、批准表面和许可边界。 || D144 | 侧边栏主镀铬为 14 像素 | **扩展侧边栏主要镶边(新任务、插件、会话标题、页脚标识名称、配置文件菜单操作)使用 `--text-base` (14px)。 Project/group 标题和空状态副本使用 `--text-md` (13px)。部分标签使用 `--text-sm` (12px)。主要侧边栏内容不得使用微型 `--text-xs` 带。** | 13px 侧边栏主体在 14px 聊天界面旁边感觉尺寸过小;仅碰撞原色铬可以保持密度,同时恢复视觉平衡,而无需全局类型比例变化。 || D145 | 禁用可编辑字段上的浏览器文本更正 | **桌面渲染器中的每个文本 `input` 和 `textarea` 都会禁用浏览器文本校正:`spellCheck={false}`、`autoCorrect="off"` 和 `autoCapitalize="off"`。共享 `Input`/`Textarea` 原语默认这些值;原始字段(编写器、消息编辑、命令选项板、全局搜索、settings/plugins/projects 搜索、模型搜索、浏览器 URL 栏、提供程序模型组合)显式设置它们。复选框和非文本控件保持不变。** | 编码提示、路径、模型 ID 和 URL 不得带有红色下划线或通过 Chromium/OS 文本更正自动更改; shell 是一个应用程序,而不是文档编辑器。 |@@ -4552,3 +4553,20 @@ that amendment are retired by ADR 0268; the upstream work-panel lifecycle stays.- 因此已在运行的正式版不再拒绝开发启动所需的锁,两者也不会把两个 host-core 压到同一个 `pi.sqlite`、同一个持久化 outbox 或同一棵日志树上。`PI_DESKTOP_DATA_DIR` 仍然优先于两种 profile,并且在作为子进程环境变量传给 host-core 之前被绝对化;Electron 主进程把解析结果回写到该变量,使插件运行时读到同一个根目录,而不是回退到正式版默认值。- 显式 `--user-data-dir` 仍然优先,E2E 装置正是用它把构建指向临时 profile。- 决策 D599 收窄 D236 并修订 ADR 0094:锁仍以「安装」为作用域,而开发构建现在是第二个安装,不再是一个含义模糊的第二个进程。未改动任何 IPC 通道、宿主协议、存储 schema 或正式安装的路径。见 `03-runtime/07-process-model.md`、`03-runtime/04-data-storage.md` 与 `02-architecture/03-repo-structure.md`。++## 2026-09-20 — 应用不再随包发布任何字体(D598)++- 决策 D598 修订 D232 / ADR 0083。四款内置字体(Geist、Inter、Noto Sans SC、LXGW WenKai)、+ 它们的 `woff2` 文件与 OFL 许可证文本、`styles/fonts.css` 及其 `@import` 全部删除,+ `BUNDLED_FONTS`、`BundledFont` 类型、`FontOption.license`、选择器的许可证角标,+ 以及全部八份目录中的 `settings.fontBundled` 键一并移除。+- 设置字体选择器的形态不变:「跟随系统」持久化为空字符串,其后是 Electron 主进程+ 通过 `pi-desktop/app/systemFonts` 枚举的系统已安装字体(仅用平台工具,去重、过滤、排序、+ 缓存 60 秒)。`bundled` 分组消失;不再匹配任何选项的已保存字体栈仍排在列表中+ 「已保存」分组的首位。+- 每个生成的字体栈追加纯系统 CJK 回退层 `"PingFang SC", "Hiragino Sans GB",+ "Microsoft YaHei", sans-serif`,前面不再有内置字体。此前保存的指向内置字体的字体栈+ (例如 `"Geist", "PingFang SC", …`)按原样保留,显示在「已保存」分组,并穿过该回退层+ 渲染。无迁移、协议或 schema 变更。+- 渲染器产物不再产出任何应用字体面,只剩 KaTeX 的 `woff2` 字形。见 ADR 0298、+ `04-ux/06-settings-ia.md`、`04-ux/07-ui-design-system.md` 与 E2E-126。diff --git a/packages/i18n/src/locales/de/index.ts b/packages/i18n/src/locales/de/index.tsindex dc6aac89e..e2fcf6c03 100644--- a/packages/i18n/src/locales/de/index.ts+++ b/packages/i18n/src/locales/de/index.ts@@ -1190,7 +1190,6 @@ sklm: {"languageSearchPlaceholder": "Sprachen suchen…","font": "Schriftart","fontSystemDefault": "Systemstandard",- "fontBundled": "Gebündelt","fontSystem": "System","fontCustom": "Gespeichert","fontSearchPlaceholder": "Schriftarten suchen…",diff --git a/packages/i18n/src/locales/en/index.ts b/packages/i18n/src/locales/en/index.tsindex d64b659c4..c8ef180cc 100644--- a/packages/i18n/src/locales/en/index.ts+++ b/packages/i18n/src/locales/en/index.ts@@ -1206,7 +1206,6 @@ sklm: {languageSearchPlaceholder: "Search languages…",font: "Font",fontSystemDefault: "System default",- fontBundled: "Bundled",fontSystem: "System",fontCustom: "Saved",fontSearchPlaceholder: "Search fonts…",diff --git a/packages/i18n/src/locales/es/index.ts b/packages/i18n/src/locales/es/index.tsindex 0bbb24306..5cf488e42 100644--- a/packages/i18n/src/locales/es/index.ts+++ b/packages/i18n/src/locales/es/index.ts@@ -1190,7 +1190,6 @@ sklm: {"languageSearchPlaceholder": "Buscar idiomas…","font": "Fuente","fontSystemDefault": "Valor predeterminado del sistema",- "fontBundled": "Paquete","fontSystem": "Sistema","fontCustom": "Guardado","fontSearchPlaceholder": "Buscar fuentes…",diff --git a/packages/i18n/src/locales/fr/index.ts b/packages/i18n/src/locales/fr/index.tsindex 4d0c5cda2..0e795d57d 100644--- a/packages/i18n/src/locales/fr/index.ts+++ b/packages/i18n/src/locales/fr/index.ts@@ -1190,7 +1190,6 @@ sklm: {"languageSearchPlaceholder": "Rechercher des langues…","font": "Police","fontSystemDefault": "Système par défaut",- "fontBundled": "Regroupé","fontSystem": "Système","fontCustom": "Enregistré","fontSearchPlaceholder": "Polices de recherche…",diff --git a/packages/i18n/src/locales/ko/index.ts b/packages/i18n/src/locales/ko/index.tsindex d33d2c763..07425f168 100644--- a/packages/i18n/src/locales/ko/index.ts+++ b/packages/i18n/src/locales/ko/index.ts@@ -1207,7 +1207,6 @@ sklm: {languageSearchPlaceholder: "언어 검색…",font: "글꼴",fontSystemDefault: "시스템 기본값",- fontBundled: "번들",fontSystem: "시스템",fontCustom: "저장됨",fontSearchPlaceholder: "글꼴 검색…",diff --git a/packages/i18n/src/locales/tr/index.ts b/packages/i18n/src/locales/tr/index.tsindex 32511d861..3255413fd 100644--- a/packages/i18n/src/locales/tr/index.ts+++ b/packages/i18n/src/locales/tr/index.ts@@ -1207,7 +1207,6 @@ sklm: {languageSearchPlaceholder: "Dil ara…",font: "Yazı tipi",fontSystemDefault: "Sistem varsayılanı",- fontBundled: "Paketlenen",fontSystem: "Sistem",fontCustom: "Kaydedilmiş",fontSearchPlaceholder: "Yazı tipi ara…",diff --git a/packages/i18n/src/locales/zh-CN/index.ts b/packages/i18n/src/locales/zh-CN/index.tsindex 0b68aca7a..64defb09d 100644--- a/packages/i18n/src/locales/zh-CN/index.ts+++ b/packages/i18n/src/locales/zh-CN/index.ts@@ -1190,7 +1190,6 @@ sklm: {languageSearchPlaceholder: "搜索语言…",font: "字体",fontSystemDefault: "跟随系统",- fontBundled: "内置",fontSystem: "系统",fontCustom: "已保存",fontSearchPlaceholder: "搜索字体…",diff --git a/packages/i18n/src/locales/zh-TW/index.ts b/packages/i18n/src/locales/zh-TW/index.tsindex 9c8a1f820..337cde2ac 100644--- a/packages/i18n/src/locales/zh-TW/index.ts+++ b/packages/i18n/src/locales/zh-TW/index.ts@@ -1190,7 +1190,6 @@ sklm: {languageSearchPlaceholder: "搜尋語言…",font: "字型",fontSystemDefault: "跟隨系統",- fontBundled: "內建",fontSystem: "系統",fontCustom: "已儲存",fontSearchPlaceholder: "搜尋字型…",diff --git a/scripts/e2e-composer-autocomplete.mjs b/scripts/e2e-composer-autocomplete.mjsindex d3ec2195a..22d8dbc03 100644--- a/scripts/e2e-composer-autocomplete.mjs+++ b/scripts/e2e-composer-autocomplete.mjs@@ -33,7 +33,7 @@ try {},nodePaths: [join(root, "apps/desktop/node_modules")],});- // Use the built app's complete CSS, including Tailwind reset and bundled fonts.+ // Use the built app's complete CSS, including the Tailwind reset.const renderer = join(root, "apps/desktop/out/renderer");const appHtml = await readFile(join(renderer, "index.html"), "utf8");const css = [...appHtml.matchAll(/href="([^" ]+\.css)"/g)].map((match) => match[1]);diff --git a/scripts/e2e-theme-surfaces.mjs b/scripts/e2e-theme-surfaces.mjsindex ca466c9c0..b5eb90f25 100644--- a/scripts/e2e-theme-surfaces.mjs+++ b/scripts/e2e-theme-surfaces.mjs@@ -13,7 +13,7 @@ const { electronBinary } = resolveElectronBinary(root);const temp = await mkdtemp(join(tmpdir(), "pi-theme-surfaces-"));try {await cp(join(root, "scripts/e2e/theme-surfaces.js"), join(temp, "renderer.js"));- // Use the built app's complete CSS, including Tailwind reset and bundled fonts.+ // Use the built app's complete CSS, including the Tailwind reset.const renderer = join(root, "apps/desktop/out/renderer");const appHtml = await readFile(join(renderer, "index.html"), "utf8");const css = [...appHtml.matchAll(/href="([^" ]+\.css)"/g)].map((match) => match[1]);