fix(web): stabilize Message Growth animation and fit chips on one line#451
Open
ZhiyuanSun wants to merge 1 commit into
Open
fix(web): stabilize Message Growth animation and fit chips on one line#451ZhiyuanSun wants to merge 1 commit into
ZhiyuanSun wants to merge 1 commit into
Conversation
The "Message Growth" visualization (message-flow.tsx) had three issues: 1. Flicker at len=0/1. The setInterval kept firing while the array was full, queuing multiple setCount(0) resets that snapped the counter back mid-regrowth; and index-keyed chips inside AnimatePresence collided with still-exiting nodes on reset, leaving stuck invisible chips (len=1 rendered 8 chips at opacity 0). Replaced with a single self-scheduling setTimeout chain and removed AnimatePresence/exit so chips unmount cleanly on reset. 2. Horizontal scrollbar at len=8. Switched overflow-x-auto to flex-wrap and tightened chip padding/gap (px-2.5->px-2, gap-1.5->gap-1) so all 8 chips fit on one line within the existing column width. 3. Inconsistent entrance animation. Dropped the width:0->auto slide in favor of a unified scale+opacity zoom with layout for smooth reflow. Refs shareAI-lab#450
781e2db to
09a04e8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #450.
Fixes three issues in the "Message Growth" visualization (
web/src/components/architecture/message-flow.tsx). One component; no chaptercode.py/README touched.len=0/1). ThesetIntervalqueued duplicate resets that snappedcountback mid-regrowth, and index-keyed chips inAnimatePresencegot stuck (invisible) on reset. Fixed with a single self-schedulingsetTimeoutand by removingAnimatePresence/exit.len=8).overflow-x-auto→flex-wrap, plus tighter chips (px-2.5→px-2,gap-1.5→gap-1); all 8 now fit one line at the same width as the code block above.width:0→auto; chips now zoom in viascale+opacitywithlayout.Verified in-browser (chip count tracks
len, one line, no scroll);tsc --noEmitpasses.Disclosure: implemented with AI assistance (Claude Code); reviewed and verified.