Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions web/src/lib/composerSnow.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ export function paintFrost(canvas, seed, dark, width, height) {
}
// A small crisscross of crystals fills the corner itself.
const mesh = Math.min(24, height * .3);
for (let i = 0, count = mesh * 1.3; i < count; i++) {
for (let i = 0, count = mesh * 1.8; i < count; i++) {
const angle = random() * Math.PI / 2;
const reach = 2 + random() ** 1.2 * mesh;
needle(5 + reach * Math.cos(angle), 4 + reach * Math.sin(angle),
angle + (random() - .5) * 1.4, 3 + random() * 6, .28 + .32 * (1 - reach / (mesh + 2)));
angle + (random() - .5) * 1.4, 2.5 + random() * 4.5, .18 + .26 * (1 - reach / (mesh + 2)));
}
}

Expand Down
14 changes: 13 additions & 1 deletion web/src/lib/themeHud.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ await run('themeHud.css scrollbar rules avoid the :root prefix', () => {
}
});

// The motion switch also controls the main composer's winter decoration.
// 场景:首页输入框的冬季下雪 / 霜花装饰按本地日期开关(同样受「动态效果」开关控制)。
// 期望:12 月 1 日零点起显示,一直到 1 月 1 日当天结束;11 月 30 日深夜和 1 月 2 日都不显示。
await run('composer snow starts in December and includes New Year’s Day in local time', () => {
for (const year of [2026, 2027]) {
assert.equal(isWinterHoliday(new Date(year, 10, 30, 23, 59)), false);
Expand All @@ -246,6 +247,17 @@ await run('composer snow starts in December and includes New Year’s Day in loc
}
});

// 场景:新建任务首页的输入框(hero)发出第一条消息后,会话页底部换成普通输入框。
// 期望:下雪 / 霜花只挂在 hero 输入框上;会话页底部的主输入框同样带 mainComposer,但不挂。
// 回归:之前按 mainComposer 挂载,会话页底部输入框上也会下雪、角上也有霜。
await run('composer snow is mounted only on the home hero composer', () => {
const inputBar = read('../components/InputBar.jsx');
assert.match(inputBar, /\{isHero && <SeasonalComposerEffect /);
assert.doesNotMatch(inputBar, /mainComposer && <SeasonalComposerEffect/);
});

// 场景:设置页的风格选择与动效开关。期望:只在当前主题有风格 / 声明 HUD 或冬季节日期间渲染,
// 按钮带 data-theme-variant-option 便于定位;动效层由 ThemeProvider 挂载。
await run('settings and provider wire the variant picker and motion layer', () => {
const settings = read('../components/SettingsPage.jsx');
assert.match(settings, /themeVariantOptions\.length > 0 &&/);
Expand Down
Loading