fix(ui): 初始背景跟随外观 + 修复跟随系统

- app.config 移除写死的浅色背景,交给 theme.json 按系统外观选择首帧底色
- 跟随系统模式增加 setInterval 轮询兜底,onThemeChange 不回调时也能跟上切换
This commit is contained in:
2026-08-18 23:42:01 +08:00
parent fd58135fdb
commit d72e297eb6
6 changed files with 38 additions and 13 deletions
+13
View File
@@ -42,3 +42,16 @@ test('app sets page background before first render without a blinking full fade'
assert.match(appSource, /componentWillMount/)
assert.doesNotMatch(appCss, /animation:\s*page-fade-in/)
})
test('delegates initial background to themeLocation instead of hardcoding light', () => {
const config = read('src/app.config.ts')
assert.match(config, /themeLocation:\s*'theme\.json'/)
assert.doesNotMatch(config, /navigationBarBackgroundColor:\s*'#faf7f2'/)
assert.doesNotMatch(config, /backgroundColorTop:\s*'#faf7f2'/)
})
test('polls the system theme while following the system', () => {
const ctx = read('src/context/ThemeContext.tsx')
assert.match(ctx, /setInterval/)
assert.match(ctx, /getAppBaseInfo\(\)/)
})