Skip to content

fix(desktop): 锁定 Splash 品牌布局避免启动瞬间缩小 - #3584

Merged
MagicLizi merged 11 commits into
mainfrom
dash/fix-splash-brand-layout
Sep 1, 2026
Merged

fix(desktop): 锁定 Splash 品牌布局避免启动瞬间缩小#3584
MagicLizi merged 11 commits into
mainfrom
dash/fix-splash-brand-layout

Conversation

@dashhuang

@dashhuang dashhuang commented Aug 28, 2026

Copy link
Copy Markdown
Member

这次改了什么

摘要

修复 Desktop 启动交接时品牌图在淡出瞬间缩小的问题。Splash 淡出期间保持当前构图,只有 Splash 实际可卸载后才上报退场完成并切换到登录布局;未登录短窗口的这次几何切换按既有 shift 时序(650ms / 对应 easing)做一次平滑 transform 过渡,普通 resize 不挂常驻 transition;已登录路径没有登录面板,因此不再使用登录面板的 124px 底部预留。已登录品牌层的卸载计时与 --splash-fade-duration 的 400ms 实际淡出时长对齐,避免淡出后额外留下纯色遮罩。

变更类型

  • fix 缺陷修复
  • refactor / perf 重构或性能优化
  • docs / test / chore 文档、测试或工程维护

范围

  • 关联 Issue / 需求:无
  • 本 PR 包含:Desktop Splash / Login 品牌布局、交接状态机和比例回归测试
  • 明确不包含:服务端、Mobile、登录协议和持久化数据
  • 用户可见变化:启动淡出期间 Cindy 立绘、字标和 Slogan 保持稳定,不再短暂缩小或露出灰色背景;Splash 卸载后的登录避让切换平滑,不再突然缩小跳变;已登录启动不再错误套用登录面板避让;品牌内容淡出完成后立即交接主界面
  • 是否存在 breaking change:无

UI 变化

  • 引用的设计规范:docs/design-rules/DESIGN.md §10(Light / Dark 双模式交付门槛);§14.4(功能性动效与 reduced-motion 约束);§16.2(登录链路设计规则与品牌画布几何);§16.3(LoginPanel / Splash 共用面板但保持独立高度)。
  • 保持现有语义颜色与双模式资产;仅调整 Splash 与登录交接阶段的布局锁定、底部预留、一次性几何过渡和淡出分层,并将品牌层卸载与既有 Splash 淡出 token 对齐。

怎么验证的

自动验证

pnpm --filter desktop exec vitest run src/renderer/components/splash/__tests__/SplashScreen.test.tsx src/renderer/components/login/__tests__/loginScale.test.ts src/renderer/contexts/__tests__/LoginHandoffContext.test.tsx
结果:3 个文件、60 个测试通过;LoginHandoff 回归同时校验 400ms token 对齐、399/400ms 卸载边界、一次性品牌 transform 过渡和 reduced-motion 无过渡

pnpm test:unit:related
结果:apps/desktop unit 通过

pnpm --filter desktop run --if-present typecheck
结果:通过

pnpm exec prettier --check apps/desktop/src/renderer/components/login/LoginBrandStage.tsx apps/desktop/src/renderer/components/login/__tests__/loginScale.test.ts apps/desktop/src/renderer/components/login/loginScale.ts apps/desktop/src/renderer/components/splash/SplashScreen.tsx apps/desktop/src/renderer/components/splash/__tests__/SplashScreen.test.tsx apps/desktop/src/renderer/contexts/LoginHandoffContext.tsx apps/desktop/src/renderer/contexts/__tests__/LoginHandoffContext.test.tsx
结果:通过

pnpm check:dco
结果:通过

手工验证

macOS Global 开发版从本 worktree 启动并通过 DESKTOP_DEV_VERDICT=ready;用户已确认启动画面比例正常。当前实例 root 为 /Users/dash/Code/Cindy/cindy-fix-splash-brand-layout

未执行的验证

完整 run-unit-gate.sh 已执行;apps/desktop unit 通过(136.3s),但 packages/maker-core 的 PI 集成测试有 2 项失败(1 项 60 秒超时、1 项临时配置目录数量断言)。该包未被本 PR 修改,失败与本次 Desktop UI 改动无文件交集,详见 gate 日志。

风险

风险分类

  • 无已知风险
  • SQLite / migration
  • system prompt
  • 协议兼容
  • 权限 / 安全 / 用户数据
  • 存量插件兼容(批准状态 / 指纹 / manifest 校验 / 安装布局 / 包格式)
  • 原生层 / fingerprint / OTA
  • 跨平台差异

影响与回滚

  • 影响范围:Desktop 启动 Splash → 登录 / 主界面的品牌层交接和相关比例计算。
  • 回滚 / 降级方式:回滚本 PR 的五个提交(60206e09930654b240f07b37302784d4a2c2f64ab3189)即可恢复原实现;不涉及数据迁移或持久化格式。

提交前检查

  • 已 review 完整 diff
  • 每个 commit 都带 DCO 签名(git commit -s,见 DCO
  • UI 改动已在「UI 变化」注明引用的设计规范章节
  • 未提交凭证、令牌或授权文件
  • 已补充必要文档
  • 已确认测试结果或说明未执行原因

@dashhuang
dashhuang requested a review from a team as a code owner August 28, 2026 16:15
@greptile-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown

Greptile Summary

修复 Desktop Splash 退场时品牌构图缩小和透明背景透出的问题,并将 Splash 与登录布局的切换延后到退场完成。

  • 为品牌交接状态增加独立的 Splash 完成信号和布局模式
  • 将淡出动画限制在品牌内容层,使背景保持不透明
  • 新增 Splash 专用缩放计算,并调整短窗口下品牌与登录面板的避让方式
  • 补充布局比例和交接时序测试

Confidence Score: 4/5

合并前应修正短窗口覆盖边界,避免登录面板遮住 Cindy 字标底部。

新增的 64px 覆盖量作用于包含字标的整个品牌块,而面板层级更高;在短窗口登录路径中,这会把仅距块底 18 个设计单位的字标压到面板下。

Files Needing Attention: apps/desktop/src/renderer/components/login/loginScale.ts;apps/desktop/src/renderer/components/login/tests/loginScale.test.ts

Important Files Changed

Filename Overview
apps/desktop/src/renderer/components/login/LoginBrandStage.tsx 根据 handoff 布局选择 Splash 或登录几何,并改为只淡出品牌内容、保留不透明背景。
apps/desktop/src/renderer/components/login/loginScale.ts 新增 Splash 布局和短窗口覆盖余量,但该余量会使高层登录面板覆盖字标底部。
apps/desktop/src/renderer/components/splash/SplashScreen.tsx 在 Splash 到达 done/skipped 后单次上报退场完成,用于延后品牌布局切换。
apps/desktop/src/renderer/contexts/LoginHandoffContext.tsx 新增 splashExitCompleted 状态及 brandLayout 派生逻辑,认证品牌退场阶段继续锁定 Splash 构图。
apps/desktop/src/renderer/contexts/tests/LoginHandoffContext.test.tsx 覆盖新布局切换时序和内容层淡出,但未验证短窗口中登录面板不会遮挡字标。
apps/desktop/src/renderer/components/login/tests/loginScale.test.ts 验证允许覆盖后的立绘底边和缩放比例,但断言仅使用整体底边,遗漏了字标可见性。

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Splash 显示] --> B[Splash 开始淡出]
  B --> C[保持 Splash 品牌布局]
  C --> D[Splash 完成并卸载]
  D --> E{认证分支}
  E -- 未登录 --> F[切换登录布局并显示面板]
  E -- 已登录 --> G[品牌内容淡出]
  G --> H[卸载品牌覆盖层并显示主界面]
Loading
Prompt To Fix All With AI
### Issue 1
apps/desktop/src/renderer/components/login/loginScale.ts:135-137
**覆盖边界包含字标**

当未登录窗口高度不超过 768px 且存在底部预留时,这里允许登录面板覆盖整个品牌块底部 64px;字标距该底边仅 18 个设计单位,并且面板层级高于品牌层,因此需要用满覆盖量的短窗口会让面板遮住 Cindy 字标底部。

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "fix(desktop): lock splash brand layout d..." | Re-trigger Greptile

Comment thread apps/desktop/src/renderer/components/login/loginScale.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d776585377

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/renderer/components/login/loginScale.ts Outdated
@MagicLizi

Copy link
Copy Markdown
Contributor

@dashhuang 👋 这个 PR 还有 2 条 review conversation 没 resolve(apps/desktop/src/renderer/components/login/loginScale.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

@MagicLizi MagicLizi added status:ci-failed CI 失败(review-pr 自动维护,仅展示) touches:product-ui 改动碰到产品 / UI 面(review-pr 自动维护,仅展示) labels Aug 28, 2026
@MagicLizi

Copy link
Copy Markdown
Contributor

命中 UI 路径(apps/desktop/src/renderer/components/login/LoginBrandStage.tsx / apps/desktop/src/renderer/components/login/loginScale.ts / apps/desktop/src/renderer/components/splash/SplashScreen.tsx 等)但 description 未附界面效果证据——建议补充改动后效果:截图/录屏,或改动后界面的 HTML 页面(```html 代码块、.html 附件或在线预览链接),便于确认界面符合 DESIGN.md 设计规范

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3cef457999

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/renderer/components/splash/SplashScreen.tsx Outdated
@MagicLizi

Copy link
Copy Markdown
Contributor

@dashhuang 👋 这个 PR 还有 3 条 review conversation 没 resolve(apps/desktop/src/renderer/components/login/loginScale.ts / apps/desktop/src/renderer/components/splash/SplashScreen.tsx),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

@dashhuang

Copy link
Copy Markdown
Member Author

@codex review

@MagicLizi MagicLizi added status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) and removed status:ci-failed CI 失败(review-pr 自动维护,仅展示) labels Aug 28, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8011411f1d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/renderer/components/login/LoginBrandStage.tsx
@dashhuang

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 93381ca5a3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/renderer/components/login/LoginBrandStage.tsx
@MagicLizi

Copy link
Copy Markdown
Contributor

@dashhuang 👋 这个 PR 还有 1 条 review conversation 没 resolve(apps/desktop/src/renderer/components/login/LoginBrandStage.tsx),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

@MagicLizi MagicLizi added status:ci-failed CI 失败(review-pr 自动维护,仅展示) and removed status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) labels Aug 28, 2026
@dashhuang
dashhuang force-pushed the dash/fix-splash-brand-layout branch from 93381ca to f64ab31 Compare August 28, 2026 20:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f64ab31895

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/renderer/components/login/LoginBrandStage.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 942f3caa73

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/renderer/components/login/LoginBrandStage.tsx
Comment thread apps/desktop/src/renderer/contexts/LoginHandoffContext.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 32c0823235

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/renderer/contexts/LoginHandoffContext.tsx
@MagicLizi MagicLizi added status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) and removed status:ci-failed CI 失败(review-pr 自动维护,仅展示) labels Aug 28, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T05:06:10.669692Z 9f20c20 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 02a1ea50ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/renderer/contexts/LoginHandoffContext.tsx
@MagicLizi

Copy link
Copy Markdown
Contributor

@dashhuang 👋 这个 PR 还有 1 条 review conversation 没 resolve(apps/desktop/src/renderer/contexts/LoginHandoffContext.tsx),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

@MagicLizi MagicLizi added status:ci-failed CI 失败(review-pr 自动维护,仅展示) and removed status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) labels Aug 28, 2026
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
@dashhuang
dashhuang force-pushed the dash/fix-splash-brand-layout branch from b15900a to bf0ee44 Compare August 29, 2026 04:44

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf0ee447c8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/renderer/components/splash/SplashScreen.tsx
@MagicLizi MagicLizi added status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) and removed status:ci-failed CI 失败(review-pr 自动维护,仅展示) labels Aug 29, 2026
@MagicLizi

Copy link
Copy Markdown
Contributor

@dashhuang 👋 这个 PR 还有 1 条 review conversation 没 resolve(apps/desktop/src/renderer/components/splash/SplashScreen.tsx),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
@MagicLizi MagicLizi added status:ci-failed CI 失败(review-pr 自动维护,仅展示) and removed status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) labels Aug 29, 2026
@MagicLizi MagicLizi added status:ci-running CI 还在跑(review-pr 自动维护,仅展示) and removed status:ci-failed CI 失败(review-pr 自动维护,仅展示) labels Aug 31, 2026
MagicLizi added a commit that referenced this pull request Aug 31, 2026
codexProxyHost.test.ts 首条用例一直在替整个 SUT 模块图的 Vitest 冷
transform 买单:Linux CI 分片实测超默认 5s(#3584 两次复现),抬到 15s
后 Windows 分片又超 15s。这笔成本属于环境冷启动,不属于断言 —— 挪进
带独立 60s 超时的文件级 beforeAll,首条用例退回默认超时。

Signed-off-by: Lizi <jiali@magiclizi.com>
@MagicLizi MagicLizi removed the status:ci-running CI 还在跑(review-pr 自动维护,仅展示) label Aug 31, 2026

@MagicLizi MagicLizi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查通过:Splash 品牌几何锁定到面板入场再切登录布局,动效用 transform/opacity 与既有 420ms panel 时序,reduced-motion 走终态。

@MagicLizi MagicLizi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码重审通过:Splash 布局锁定到淡出完成再切登录构图,无 P0/P1。

@MagicLizi
MagicLizi merged commit a4d4200 into main Sep 1, 2026
24 of 26 checks passed
@MagicLizi
MagicLizi deleted the dash/fix-splash-brand-layout branch September 1, 2026 07:43
@MagicLizi

Copy link
Copy Markdown
Contributor

合了。启动那一下品牌块忽然缩小一直挺扎眼,现在淡出结束才切登录构图,冷启动看起来稳多了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

touches:product-ui 改动碰到产品 / UI 面(review-pr 自动维护,仅展示)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants