Skip to content

fix(Lane): stacked rows were a column of orphaned values - #21

Merged
thinkclay merged 1 commit into
mainfrom
fix/lane-mobile-card
Aug 25, 2026
Merged

thinkclay merged 1 commit into
mainfrom
fix/lane-mobile-card

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

The doc comment on columns promised they "collapse to a stacked key–value list below stackBelow". They collapsed, but there were no keys — the type was ReactNode[].

What a phone actually showed

17d / IN STAGE
Jackson Cefalo
Full Stack Developer
score 0
Scaffald
—
Unassigned
Overdue — no first response yet

A wide row gets its meaning from position. Stacking destroys position, and three of those four values had nothing left saying what they were — one of them a lone em dash carrying no information at all. Only score 0 read, because that caller had written the label into the cell by hand. That workaround is what this makes unnecessary.

The change

columns now also accepts { label, value, empty? }:

  • The label renders at every width, not only when stacked. A Lane row has no column headings, so 0 Scaffald — Unassigned was ambiguous across the page too. Only the arrangement changes: inline when wide, label-left / value-right when stacked.
  • empty cells drop out of the stacked form. Wide they stay as spacers holding the grid, so they keep their placeholder and lose their label.
  • A bare ReactNode still works, for callers that bake their own label in.

Also: stacked rows lead with the title. The wide row leads with age on purpose — it's the "act on this" number and it wants the left edge — but stacked, that order put a bare 17d / IN STAGE on the left and pushed the candidate's name right, ragged and second. On a phone the row is the candidate.

Two things I got wrong on the way, both caught by looking

  1. I first hid labels on wide rows, reasoning that position implies the heading. It doesn't — there are no headings — and it silently regressed the score cell from score 0 to a bare 0. Fixed by labelling at both widths.
  2. Labelling every cell then printed Outcome followed by nothing on wide rows, because an empty cell survives there as a spacer. Fixed by never labelling an empty cell.

Both were invisible to the mobile screenshot I was iterating on and only showed up on the desktop capture.

Verification

Rendered at 390 and 1440 against real seeded applications, before and after.

390 after: Score 0 / Source Scaffald / Assignee Unassigned — labelled, and the meaningless Union dash dropped.
1440 after: Score 0 | Source Scaffald | — | Assignee Unassigned — labels back, spacer unlabelled, grid intact.

Seven tests cover the label-at-both-widths rule, drop-when-stacked, keep-when-wide, no-label-on-empty, and the unlabelled form.

🤖 Generated with Claude Code

The doc comment promised columns "collapse to a stacked key–value list below
stackBelow". They collapsed, but there were no keys — `columns` was
`ReactNode[]`, so the phone form of a pipeline row was:

    17d / IN STAGE
    Jackson Cefalo
    Full Stack Developer
    score 0
    Scaffald
    —
    Unassigned

A wide row gets its meaning from position. Stacking destroys position, and
three of those four values had nothing left saying what they were — one of
them a lone em dash carrying no information at all. Only "score 0" read,
because that caller had written the label into the cell by hand, which is
the workaround this commit makes unnecessary.

`columns` now also accepts `{ label, value, empty? }`:

  - the label renders at EVERY width, not just when stacked. A Lane row has
    no column headings, so "0  Scaffald  —  Unassigned" was ambiguous across
    the page too; only the arrangement changes, inline when wide and
    label-left/value-right when stacked.
  - `empty` cells are dropped from the stacked form. Wide they stay as
    spacers holding the grid, so they keep their placeholder and lose their
    label — labelling a spacer printed "Outcome" followed by blank, which is
    worse than the bare placeholder it replaced.
  - a bare ReactNode still works, for callers that bake their own label in.

Also: stacked rows now lead with the title. The wide row leads with age on
purpose — it is the "act on this" number and it wants the left edge — but
stacked, that same order put a bare "17d / IN STAGE" on the left and pushed
the candidate's name to the right, ragged and second. On a phone the row IS
the candidate.

Verified at 390 and 1440 against real seeded applications, both before and
after, plus seven tests covering the label-at-both-widths rule, the
drop-when-stacked rule, the keep-when-wide rule, and the unlabelled form.

Co-Authored-By: Claude Opus 5 <[email protected]>
@thinkclay
thinkclay merged commit 61ca901 into main Aug 25, 2026
@thinkclay
thinkclay deleted the fix/lane-mobile-card branch August 25, 2026 08:58
thinkclay added a commit that referenced this pull request Sep 1, 2026
…st (#27)

#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.
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.

1 participant