Skip to content

refactor(ui): extract shared kinetic copy - #302

Open
huyanxius wants to merge 2 commits into
1024XEngineer:mainfrom
huyanxius:refactor/301-shared-kinetic-copy
Open

refactor(ui): extract shared kinetic copy#302
huyanxius wants to merge 2 commits into
1024XEngineer:mainfrom
huyanxius:refactor/301-shared-kinetic-copy

Conversation

@huyanxius

Copy link
Copy Markdown
Collaborator

将登录与注册首步的整句字幕动画从账号面板抽到 shared/ui,账号面板改为复用公共实现,现有文案、时序和视觉行为保持不变。

Why

原实现把可复用的整句字幕渲染与 CSS 留在 feature 内,其他入口无法在不复制代码的前提下使用同一动效。

Changes

  • 抽取 KineticCopy、phase 类型与对应 CSS 到共享 UI。
  • 账号面板移除本地重复实现并消费共享组件。
  • 增加共享组件 phase 与 DOM 契约测试。

Implementation

  • 保留现有 auth-copy-* class、动画时长、缓动和索引变量,账号面板自身继续管理轮播计时。
  • 未加入 Quick Start 的前缀、逐字、消息替换或循环起点能力。

Verification

  • npm test --prefix frontend -- src/shared/ui/kinetic-copy.test.tsx src/features/account-panel/index.test.tsx --configLoader runner:2 files / 24 tests passed
  • npm run typecheck --prefix frontend:passed
  • git diff --check:passed

Scope

  • 本 PR 不包含:Quick Start 页面改动或业务逻辑改动。
  • 后续事项:Quick Start 将基于本分支叠加自己的逐字动画层。

Related Issues

Closes #301

The account panel owned a reusable line transition inside the feature.

Move the existing renderer and styles into shared UI and keep account timing intact.

Other product surfaces can now consume the same line-level motion boundary.
The extracted transition needs direct coverage outside the account panel.

Assert both lines, phase classes, accessibility state, and timing indexes.

The shared animation contract can now change without silent markup drift.
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
windup Ready Ready Preview Aug 13, 2026 5:00pm

@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fennoai fennoai Bot 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.

Found one behavior issue that prevents the extracted component from working reliably as shared UI outside the account panel. git diff --check passed; local Vitest/typecheck/lint execution was unavailable because the mounted node_modules/.bin commands are not executable.

View job run

opacity: 0;
letter-spacing: 0.075em;
transform: translate3d(0, 120%, 0);
animation: auth-copy-line-enter 620ms var(--auth-ease-enter) forwards;

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.

The extracted shared component still depends on --auth-ease-enter, but that custom property is defined only on .auth-screen in account-panel.css. For any other consumer (including the planned Quick Start reuse), the unresolved var() invalidates the entire animation declaration, leaving the entering lines at opacity: 0 and translateY(120%) until the caller changes phase. Please define a fallback here (for example var(--auth-ease-enter, cubic-bezier(...))) or move the easing token into shared scope so KineticCopy works independently of the account-panel ancestor.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(ui): 抽取公共整句字幕动画

1 participant