fix(patchesAppliedIndication): defer findBoxComponent lookup to PATCH 3#713
fix(patchesAppliedIndication): defer findBoxComponent lookup to PATCH 3#713risenowrise wants to merge 1 commit intoPiebald-AI:mainfrom
Conversation
PATCHES 1 (--version string) and 2 (banner +tweakcc tag) don't use the
Box component — only the (now-active) PATCH 3 patches-applied list does.
Looking it up unconditionally upfront aborts the whole patch when Box
can't be located (e.g. CC 2.1.126, where the Box function destructures
{children,ref,tabIndex,autoFocus,onClick,...} and none of the four
findBoxComponent strategies match).
Move the lookup inside the showPatchesApplied branch and skip just
PATCH 3 with a clear log line if Box isn't found, instead of failing
the entire indicator. This restores the version output tweak and
header banner indicator on CC versions where Box detection lags.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe function Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
Problem
writePatchesAppliedIndicationlooks upfindBoxComponentunconditionally near the top, then aborts the entire indicator if Box isn't found. But only PATCH 3 (the patches-applied list block) actually uses the Box component — PATCH 1 (--versionstring) and PATCH 2 (header banner+ tweakcc v…tag) don't reference it at all.This bites on CC 2.1.126, where the Box function is now:
None of
findBoxComponent's four strategies match this shape (Method 2 expectsflexWrapas the second destructured key; Method 4 expects a single-argfunction NAME(A){let q=memo(N)…}). Result: the whole patch fails withfailed to find Box componentand CC users on 2.1.126 lose both the version-output tweak and the header banner indicator that don't depend on Box at all.Fix
Move the
findBoxComponentcall inside theif (showPatchesApplied)branch andreturn content(preserving PATCH 1 + PATCH 2) when Box can't be located, instead of returningnulland discarding everything. PATCH 3 is the one feature that genuinely needs Box detection — it should be the only one that gets skipped when detection lags.Verified on
CC 2.1.126 — both
--versionoutput and TUI header banner now show the tweakcc tag (PATCH 1 + PATCH 2 active). PATCH 3 logsPATCH 3 skipped (Box component not located on this CC version)and continues. OncefindBoxComponentis updated for 2.1.126's Box shape, PATCH 3 will start applying again with no further changes here.Note
This is a minimal, targeted fix — it doesn't try to fix
findBoxComponentitself for 2.1.126. That's a separate change.Authored with help from Claude Opus 4.7 (claude-opus-4-7) via Claude Code.
Summary by CodeRabbit