From aa3c0c6696e97b4ef94a74abe1e5e143a26f0f21 Mon Sep 17 00:00:00 2001 From: skyhua0224 Date: Wed, 25 Nov 2026 02:09:56 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(ui):=20=E8=96=87=E8=96=87=E4=B8=8E?= =?UTF-8?q?=E5=A3=81=E7=BA=B8=E6=94=B9=E4=B8=BA=E6=98=BE=E5=BC=8F=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=B9=B6=E6=B3=A8=E5=86=8C=EF=BC=8C=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E5=90=8D=E7=94=B1=20Panel=20=E4=BC=A0=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit foundation-ui 不再自带薇薇和壁纸,桌面窗口与安装页在挂载前调用 registerViviAssets() 注册;菜单、工具栏、固定窗口、延迟时钟、启动画面、工具窗口和主页不导入这些图。 **产品名** - 新增 PRODUCT_NAME,传给标题栏与更多面板里的品牌行、侧栏场景、诊断页和体检页,界面文字与诊断包说明不变。 **验证** - 新增 brandAssets 测试,覆盖注册位置、不该导入的入口和产品名的传递。 --- src/renderer/brandAssets.test.js | 23 +++++++++++++++++++ src/renderer/components/SidebarMenu.vue | 7 +++--- .../components/m3e/DiagnosticsPage.vue | 2 ++ src/renderer/components/m3e/DoctorPage.vue | 2 ++ src/renderer/config/brand.js | 2 ++ src/renderer/desktop/main.js | 2 ++ src/renderer/installer/main.js | 2 ++ 7 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 src/renderer/brandAssets.test.js create mode 100644 src/renderer/config/brand.js diff --git a/src/renderer/brandAssets.test.js b/src/renderer/brandAssets.test.js new file mode 100644 index 00000000..8bce091b --- /dev/null +++ b/src/renderer/brandAssets.test.js @@ -0,0 +1,23 @@ +import test from 'node:test' +import assert from 'node:assert/strict' +import { readFileSync } from 'node:fs' + +// foundation-ui draws no picture of 薇薇 and has no wallpaper of hers until a product registers them: the windows that show her do it, the others carry none of her files +const read = (path) => readFileSync(new URL(path, import.meta.url), 'utf8') +const registers = (path) => /import \{ registerViviAssets \} from 'foundation-ui\/brand-assets'/.test(read(path)) && /^registerViviAssets\(\)$/m.test(read(path)) + +test('the desktop window and the installer page register 薇薇 and her wallpapers before they mount', () => { + for (const main of ['desktop/main.js', 'installer/main.js']) assert.ok(registers(main), main) + assert.ok(read('desktop/main.js').indexOf('registerViviAssets()') < read('desktop/main.js').indexOf('createApp(App)')) +}) + +test('the small windows (menu, toolbar, pin, latency clock, launch splash, tool window, home) do not import the art', () => { + for (const main of ['ctxmenu', 'toolbar', 'pin', 'latency-clock', 'launch-splash', 'tool-window', 'home']) assert.doesNotMatch(read(`${main}/main.js`), /brand-assets/, main) +}) + +test('the components that show the product name get it from the panel', () => { + assert.match(read('config/brand.js'), /PRODUCT_NAME = 'Foundation Sunshine'/) + assert.match(read('components/SidebarMenu.vue'), / - + @@ -15,7 +15,7 @@
- +