Repository navigation
fix(admin): stack the remaining CMS tables on a phone - #1155
Conversation
Six of the seven surfaces still rendering Payload's `Table` directly now render through `StackedTable`, so under 700px each row becomes one block of named lines instead of a sideways scroll. Each surface keeps the width rules that only make sense while it is a table: the registrations' answer-column bound, the submission key's content width and shrunk Field cell, and the import's two narrow columns — a `width: 1%` cell would otherwise be a hundredth of the row once it is a block. The import results' select-all lives in the header row, which stacking hides, so the phone gets its own beside Publish and Clean Up. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXenNVUK3cfDb5fVp8
A ToggleGroup never wraps on its own. The platform choice beside the first heading already had the rule; the map-height choice inside step 3 did not, and its four segments are what the whole tab's width settled on — 466px at a 390px viewport, so every section scrolled sideways. Found while measuring the Install tab's two tables at 390px. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXenNVUK3cfDb5fVp8
The wrapper only answers the sideways scroll while nothing goes round it, and a table added next month with the bare import is green and unreadable in the way the ten converted ones were. The walk names every surface that holds one, so a reverted conversion says which. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXenNVUK3cfDb5fVp8
…ToggleGroup Two rules were being restated per surface. A `td` width belongs to the table the cell was part of, exactly as Payload's own `min-width: 150px` does, so `stackedTable.module.css` now resets `width` and `white-space` too — at a specificity that outranks a surface's own two-class rule. A width on the cell's *content* stays the surface's, scoped to the table's side of the breakpoint rather than undone below it. ToggleGroup styles its container inline with no `flex-wrap`, so no consumer can add one from a stylesheet, and every consumer carries the same overflow. The wrap goes there instead, which also covers the multi-select `group` the earlier CSS override did not. The import results' columns no longer restate a label the wrapper derives from a string heading, and the coverage spec walks the tree through `tests/utils/importGraph`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXenNVUK3cfDb5fVp8
A rule scoped to `min-width: 701px` and a wrapper that stacks at `max-width: 700px` both stand down at 700.5px, which a fractional viewport width really is. Both content widths are lifted inside the wrapper's own query instead, so one condition decides. The coverage spec keeps its own tree walk: naming `tests/utils/importGraph` adds it to the hook's selection for every edit of that module, past the width `select-unit-specs.spec.ts` caps. And the wrapper does not outrank every surface. A CSS module grouping `#heading-x` with `.cell-x` builds to `:is(…)` at the id's specificity, so `Dashboard.module.css` still needs its own stacked reset — the admin-ui rule says which case is which. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXenNVUK3cfDb5fVp8
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXenNVUK3cfDb5fVp8
|
🚅 Deployed to the SahajCloud-pr-1155 environment in sahajcloud
1 service not affected by this PR
|
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
`main` replaced ToggleGroup's sizing model: the group now fills its slot and stops at a 200px-per-choice ceiling, and each choice shares that width with a `min-content` floor, in place of the old `width: fit-content` with a 120px floor per segment. The branch's one hunk there adds the wrap. Resolved to `main`'s model plus `flexWrap: 'wrap'` on the group alone. The outer container takes `main`'s side whole: at `width: 100%` it no longer overflows, and wrapping it would drop a clearable field's clear button onto a line of its own. The branch's `maxWidth: '100%'` goes with it, since `width: 100%` already bounds both. `main`'s single-select box is `height: 40px` with `overflow: hidden`, so a wrapped row is clipped there — true of `main` today through InstallGuide's own `radiogroup` override, which this branch deletes in favour of the component's wrap. Behaviour for a single choice is unchanged either way; the multi-select group gains the wrap it never had. PR #1155 carries the question. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWnonCNPSCkcLqMqqs
sydevs-bot
left a comment
There was a problem hiding this comment.
1 question for the reviewer, one per thread.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
|
Merged
Gate green: lint, format, both typechecks, 3884 unit tests. One thread asks whether the single-select box should release its 40px height on a phone; A is built. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The diff is the size of #1151: seven surfaces named, seven converted, no new module, helper, type or dependency beyond the guard spec. Both joined changes move a rule into its shared owner rather than adding another per-surface override: the td width into the wrapper, the wrap into ToggleGroup. No contract surface is touched.
The weak point is the claim, not the code. The rule doc and tests/COVERAGE.md both say every table now goes through StackedTable, while four admin surfaces hand-roll a <table>, which the guard cannot see.
Body only: the ### Files block's two - lines read as removals, but against main neither stylesheet held a stacked reset.
Findings
- should-fix —
docs/rules/admin-ui.md:29: "Every table here goes through it" is false. - should-fix —
tests/unit/stacked-table-coverage.spec.ts:41: a subpath import goes round the guard. - consider —
docs/rules/admin-ui.md:25:tableColumn.tshas one caller, its type no importer. - consider —
ImportResultsTable.tsx:293:stacked()collides withStackedTable.
What was checked
Diff origin/main...origin/claude/fix-1151-stack-cms-tables, 16 files. Read whole on the branch: stackedTable.tsx, its module CSS, tableColumn.ts, the four stylesheets, the new spec, admin-ui.md. The ladder found no bespoke piece added. Grepped tableColumn, PayloadTableColumn and styles.stacked across src/ and tests/. The spec's reason for its own walk stands: importGraph.ts:191 exports one, but 10 unit specs already name it against the ≤10 cap at select-unit-specs.spec.ts:211. No payload-types.ts, endpoint or embed doc, so no consumer side. Preview unreachable: its links redirect to pr-1155.cloud-preview.sydevelopers.com, which answers the Access login, and both PREVIEW_ACCESS_* vars are unset.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
`@payloadcms/ui/elements/Table` resolves to the same component as the bare
specifier, and the regex pinned the bare one, so a surface importing that way
rendered Payload's `Table` with the guard still green. This repo already
imports from subpaths — `@payloadcms/ui/elements/Pill` in PermissionsTable and
EventRegistrationsView — so the bypass was one import away.
Watched it fail: adding `import { Table } from '@payloadcms/ui/elements/Table'`
to PermissionsTable.tsx now names that file.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWyEM1YP4LiKd9PwGq
The rule doc, `tests/COVERAGE.md` and the guard spec's own docblock each said every table in the admin goes through the wrapper. Four surfaces hand-roll a `<table>` — `PermissionsTable`, `ReadinessField/ReadinessTable`, `NotificationPreferencesField`, `AtlasPreview/AdjustedColors` — and the guard matches an import of Payload's `Table`, so it sees none of them. A reader trusting the old wording would take a phone layout as covered where nothing checks it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWyEM1YP4LiKd9PwGq
Nothing imported `PayloadTableColumn`, so the type exported nothing that kept anyone honest, and `stackedTable.tsx` was the function's only caller. The docstring explaining Payload's `Column` stub — the one reason the file was worth keeping — moves with it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWyEM1YP4LiKd9PwGq
This table renders through `StackedTable` now, where stacking is what a whole row does under 700px. A local helper named `stacked` beside it reads as that mechanism rather than the in-cell lines it builds — the same collision #1151 settled for `styles.stacked` in EventRegistrations. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWyEM1YP4LiKd9PwGq
|
Four adversarial-review threads, all adopted and resolved.
The body-only point was right too: the Gate green: 3884 unit tests, 44 targeted. One thread stays open — the single-select box's 40px height. A is built. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
One conflict, in docs/rules/admin-ui.md: both sides appended after the StackedTable paragraph. Kept both — this branch's coverage-guard and "what a surface still owes" paragraphs stay with StackedTable, and main's new RelationshipTable section follows them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A wrapped choice row is content the box has to grow for, and `height: 40px` with `overflow: hidden` clipped it away — the Install tab's five platform labels need about 510px, so its last choices vanished below that. `minHeight` keeps the box level with Payload's inputs beside it and lets a wrapped row show. The chosen segment keeps its edge-to-edge fill through `align-items: stretch` rather than `height: 100%`, which resolves to `auto` against a floor. Measured in Chromium: a single row is 40px with a 40px chosen segment before and after, and at 374px two rows grow the box to 48px with every choice visible, where `main` clipped the second row. Answers the reviewer's option B. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjUzj68GvhbZT1gjLyT
|
One thread, answered and resolved.
Measured in Chromium against the component's own inline styles: a desktop row is 42px with a 40px segment before and after, and at 374px the Install tab's five platform labels wrap to two rows, growing the box from a clipped 42px to 48px with all five visible. The PR body carries the table. Merged The approval at 17:29 was on d23a3a4, two commits back. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
StackedTable: under 700px each row is one block of named lines, so no column sits off a phone's screen.ToggleGroupnever wraps. The wrap now lives in that component.td's widths centrally, so a converted surface owes no stacked rule of its own.Change outline
The conversion is the same shape seven times. The wrapper decides every label; a call site supplies only the column.
Components — what a converted surface renders
Taken by: event registrations, import results, the activity log, the install milestones and
appearance tables, and the submission-review context and data tables. None was left as a table.
Behaviour — the one control stacking takes away
theadis hidden once the rows are blocks, and the import results keep their select-all there.ImportResultsTable thead select-all checkbox # hidden under 700px with the rest of the header row results header Publish (n) · Clean Up (n) · Download Skipped Rows (n) + Select all (n) / Clear selection # display: contents under 700px, none aboveFiles — where a stacked width rule lives
A width on the cell is the table's, so the wrapper drops it. A width on the cell's own
content stays with the surface, lifted inside the wrapper's own query. Every file below
gains a rule; none had a stacked reset on
mainto remove.Behaviour — ToggleGroup wraps itself, and the single-select box grows for it
Its container is styled inline, so no consumer could add the wrap from a stylesheet.
ToggleGroup src/components/admin/ToggleGroupField/ToggleGroup.tsx container style (inline) display: flex; width: 100%; max-width: maxGroupWidth + flex-wrap: wrap # a choice never breaks mid-label, so a narrow slot overflowed - InstallGuide.module.css: .choice :global([role=radiogroup]) { flex-wrap: wrap; max-width: 100% } single-select box # the multi-select pills are untouched - height: 40px # with overflow: hidden, a wrapped row was clipped away + min-height: 40px # still level with Payload's inputs beside it + align-items: stretch each choice - height: 100% # resolves to auto against a floor, so the fill stopped shortThat override covered
radiogrouponly, so the multi-selectgroupkept the overflow. EveryToggleGroupFieldconsumer gains the wrap. The box's height becomes a floor so a wrapped rowshows, and the chosen segment keeps its edge-to-edge fill from the flex line rather than from a
percentage.
The guard, and what it checks
Four admin surfaces hand-roll a
<table>and sit outside it:PermissionsTable,ReadinessField/ReadinessTable,NotificationPreferencesField,AtlasPreview/AdjustedColors.docs/rules/admin-ui.md,tests/COVERAGE.mdand the spec's own docblock each say so.Preview
The preview sits behind Cloudflare Access — sign in with a
sydevsGitHub account, then pick anymanager. Its database carries no content, this repo configures no preview seed, and this session
holds neither Access credential (
PREVIEW_ACCESS_CLIENT_ID,PREVIEW_ACCESS_CLIENT_SECRET), sonothing could be added from here. Data: not seeded. Each link opens on an empty collection
until someone adds a row; add one event with a registration, one import, one submission and one
service, then narrow the window to 390px.
Test results
.claude/skills/pr-prep/check.sh— lint, format, typecheck, test typecheck, 3882 unit tests (149 s), re-run after the merge ofmainand the height changeevent-imports.int.spec.ts33,event-registrations.int.spec.ts11)tests/unit/stacked-table-coverage.spec.ts— fails a second renderer of Payload'sTable, by the bare specifier or a subpath. Watched it fail againstmain, where it named all seven surfaces, and again withimport { Table } from '@payloadcms/ui/elements/Table'added toPermissionsTable.tsx.Measured in Chromium against a seeded local server, at 390 × 844 and at 1280 × 900.
scrollWidthmainOn
mainat 390px the registrations table laid its five columns out over 856px inside a 342pxviewport: Name and part of Email were visible, and Registered on, Status and Answers were not.
Interactions at 390px: the activity log opens its drawer on a click and on Enter, with one tab
stop per row; the import results' per-row checkboxes and the new select-all both toggle, and the
toolbar counts follow.
⚠ Those browser measurements were taken before the review round, and none of the seven surfaces
has changed since: the commits after them are a regex widening, three doc sentences, a private
helper folded into its one caller, a local function renamed, and the
ToggleGroupheight below,which no table renders.
The single-select box was measured on its own in Chromium, before and after, against the same
inline styles the component writes:
A desktop row is unchanged in both height and fill. At 374px the five platform labels wrap to two
rows:
mainkept the box at 42px and clipped the second row away, and the box now grows to holdit, each choice filling its own row.
Manual verification
main. The screenshots were byte-identical, but a reviewer's own eyes are worth more thancmp.ToggleGroupfield — an event's type, a manager's notification preferences — at a narrow width.Notes for reviewer
Two judgement calls, two findings dismissed with reasons, and four adopted from the adversarial review.
labelon every import-results column past the first. They are dropped:StackedTablereads the label off a string heading already, and the select column's is discarded whichever way, because that column is index 0 whenever it exists. The ticket's concern — that which column is first changes with the data — is real, and the labels could not have answered it either.Rowleads the block as a bare number rather than "Row: 7". That is the wrapper's first-column rule: the row's own title takes no label. Making it read the same either way would change the 1280px layout, which criterion 6 forbids.—rather than nothing, so a stacked block carries a named—line. Kept: that placeholder is visible content at 1280px, and dropping it would change the desktop table. The criterion asks for no blank named line.StackedTableitself. One table has a header control today, and beside Publish and Clean Up is a better place for it than anywhere the wrapper could put it.docs/rules/admin-ui.mdrecords the obligation and the trigger to generalise it.'@payloadcms/ui'specifier, and@payloadcms/ui/elements/Tableresolves to the same component. This repo already imports from subpaths, so the bypass was one import away.<table>and the guard matches an import, so each now says what it checks.helpers/tableColumn.tsis folded intostackedTable.tsxand deleted. The earlier reason for keeping it does not hold — nothing importedPayloadTableColumn, so the type kept nobody honest. Its docstring, which is the one place explaining Payload'sColumnstub, moved with the function.ImportResultsTable's localstacked()is nowlines(). It builds in-cell lines in the one file whose table is aStackedTable, where stacking means what the whole row does.min-heightand a wrapped row shows. B was costed as losing the chosen segment's full-height fill;align-items: stretchkeeps it, since a flex line's cross size is clamped up to the container's floor.Detail
Why the wrapper can take the width rule, and where it cannot.
.stacked .table tdis (0,2,1),which outranks a surface's
.submission-data .cell-fieldat (0,2,0) — Payload writescell-<accessor>on everytd. A CSS module that groups#heading-xwith.cell-xin oneselector list is the exception: the build collapses the list to
:is(…), which takes the id'sspecificity.
Dashboard.module.cssdoes exactly that, so it keeps its own stacked reset and thisPR leaves it alone.
Why a content width is lifted inside
max-width: 700pxrather than scoped tomin-width: 701px.A viewport width is not always an integer, and at 700.5px neither query matches, so the rule would
stand down while the table was still a table.
Why the coverage spec walks
src/itself rather than importingtests/utils/importGraph.Naming that module adds this spec to the per-edit hook selection for every edit of it, which
select-unit-specs.spec.tscaps — and the shared read memo buys nothing, since the unit projectisolates each spec file.
Why the guard still skips a type-only import. Reading the component's own props to type a
column puts nothing on the page. No file does so today, now that
tableColumnsits inside thewrapper, but a value import is what the guard is about.
Fixtures. Verification ran against a local database seeded by hand with one event, three
registrations, two imports, one service with a site, and four activity-log entries. No fixture
file ships; nothing in this PR reads one.
Closes #1151
🤖 Generated with Claude Code
https://claude.ai/code/session_01Mg9rjXenNVUK3cfDb5fVp8