A local-first multi-agent app development platform, built on PenguinHarness
feat(web): 版权信息页写明七套主题的来源与许可
lmlihenga488bcb7a02a
diff --git a/changelog/unreleased/2026-11-01-theme-credits.md b/changelog/unreleased/2026-11-01-theme-credits.mdnew file mode 100644index 00000000..2011558b--- /dev/null+++ b/changelog/unreleased/2026-11-01-theme-credits.md@@ -0,0 +1,33 @@+# The credits page states the themes' licence and where they come from++- **Date:** 2026-11-01+- **Type:** feature+- **Scope:** `web`+- **Breaking:** no++[中文](2026-11-01-theme-credits.zh.md)++Settings › Credits listed a licence for every font but said nothing about the other half, the+themes. Below the fonts there is now a 「Themes」 block: the three the app ships (Primer, Frost,+Console) come with Adelie, and the four in the theme library on the Appearance page (Cyberpunk,+Doodle, Clay Glow, Skeuo) are maintained by lmliheng and fetched on request. All seven are+Apache-2.0, the licence Adelie itself carries, and the block ends with the theme library's+repository. A theme file holds colour and size values only, never code.++## Details++- `packages/web/src/features/settings/credits-section.tsx`: the font list gains an outer spacing+ wrapper and a following `ThemeCredit` — a heading, one paragraph and a link out to+ `github.com/lmliheng/adelie-themes`.+- Copy: `creditsThemeLibrary` ("Themes") and `creditsThemeLibraryInfo`. Static words rather than a+ fetch: the page has to stay readable offline and cannot fail to say what the app itself ships just+ because the library is unreachable. The library's live list is the Appearance page's, beside the+ picker.+- `packages/web/test/credits-section.test.ts` (new, 2 cases): the font family names and the licence+ heading are still rendered, and the theme block carries `Apache-2.0`, `lmliheng`, the repository+ URL and all seven theme names.++## Compatibility++- Display only: the `themes/*.json` format and the way themes are fetched are unchanged, and+ `THIRD-PARTY-NOTICES.md` is unchanged too.diff --git a/changelog/unreleased/2026-11-01-theme-credits.zh.md b/changelog/unreleased/2026-11-01-theme-credits.zh.mdnew file mode 100644index 00000000..a43038c9--- /dev/null+++ b/changelog/unreleased/2026-11-01-theme-credits.zh.md@@ -0,0 +1,27 @@+# 版权信息页写明主题的许可与来源++- **Date:** 2026-11-01+- **Type:** feature+- **Scope:** `web`+- **Breaking:** no++[English](2026-11-01-theme-credits.md)++设置 › 版权信息此前只逐个字体列出许可,主题那一半没有交代。现在字体列表下面多了一段「主题」:应用自+带的三套(通用、白领、极客)随 Adelie 一起提供;外观页「主题库」里的四套(赛博朋克、手绘涂鸦、陶光、+拟物化)由 lmliheng 维护,按需取用。七套都是 Apache-2.0,与 Adelie 同一个许可,末尾给出主题库仓库的+地址。一段主题只含颜色与尺寸这类取值,不含代码。++## 细节++- `packages/web/src/features/settings/credits-section.tsx`:字体列表外包一层间距,其后新增+ `ThemeCredit`——一个标题、一段说明与一个指向 `github.com/lmliheng/adelie-themes` 的外链。+- 文案:`creditsThemeLibrary`(中「主题」/ 英 "Themes")与 `creditsThemeLibraryInfo`。写成静态文字而+ 非按需拉取:这一页要在离线时也能读,也不能因为主题库不可达就说不出应用自己带了什么。库里的实际清单+ 在外观页的选取器旁边。+- `packages/web/test/credits-section.test.ts`(新,2 条):渲染后字体族名与许可标题仍在;主题块含+ `Apache-2.0`、`lmliheng`、仓库地址与七个主题名。++## 兼容++- 只加了展示:带 `themes/*.json` 的格式与主题的取用方式都没变,`THIRD-PARTY-NOTICES.md` 也没有变。diff --git a/packages/web/src/features/settings/credits-section.tsx b/packages/web/src/features/settings/credits-section.tsxindex fe6dc168..2a152cac 100644--- a/packages/web/src/features/settings/credits-section.tsx+++ b/packages/web/src/features/settings/credits-section.tsx@@ -9,6 +9,11 @@* why the page itself is visible to everyone, the desktop shell's window included. The page is* the list and nothing else; the rail already names it.*+ * The themes are the page's other half, and for the same reason: a theme is a work someone+ * chose, and its licence is not visible anywhere else in the product. The three the app ships+ * come with it, and the four in the library are fetched from a directory Adelie does not own —+ * both are Apache-2.0, which is stated here rather than assumed from the app's own licence.+ ** Each licence text is a disclosure (the WAI-ARIA pattern: a real button with `aria-expanded`* and `aria-controls`, the panel kept in the DOM and `hidden` while folded). A licence runs to* pages, so the open panel scrolls inside a capped height rather than pushing the next font a@@ -95,10 +100,41 @@ function CreditRow({ font }: { font: FontCredit }) {export function CreditsSection() {return (- <ul className="divide-y divide-gray-100 dark:divide-gray-800/60">- {FONT_CREDITS.map((font) => (- <CreditRow key={font.id} font={font} />- ))}- </ul>+ <div className="space-y-6">+ <ul className="divide-y divide-gray-100 dark:divide-gray-800/60">+ {FONT_CREDITS.map((font) => (+ <CreditRow key={font.id} font={font} />+ ))}+ </ul>+ <ThemeCredit />+ </div>+ );+}++/** The theme library's own project page, linked like a font's upstream (see ThemeCredit). */+const THEME_LIBRARY_URL = "https://github.com/lmliheng/adelie-themes";++/**+ * Where the themes come from and what licence they carry. Static words rather than a fetch: the+ * library is a directory this app reads on demand, and the page that must stay readable offline —+ * and answerable for what the app itself ships — cannot depend on it being reachable. The live+ * list of what the library holds is the Appearance page's, next to the picker.+ */+function ThemeCredit() {+ return (+ <div>+ <p className="text-sm font-medium">{S.settings.creditsThemeLibrary}</p>+ <p className="mt-1 text-xs leading-5 text-gray-500 dark:text-gray-400">+ {S.settings.creditsThemeLibraryInfo}+ </p>+ <a+ href={THEME_LIBRARY_URL}+ target="_blank"+ rel="noreferrer"+ className="text-link mt-1 inline-block text-xs break-all underline-offset-2 hover:underline"+ >+ {THEME_LIBRARY_URL}+ </a>+ </div>);}diff --git a/packages/web/src/lib/strings-en.ts b/packages/web/src/lib/strings-en.tsindex 889b3759..c6061c3a 100644--- a/packages/web/src/lib/strings-en.ts+++ b/packages/web/src/lib/strings-en.ts@@ -377,6 +377,9 @@ export const en: Strings = {creditsSource: "Source",creditsPackaged: "Packaged as",creditsLicenseText: "Full license text",+ creditsThemeLibrary: "Themes",+ creditsThemeLibraryInfo:+ "The app ships three themes of its own (Primer, Frost, Console). The four in the theme library on the Appearance page — Cyberpunk, Doodle, Clay Glow and Skeuo — are maintained by lmliheng and fetched on request. All seven are Apache-2.0, the licence Adelie itself carries, and a theme file holds colour and size values only, never code.",agentApiTitle: "Agent API",agentApiToggle: "Allow the Agent API",agentApiHint:diff --git a/packages/web/src/lib/strings.ts b/packages/web/src/lib/strings.tsindex 88f33698..3e27d9fd 100644--- a/packages/web/src/lib/strings.ts+++ b/packages/web/src/lib/strings.ts@@ -447,6 +447,13 @@ export const zh = {/** The npm package a face arrives through, under the type's own project link. */creditsPackaged: "打包来源",creditsLicenseText: "许可全文",+ /**+ * The theme half of the credits page: what the app ships, and what the library it reads from+ * offers. Static words — the page cannot depend on the library being reachable.+ */+ creditsThemeLibrary: "主题",+ creditsThemeLibraryInfo:+ "应用自带三套主题(通用、白领、极客),随 Adelie 一起提供。外观页「主题库」里的四套——赛博朋克、手绘涂鸦、陶光、拟物化——由 lmliheng 维护,按需取用。七套都是 Apache-2.0,与 Adelie 同一个许可;一份主题只含颜色与尺寸这类取值,不含代码。",/** Settings › Server › Agent API: the admin's switch over every Agent's public API, and the question before it goes off. */agentApiTitle: "Agent API",agentApiToggle: "允许 Agent API",diff --git a/packages/web/test/credits-section.test.ts b/packages/web/test/credits-section.test.tsnew file mode 100644index 00000000..a6dabb66--- /dev/null+++ b/packages/web/test/credits-section.test.ts@@ -0,0 +1,38 @@+/**+ * The credits page: the bundled fonts and their licences, and then the themes — the three the app+ * ships and the four the theme library offers.+ *+ * The theme block is static words rather than a fetch (the library is a directory this app reads+ * on demand, and this page has to be readable without it), so what is pinned here is the statement+ * itself: the licence, who maintains the library, the project link, and the four themes the+ * licence covers.+ */+import { describe, expect, it } from "vitest";+import { createElement } from "react";+import { renderToStaticMarkup } from "react-dom/server";+import { FONT_CREDITS } from "@adelie/ui/fonts-credits";+import { CreditsSection } from "../src/features/settings/credits-section";+import { zh } from "../src/lib/strings";++const html = renderToStaticMarkup(createElement(CreditsSection));++describe("CreditsSection", () => {+ it("lists every bundled font, under the licence it ships with", () => {+ for (const font of FONT_CREDITS) {+ expect(html).toContain(font.family);+ expect(html).toContain(font.licenseTitle);+ }+ });++ it("credits the themes with their licence, their author and their project", () => {+ expect(html).toContain(zh.settings.creditsThemeLibrary);+ expect(html).toContain("Apache-2.0");+ expect(html).toContain("lmliheng");+ expect(html).toContain('href="https://github.com/lmliheng/adelie-themes"');+ // Both halves of what the licence covers are named: the three the app ships, and the four the+ // library holds — a reader can tell what the sentence is about without leaving the page.+ for (const name of ["通用", "白领", "极客", "赛博朋克", "手绘涂鸦", "陶光", "拟物化"]) {+ expect(html, name).toContain(name);+ }+ });+});