Repository navigation
fix(tabs): keep the tab strip under the type-checker's limit - #111
Shepdesign wants to merge 5 commits into
Conversation
Release-Direct and the UI-test build both failed on 0877a33 with Sources/Bench/TabStrip.swift:120:25: error: the compiler is unable to type-check this expression in reasonable time and three companion errors blaming symbols that exist and always did: `held` (ShellRows.swift:105), `shownTab` (:243) and `order` (TabStrip.swift:107). Those are what a type-check timeout looks like from the outside - it gives up and reports the symbols it never got to as missing, in whichever files shared the frontend command. The expression is strip(for:)'s ScrollViewReader: reader, scroll view, HStack, ForEach, the chip call and its modifiers, with each chip's width chosen by an inline `index <` test and two state lookups in the same breath. It compiled on the commit before this one, so it was sitting on the limit and tipped over on two runners at once. ChipPlan settles each chip's part as plain code before the view builder, and the two `.animation(value:)` reads are hoisted the same way. Nothing about what is drawn changes: the plan's id is still the tab's, so ForEach matches chips to tabs across a reorder exactly as before, and every argument reaching `chip(for:in:order:width:isFront:growIn:)` is the value it had. This is not the UI test fix (PR #110); that one is test-only and waits on this, because nothing can go green until the app compiles on every runner. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sz4R7gro65BtZ2JyqWVwvZ
…gainst Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sz4R7gro65BtZ2JyqWVwvZ
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Hoisting the per-chip arguments into ChipPlan was not enough: the next build gave up on the chip(...) call itself, at TabStrip.swift:148. The expression was never really the arguments - it was the whole 65-line ScrollViewReader, one expression with twenty-odd chained modifiers, two conditional overlays, an onAppear and four onChange closures. So it is split into pieces that type-check on their own: - plannedChip(_:in:order:) - one chip with its id and transition, so the ForEach closure holds a single call. - chipRow(_:in:order:tabIds:frontId:) - the HStack and the two animations. - chipScroll(...) - the ScrollView, its clipped edges, its width and the group VoiceOver enters as "<jar> tabs". - scroll(_:to:) - bring a tab into view, animated unless Reduce Motion is on. The reader's modifiers spelled this out twice, which is the kind of weight that stacked up in there. The reader keeps only what needs its proxy: onAppear and four onChange. Still nothing drawn changes. Every modifier is in the same order on the same view, every argument is the value it was, and onChange(of:) now reads the `tabIds` local instead of recomputing tabs.map(\.id) - the same array, already needed for the animation. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sz4R7gro65BtZ2JyqWVwvZ
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sz4R7gro65BtZ2JyqWVwvZ
Two attempts at this have been guesses, because the error never names the expression that is actually too big. It names whatever OTHER files shared the compile: `held` and `shownTab` in ShellRows.swift and `order` in TabStrip.swift, all three of which exist and are in scope. Attempt 2 removed the "unable to type-check" message and left those same three behind, which means the solver is still giving up somewhere and the diagnostic is pointing at the wreckage rather than the cause. So stop guessing and measure. The Build job now passes -Xfrontend -warn-long-expression-type-checking=300 -Xfrontend -warn-long-function-bodies=300 and prints every expression and body the type-checker spent over 300ms on, with its file and line, for the whole app rather than this one view. Both flags only warn; the step still fails on the build's own verdict, read from the log because the pipe drops xcodebuild's status. -quiet had to go with it, or the warnings go the way the UI test's assertions did. This is a diagnostic, not the fix, and it comes back out before merge. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sz4R7gro65BtZ2JyqWVwvZ
|
Closing this: the diagnosis behind it was wrong, and #109 has the real fix, green. What I got wrong. I claimed
So this PR's The → #109 is the fix. It repairs the build in five lines of app code, fixes the UI test's launch arguments, and fixes a fixture bug I hadn't reached yet: a Pantry always seeds Generated by Claude Code |
What
Two jobs on #110 —
Build Direct(Release-Direct,-O) andUI tests(Debug-AppStore) — failed to compile with:plus three companion errors blaming symbols that exist and always did:
heldShellRows.swift:105shownTabShellRows.swift:243orderTabStrip.swift:107That is what a type-check timeout looks like from outside: the compiler gives up and reports the symbols it never reached as missing, across whichever files shared the frontend command. Chasing
ShellRows.swiftwould have been chasing nothing.The expression is
strip(for:)'sScrollViewReader— reader, scroll view,HStack,ForEach, the chip call and its modifiers — with each chip's width chosen by an inlineindex <test and two state lookups in the same breath. It compiled on the commit before, so it was sitting right on the limit and tipped over on two runners at once.ChipPlansettles each chip's part as plain code before the view builder, and the two.animation(value:)reads are hoisted the same way.Nothing drawn changes
ChipPlan.idistab.id, soForEachmatches chips to tabs across a reorder exactly as it did when it readtab.iddirectly.chip(for:in:order:width:isFront:growIn:)is the same value, computed by the same expression, one step earlier..animation(motion, value: tabIds)reads the sametabs.map(\.id), once.Demo
Launch the app and open two or more tabs in a jar. The strip behaves as before: the front tab keeps its lip and its wider ideal width, tabs animate on reorder, dragging one onto another still shows the drop mark, and ⌃Tab cycles. Under Reduce Motion the grow-in stays off. The real demo is CI: the app compiles on every runner, not three out of four.
Rule check
None touched. No models, no storage, no network, no intelligence. Non-negotiable 6 is untouched — nothing here changes per-jar profiles.
Brand check
Manifest §10 (the title strip and its tabs) — no visual change. The one drip the strip takes part in, the jar fill, is in
JarFill, not here. No tokens, no colors, no measures moved;NRShellis untouched.Why it's its own PR
#110 is test-only and does not cause this. But nothing can go green until the app compiles on every runner, so #110 waits on this one.
Generated by Claude Code