From caec3de01154210bc8acf95e50d69aa98f94dfbb Mon Sep 17 00:00:00 2001 From: Zakk Date: Tue, 29 Sep 2026 21:34:17 +1000 Subject: [PATCH] feat(palette): call the China palette's light and dark modes day and night shift --- src/i18n/locales/en.json | 4 +++- src/i18n/locales/zh-CN.json | 4 +++- src/i18n/locales/zh-TW.json | 4 +++- src/shell/palettes.test.tsx | 4 ++++ src/shell/palettes.ts | 4 +++- src/ui/styles/palettes/qiangguo.css | 4 ++-- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 3a16ca43..b0a4e1ba 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -1183,8 +1183,10 @@ "palette.nordVariants": "Snow Storm / Polar Night", "palette.qiangguo": "China", "palette.qiangguoBad": "Severe test", + "palette.qiangguoDark": "Night shift", "palette.qiangguoGood": "Improving", - "palette.qiangguoModes": "Clock-in / All-nighter", + "palette.qiangguoLight": "Day shift", + "palette.qiangguoModes": "Day shift / Night shift", "palette.rosePine": "Rosé Pine", "palette.semi": "Semi Design", "policy.actionFailed": "Could not complete the action on {name}: {error}", diff --git a/src/i18n/locales/zh-CN.json b/src/i18n/locales/zh-CN.json index e748a9bb..5c5fc7d2 100644 --- a/src/i18n/locales/zh-CN.json +++ b/src/i18n/locales/zh-CN.json @@ -1012,8 +1012,10 @@ "palette.nordVariants": "Snow Storm / Polar Night", "palette.qiangguo": "中国", "palette.qiangguoBad": "严峻挑战", + "palette.qiangguoDark": "夜班", "palette.qiangguoGood": "稳中向好", - "palette.qiangguoModes": "打卡版/通宵版", + "palette.qiangguoLight": "白班", + "palette.qiangguoModes": "白班/夜班", "palette.rosePine": "Rosé Pine", "palette.semi": "Semi Design", "policy.actionFailed": "无法完成 {name} 的操作:{error}", diff --git a/src/i18n/locales/zh-TW.json b/src/i18n/locales/zh-TW.json index 68c9a4b8..86180dea 100644 --- a/src/i18n/locales/zh-TW.json +++ b/src/i18n/locales/zh-TW.json @@ -1012,8 +1012,10 @@ "palette.nordVariants": "Snow Storm / Polar Night", "palette.qiangguo": "中國", "palette.qiangguoBad": "嚴峻挑戰", + "palette.qiangguoDark": "夜班", "palette.qiangguoGood": "穩中向好", - "palette.qiangguoModes": "打卡版/通宵版", + "palette.qiangguoLight": "白班", + "palette.qiangguoModes": "白班/夜班", "palette.rosePine": "Rosé Pine", "palette.semi": "Semi Design", "policy.actionFailed": "無法完成 {name} 的操作:{error}", diff --git a/src/shell/palettes.test.tsx b/src/shell/palettes.test.tsx index c5c027f7..2e022a07 100644 --- a/src/shell/palettes.test.tsx +++ b/src/shell/palettes.test.tsx @@ -21,6 +21,10 @@ it('reads the China palette words for its statuses and the catalogue words under expect(render('zh-TW', 'qiangguo/qiangguo', 'act.good')).toBe(translate('zh-TW', 'palette.qiangguoGood')); expect(render('zh-CN', 'qiangguo/qiangguo', 'lifecycle.degraded')).toBe(translate('zh-CN', 'palette.qiangguoBad')); expect(render('en', 'qiangguo/qiangguo', 'lifecycle.failed')).toBe('Failed'); + expect(render('en', 'qiangguo/qiangguo', 'theme.light')).toBe('Day shift'); + expect(render('en', 'qiangguo/qiangguo', 'theme.dark')).toBe('Night shift'); + expect(render('zh-TW', 'qiangguo/qiangguo', 'theme.dark')).toBe(translate('zh-TW', 'palette.qiangguoDark')); + expect(render('en', DEFAULT_PALETTE, 'theme.light')).toBe('Light'); expect(render('en', DEFAULT_PALETTE, 'lifecycle.running')).toBe('Running'); expect(render('en', DEFAULT_PALETTE, 'act.unavailable')).toBe('Unavailable'); expect(render('zh-TW', DEFAULT_PALETTE, 'act.good')).toBe(translate('zh-TW', 'act.good')); diff --git a/src/shell/palettes.ts b/src/shell/palettes.ts index 3544c5e4..18b16fd7 100644 --- a/src/shell/palettes.ts +++ b/src/shell/palettes.ts @@ -27,7 +27,9 @@ export const palettes = [ 'act.good': 'palette.qiangguoGood', 'lifecycle.running': 'palette.qiangguoGood', 'act.unavailable': 'palette.qiangguoBad', - 'lifecycle.degraded': 'palette.qiangguoBad' + 'lifecycle.degraded': 'palette.qiangguoBad', + 'theme.light': 'palette.qiangguoLight', + 'theme.dark': 'palette.qiangguoDark' } } ] as const satisfies ReadonlyArray<{id: `${string}/${string}`; group: Key; label: Key; desc: Key; words?: Rewording}>; diff --git a/src/ui/styles/palettes/qiangguo.css b/src/ui/styles/palettes/qiangguo.css index e2eeb52a..e26c5c3b 100644 --- a/src/ui/styles/palettes/qiangguo.css +++ b/src/ui/styles/palettes/qiangguo.css @@ -1,7 +1,7 @@ /* A parody palette with no upstream, so the official-values rule does not apply. - Clock-in (light) follows a patriotic proxy app: a flag-red hero at the top of the page fading into pale rice paper, + Day shift (light) follows a patriotic proxy app: a flag-red hero at the top of the page fading into pale rice paper, and white cards with a landmark faint in a corner: the Great Wall, Mount Tai, the Three Gorges or Sun Moon Lake. - All-nighter (dark) is a red and gold poster after midnight, with the same hero at night. */ + Night shift (dark) is a red and gold poster after midnight, with the same hero at night. */ :root[data-family='qiangguo'] { --rp-base: #fffaf6; --rp-surface: #f8ebe5;