Repository navigation
feat(ui): 薇薇与壁纸改为显式导入并注册,产品名由 Panel 传入 #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
skyhua0224
merged 3 commits into
AlkaidLab:main
from
skyhua0224:feat/brand-assets-registration
Nov 25, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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'), /<MBrand class="panel-caption__brand" :name="PRODUCT_NAME"/) | ||
| assert.match(read('components/SidebarMenu.vue'), /<MScene [^\n]*:brand-name="PRODUCT_NAME"/) | ||
| for (const page of ['DiagnosticsPage', 'DoctorPage']) assert.match(read(`components/m3e/${page}.vue`), /:product="PRODUCT_NAME"/) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| // The product's name, passed to the components of foundation-ui that show it (they carry no default of their own). | ||
| export const PRODUCT_NAME = 'Foundation Sunshine' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,13 @@ | ||
| import '../../../src-tauri/inject-traces.js' // no trace of a browser: drag ghosts, browser keys and menus, zoom, selected chrome | ||
| import { createApp } from 'vue' | ||
| import 'foundation-ui/all.css' | ||
| import { registerViviAssets } from 'foundation-ui/brand-assets' // 薇薇 and her wallpapers: the library draws none until a product registers them | ||
| import '../styles/global.less' | ||
| import './desktop.less' | ||
| import App from './DesktopApp.vue' | ||
| import { i18nReady } from './i18n/index.js' | ||
|
|
||
| registerViviAssets() | ||
| const app = createApp(App) | ||
| i18nReady.then(() => app.mount('#app')) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.