Skip to content

fix(tabs): keep the tab strip under the type-checker's limit - #111

Closed
Shepdesign wants to merge 5 commits into
mainfrom
claude/tabstrip-typecheck
Closed

Shepdesign wants to merge 5 commits into
mainfrom
claude/tabstrip-typecheck

Conversation

@Shepdesign

Copy link
Copy Markdown
Member

What

Two jobs on #110 — Build Direct (Release-Direct, -O) and UI tests (Debug-AppStore) — failed to compile with:

Sources/Bench/TabStrip.swift:120:25: error: the compiler is unable to
type-check this expression in reasonable time

plus three companion errors blaming symbols that exist and always did:

Reported missing Actually declared
held ShellRows.swift:105
shownTab ShellRows.swift:243
order TabStrip.swift:107

That 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.swift would have been chasing nothing.

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, so it was sitting right 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 drawn changes

  • ChipPlan.id is tab.id, so ForEach matches chips to tabs across a reorder exactly as it did when it read tab.id directly.
  • Every argument reaching 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 same tabs.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; NRShell is 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

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
@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
zest Ready Ready Preview Nov 21, 2026 9:26am UTC

Request Review

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

Copy link
Copy Markdown
Member Author

Closing this: the diagnosis behind it was wrong, and #109 has the real fix, green.

What I got wrong. I claimed held, shownTab and order "exist and always did", and treated the type-check timeout as the cause. Both halves were mistakes:

So this PR's ChipPlan split, and the -warn-long-* diagnostic added to ci.yml, were aimed at a problem that was never there. None of it is needed, and keeping it would conflict with #109 for no benefit.

The ⚠️ trap this branch added to docs/subsystems/workbench-shell.md asserts the same wrong story, and it dies with the branch rather than reaching main — which is the one thing I'm glad about.

→ #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 Read Later and Reference, so the fixture's own jars are the Shelf's third and fourth, and ⌘2 was selecting Reference rather than Meridian.


Generated by Claude Code

@Shepdesign Shepdesign closed this Nov 21, 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.

2 participants