Repository navigation
fix(test): cache the motion mock per tag in the sidebar rename-offline test - #31279
Conversation
buluoray
left a comment
There was a problem hiding this comment.
🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:
Verdict: APPROVE. This turns main green again.
Main CI at 38522b7 is red on Frontend Tests (4): framerMotionMockStableTags.test.ts flags ChatSidebar.boardRenameOfflineScope.test.tsx:33, a motion Proxy getter that builds a new component on every read. That test came in with #10920 (573a192).
This PR caches one component per tag, the same Map shape the other sidebar tests use. Test-only, one file, +9/-1.
Evidence: at this head, the guard test and the rename-offline test both pass (2 files, 4 tests). I wrote the same fix independently before seeing this PR and got the same result. CI on this head is still running.
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. The PR only changes a test mock and adds or changes no user-visible control, so no screenshot is needed. [UX-REVIEWED] c679c7f Description read[DESCRIPTION-READ] 10afaa26cf71a90daaa314662ad6d8ff26a08c6b483642ac7d37e77d7bb3da27 That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. This is a test-only mock fix. It uses the same per-tag cache shape as its sibling tests and adds no new surface. [DESIGN-REVIEWED] c679c7f Description read[DESCRIPTION-READ] 815baf952eacd6647d63e3f4b87eb8c9749b7ccfcf2eafa46e7bbab721de85e5 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Problem / Motivation
Goal: Turn
Frontend Testson main green again by caching the framer-motion mock in one test file.framerMotionMockStableTags.test.tsfails on main and on every PR based on it, namingsrc/test/ChatSidebar.boardRenameOfflineScope.test.tsx:33. That file'smotionProxy getter returns a new component on every read.Why it matters
Every open PR's
Frontend Testsshard is red until this lands, so no PR on a current base can reachPR Readiness.Not a goal
framerMotionMockStableTagsscan.What changed (motivation → approach → change)
The scan requires one component per tag, because a fresh type on each read remounts the subtree on every re-render. The mock in
website/src/test/ChatSidebar.boardRenameOfflineScope.test.tsxnow caches one component per tag in aMap, the same shapeChatSidebar.laneScrollMemory.test.tsxandChatSidebar.refactor.touchRowMenu.test.tsxuse.Backwards compatibility
Compatible: test-only change.
Removes nothing: only the mock's getter body changes.
Tests
Proof: not provable -- test-only change
framerMotionMockStableTags.test.tsfails on a cleanorigin/mainworktree and passes with this change.--sequence.shuffle(seeds 1-3).tsc -p tsconfig.app.jsonpass.Manual verification
N/A — unit coverage sufficient: the change is inside one test's mock.
Related Issues
Closes #31278
Sibling sweep
Swept: the
framerMotionMockStableTagsscan itself walks every file underwebsite/src; on main it names only this file.Siblings: none -- the scan reports exactly one uncached motion Proxy on main.
Pattern harvest
Not generalizable: the class already has its rule, the
framerMotionMockStableTagsscan, which caught this one.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)