合并 master 到 AI 游戏创作分支

同步共享主题样式与对应测试
同步项目约束与决策记录
This commit is contained in:
AIGameCreator App
2026-07-14 17:50:06 +08:00
6 changed files with 621 additions and 540 deletions
+2 -534
View File
File diff suppressed because it is too large Load Diff
+30 -4
View File
@@ -7,6 +7,13 @@ function readIndexCss() {
return fs.readFileSync(path.resolve(process.cwd(), 'src/index.css'), 'utf8');
}
function readPlatformThemeCss() {
return fs.readFileSync(
path.resolve(process.cwd(), 'packages/shared/src/theme.css'),
'utf8',
);
}
function getCssBlock(source: string, selector: string) {
const selectorIndex = source.indexOf(selector);
expect(selectorIndex, `${selector} should exist in src/index.css`).toBeGreaterThanOrEqual(0);
@@ -194,11 +201,16 @@ describe('index stylesheet unread dots', () => {
it('uses warm brown tokens for draft unread markers instead of red literals', () => {
const css = readIndexCss();
const themeCss = readPlatformThemeCss();
expect(css).toContain('--platform-unread-dot-fill: #8b5a3d;');
expect(css).toContain('--platform-unread-dot-glow: rgba(139, 90, 61, 0.34);');
expect(css).toContain('--platform-unread-dot-fill: #d6a27c;');
expect(css).toContain('--platform-unread-dot-glow: rgba(214, 162, 124, 0.24);');
expect(themeCss).toContain('--platform-unread-dot-fill: #8b5a3d;');
expect(themeCss).toContain(
'--platform-unread-dot-glow: rgba(139, 90, 61, 0.34);',
);
expect(themeCss).toContain('--platform-unread-dot-fill: #d6a27c;');
expect(themeCss).toContain(
'--platform-unread-dot-glow: rgba(214, 162, 124, 0.24);',
);
for (const selector of [
'.creation-work-card__unread-dot',
@@ -213,6 +225,20 @@ describe('index stylesheet unread dots', () => {
}
});
it('keeps platform font overrides after branded title typography', () => {
const css = readIndexCss();
const themeCss = readPlatformThemeCss();
const titleRuleIndex = css.indexOf('.selection-hero-brand__title');
const platformThemeRuleIndex = css.indexOf('.platform-theme,\n.platform-theme *');
expect(titleRuleIndex).toBeGreaterThanOrEqual(0);
expect(platformThemeRuleIndex).toBeGreaterThan(titleRuleIndex);
expect(getCssBlock(css, '.platform-theme,\n.platform-theme *')).toContain(
'font-family: var(--platform-font-family) !important;',
);
expect(themeCss).not.toContain('.platform-theme,\n.platform-theme *');
});
it('keeps the creation shelf share button on a visible surface', () => {
const css = readIndexCss();
const block = getCssBlock(css, '.creation-work-card__quick-action-button');