Skip to content

feat(preview): add close animation when diff becomes empty after commit#471

Merged
ErlichLiu merged 1 commit into
mainfrom
feat-preview-close-animation
May 15, 2026
Merged

feat(preview): add close animation when diff becomes empty after commit#471
ErlichLiu merged 1 commit into
mainfrom
feat-preview-close-animation

Conversation

@ErlichLiu
Copy link
Copy Markdown
Owner

Summary

  • 预览面板关闭时(diff 提交后变空 / 手动关闭)增加 250ms 淡出+右滑动画
  • 右侧面板在关闭动画期间脱离 flex 流(absolute 定位),避免与左侧面板的 flex 过渡产生布局冲突
  • 左侧面板同时以 250ms flex 过渡平滑展开填补空间

Root cause

之前的实现中,关闭动画期间右侧面板仍以 flex-1 参与 flex 布局,与左侧 flex: 1 1 auto 互相争抢空间,导致左侧实际无法展开;等动画结束右侧 DOM 被移除后左侧才突然跳变到全宽,造成"卡顿突兀"的体感。

Changes

文件 改动
tailwind.config.js 新增 preview-slide-out keyframes(opacity 1→0 + translateX 0→16px)及 animation
MainArea.tsx 新增 closing 状态机;右侧面板在关闭时 absolute 定位脱离文档流;左侧面板 flex 过渡

Test plan

  • 在 Agent 会话中触发 git commit,观察预览面板关闭动画
  • 手动点击 X 关闭预览面板,确认动画正常
  • 快捷键关闭预览面板,确认动画正常
  • 切换 tab 时不应触发关闭动画

🤖 Generated with Claude Code

When a git commit is detected and the diff content becomes empty, the
preview panel now plays a smooth 250ms fade-out + slide animation before
being removed, instead of disappearing abruptly. The right panel is
absolute-positioned during the exit animation so the left panel can
expand without layout conflicts.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ErlichLiu ErlichLiu merged commit 910f80b into main May 15, 2026
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.

1 participant