Repository navigation
fix(Lane): columns are ReactNode again — the union broke every row test - #27
Merged
Merged
Conversation
#21 gave `columns` a union of `ReactNode | { label, value }` so Lane could add the label itself. The app rendered correctly at both widths, and I verified it on screen — but every row-rendering test in ApplicationsLanes.test.tsx crashed: Objects are not valid as a React child (found: object with keys {label, value}) The guard returned false under vitest and true under the app. Three explanations were checked and eliminated: a stale dist (the build had the change), a stale Vite cache (cleared, no change), and `isValidElement` being the fragile clause (swapped for own-property checks, no change). Rendering Lane alone with one labelled column reproduced it, so it was not the caller. I stopped looking for the specific cause. A render path guessing what a value is has no business being load-bearing, whatever makes it disagree. So `columns` is `ReactNode[]` again and the caller composes its own cells. There is nothing to discriminate and nothing to get wrong. The tests that pinned the union now pin its absence — including one that asserts a raw descriptor still throws, so a caller that hands Lane an object by mistake fails loudly rather than silently.
thinkclay
added a commit
to Scaffald/SaaS
that referenced
this pull request
Sep 1, 2026
#644 described cells to Lane as `{ label, value }` and let Lane render the label. The app was right at both widths — verified on screen — but every row-rendering test in ApplicationsLanes.test.tsx crashed with "Objects are not valid as a React child". Lane's guard evaluated differently under vitest, and the raw descriptor reached React. That is 10 tests I merged red without noticing, because I ran the new Lane tests and not the existing ones for the screen I had changed. Scaffald/ui#27 takes the union back out. The label is composed here instead, in a small `cell()` helper that also decides what a narrow row drops — which is where the decision belonged anyway, since this screen is the only thing that knows Union and Outcome are worth hiding when empty. Behaviour is unchanged, checked against the running app: mobile Score 0 / Source Scaffald / Assignee Unassigned desktop Score 0 / Source Scaffald / Union — / Assignee Unassigned / Outcome — 17/17 across Lane.columns and ApplicationsLanes. Both packages typecheck. Submodule pointer: a720d0b..a527607
4 tasks
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.
#21 gave
columnsa union ofReactNode | { label, value }so Lane could add the label itself. The app rendered correctly at both widths and I verified it on screen — but every row-rendering test inApplicationsLanes.test.tsxcrashed:The guard returned false under vitest and true under the app.
What I checked and eliminated
distdist/index.mjs)node_modules/.vite; no changeisValidElementwas the fragile clauseObject.hasOwnchecks; no changeLanealone with one labelled column reproduces itI stopped there. A render path that guesses what a value is has no business being load-bearing, whatever makes it disagree between two environments.
The fix
columnsisReactNode[]again. The caller composes its own labelled cells — nothing to discriminate, nothing to get wrong. The doc comment says so, so the union does not come back.The tests that pinned the union now pin its absence, including one asserting a raw descriptor still throws — a caller that hands Lane an object by mistake should fail loudly, not silently.
Behaviour is unchanged
Verified against the running app after the change:
Same as #21 shipped: labelled at both widths, empties dropped on a phone and held as em dashes on a wide row so the columns line up.
17/17 tests pass across
Lane.columnsandApplicationsLanes. Both packages typecheck.🤖 Generated with Claude Code