Skip to content

fix(atlas): fit the start pages to a phone - #1147

Merged
sydevs-bot merged 19 commits into
mainfrom
claude/fix-1140-phone-start-pages
Nov 14, 2026
Merged

sydevs-bot merged 19 commits into
mainfrom
claude/fix-1140-phone-start-pages

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • At 390 px every Atlas start page was 488–627 px wide; all three now fit, with each open item's next step on the first screen.
  • A class manager who may not create an event is offered the managers to ask instead of a button the server would refuse.
  • A table stacked at phone width reads as named lines, through one wrapper every CMS table can take.
  • Joined: the admin header itself overflowed at 390 px on a region drill-down, pushing the account picture off the screen — same symptom, one file this ticket already touches.

Change outline

Components — the header stops deciding, and the program home decides

HomeHeader carried canCreate for three homes and grew a second prop only one could use, reaching into that home's folder for its type. It takes a node now.

 HomeHeader({ subtitle, title })                       shared/HomeHeader.tsx
-  canCreate ? <AddProgramButton/> : contacts?.length ? <AskToAddButton/> : null
+  action: ReactNode                                   # whatever the home offers
 AtlasAdmin                                            no action
 AtlasRegion                                           action=<AddProgramButton/>
 AtlasManager                                          AtlasManager/index.tsx
+  canCreate     → <AddProgramButton/>
+  contacts      → <AskToAddButton contacts/>          AtlasManager/AskToAddButton.tsx
+  neither       → nothing

AskToAddButton opens Payload's confirmation-modal over the shared ManagerContactsTable — a notice naming a handful of people, not a surface to work in. That table now carries both callers:

 ManagerContactsTable({ rows })                        ManagerContacts/ManagerContactsTable.tsx
+  region?       → the Region column, where a row names one
+  lastSignIn?   → the column, only where a row has it # the field description reports it; the modal does not

Contract — one stacked table for every CMS table

Payload's Table prints its header row once and otherwise only scrolls sideways, so a stacked row lost both its names and its off-screen column. Wrapping it is the only place either can be answered.

 StackedTable({ appearance, columns, rows })           helpers/stackedTable.tsx
+  wraps Payload's Table                               helpers/stackedTable.module.css
+  under 700px: table / tbody / tr / td → block        # one block per row
+  every cell carries its heading as a label           # a header row names the first row alone
+  the first column carries none                       # it is the row's own title
+  a cell's own button takes the row
+  an empty cell is left out, not named blank
 OpenItemsList · RegionOverviewTable · ManagerContactsTable
+  all three render through it

Behaviour — what the start page says

 SectionTabs, program home                             AtlasManager/index.tsx
-  "Open items" · progress.open ?? counts.all          # read "Open items 4" beside "All 5"
+  "Events"     · counts.all                           # the meter still counts the open ones

 OpenItemsList, all three homes                        shared/OpenItemsList.tsx
  open === 0 → success banner
-    <emptyBanner>                                      # sat over a listed recommendation
+    counts.recommendations > 0
+      <emptyBanner> + "Below are optional recommendations to improve your event listings."

Contract — the phone layout, below 700 px

 .header                                               shared/Dashboard.module.css
-  gap: var(--base)                                     # a row gap nothing wanted when stacked
+  column-gap: var(--base)
+  stacked: .actions keeps a gap under it               # "Public Map" sat on the Statistics heading
 .tiles
+  two to a row, smaller; an odd last tile takes the row
+  (not `order` — that leaves them first to the keyboard)
 .sections
+  the meter drops under the tabs, which keep their own underline
 .list / .overview  cell widths
+  what this one table asked for while it was a table, reset:
+  .cell-item's min-width, .cell-action's 1%, the overview's 30% and 1%
+  (at 30% and 1%, stacked, they squeezed the region's name and its Edit button)
 @media (max-width: 768px)                             src/app/(payload)/custom.scss
+  .app-header__localizer
+    inset-inline-end: gutter + 25px avatar + half a gap
+    # Payload pins it 40px in, less than this file's wider gutter plus the picture
+  .app-header__step-nav-wrapper
+    min-width: 0; overflow-x: auto
+    # a crumb truncates, the row never did, and nothing above it clipped
 tone classes                                          shared/Dashboard.module.css
-  .tileLabel                                           # the shared .muted, spelled again
-  .healthy / .healthyGood / .healthyPoor               # the overview's own good and bad news
+  .figure / .better / .worse                           # one vocabulary, the tiles' and the overview's

Preview

  • Sahaj Atlas admin home — the admin start page; narrow the window to 390 px for the stacked layout
  • Regions list — add a region here, then open its home below
  • A region's home — the meter under the tabs, the stacked Regions overview, and the breadcrumb that used to push the account picture off a phone

Data: not seeded yet. This repo sets no previewUrl.seed, so the preview carries only the manager the deploy provisions — ?region=1 needs a region to exist first. The class-manager start page and its "Add new event" modal need a manager named on events but on no region, which no preview starts with; the integration specs cover that path instead.

Test results

  • Lean gate: ✓ .claude/skills/pr-prep/check.sh — lint, format, typecheck (src + tests), 3839 unit tests
  • Targeted specs: 44 passed (atlas-overview.int.spec.ts, manager-contacts.int.spec.ts)
  • Build: N/A — CI runs it

Manual verification

  1. At 390 × 844, as a class manager and as a region manager, check document.documentElement.scrollWidth is 390 on each start page.
  2. As a class manager with no create grant, open "Add new event" and check the modal names the managers above your events, nearest first, with working mailto: links.
  3. At 390 px, check every stacked row names each line it shows — the open items, the Regions overview, and the contacts table in that modal.
  4. Check the language button and the account picture do not overlap at 390 px, including on a region opened from the overview (a deep breadcrumb).
  5. Check the desktop layout is unchanged.

Notes for reviewer

Verified in a browser at 390 × 844 and 1280 against a seeded local database: both start pages and the region drill-down report scrollWidth: 390, the first open item's button lands at y≈773 (on the first screen), and the desktop layout is pixel-identical to main. That pass predates all three review rounds, whose changes are component-level and unverified in a browser here — the preview is the place to look at them.

Seven other CMS tables could take StackedTable. Ardnived chose a ticket of its own over building them here, so that work is #1151 — all seven named, with what each conversion needs. Nothing in this PR waits on it.

Three findings from the adversarial review were dismissed, each with a reason:

  • Restate Payload's responsive --gutter-h scale instead of patching the two rules it broke. custom.scss flattens the vendor's 60/40/16 px gutter to a constant 24 px, which is the root cause of the localizer overlap — and, in principle, of every other vendor rule that assumes 16 px below 768 px. Changing it moves every admin page's gutter at phone width, which this ticket cannot verify. Worth its own ticket; say the word and I will file one.
  • Use 768 px for the dashboard too, matching the chrome and Payload's $breakpoint-s-width. 700 px is where this content stops fitting, which is not where the chrome switches; between 701 and 768 px the dashboard is still comfortable in its desktop layout. Kept the ticket's number.
  • Split the .cell-action, #heading-action base rule in two so the phone rule needs no id weight. Two blocks with identical declarations merge back into one :is(), which restores the id weight the split was meant to remove. Kept the grouped rule and the comment that explains it.

One behaviour worth a second opinion: the SectionTabs tick that stands in for a zero count now means "runs no events" on the program home rather than "nothing open". Unreachable today — a manager with no events gets the CenteredNotice branch instead — so it is a note, not a defect.

Detail

Why this surface reads past mayReadManagerContacts. That gate shows a class manager no region manager's details at all (#908), which is the whole reason this ticket exists: the person who must ask for an event cannot see who to ask. The decision in the ticket (Anton, 12 Nov 2026) widens it for this surface only. What stands in for the gate is the caller's own manager listings — the loader derives every region from events the caller already runs, so a crafted request cannot name a region or a manager. The managers read selects name and email and nothing else, under docs/rules/access.md's projection rule, and that rule's section now says this surface exists so the next person to widen or narrow the gate finds it.

The region chain comes from getRegionTree, not a second walk of breadcrumbs. loadOpenItems already resolves and memoises the tree on this request, and regionTree.ts's own docblock says why one derivation of the hierarchy is the rule. The first draft re-derived it; the review pass removed that.

Why a label per cell rather than a description list. Table renders the <td> itself, so nothing here can swap the element — but it does take a pre-rendered node per cell, which is where the heading goes. The label is hidden by the stylesheet while the table is a table, so the real <th> still names the column on a desktop, and a phone reads the label instead. The first column is deliberately exempt: "Region: Pune" over the rest reads as one field among them rather than the row's title.

Fixtures checked. tests/int/manager-contacts.int.spec.ts builds a country → region → city tree with its own manager at each level, which is the shape the chain walk reads. Verified against Regions.ts's ALLOWED_PARENT_LEVELS (a city may sit under a region or a country) and against the nested-docs registration in src/lib/atlas/regionTree.ts, which is what populates the breadcrumbs the chain comes from. Each new assertion was watched failing against the defect it guards: the nearest-first ordering against an inverted sort, the self-exclusion against the condition removed, the loader wiring against a hard-coded empty list, and the deactivated manager against the unfiltered read.

No migration, no schema change, no generated file touched.

Closes #1140

🤖 Generated with Claude Code

https://claude.ai/code/session_01Mg9rjZPCoKeK4D9eWfqzvE

At 390px every start page was 488-627px wide. The progress meter cannot
wrap, so it took the section-tab row past the viewport, and the open-items
table hid its Next step column in its own sideways scroll - the button each
page exists for was off the screen.

Below 700px the meter drops under the tabs, which keep the underline their
active marker sits on; each open item stacks into one block with a
full-width button; and the tiles sit two to a row, smaller, so the list
starts on the first screen. Moving the tiles below the list with `order`
was rejected: it would leave them first in the keyboard's order.

The stacked header had no gap under its actions, so "Public Map" sat on the
Statistics heading. An odd last tile now takes the whole row.

A class manager's lone tab read "Open items 4" beside the filter row's
"All 5": it counts the whole list now, titled "Events", and the meter
beside it still counts the open ones. The all-clear banner no longer sits
over a list of recommendations without saying they are optional.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYon8GptJgxetgmaii
… event

A manager named only on events holds no create grant, so their start page
offered them nothing where every other home offers "Add new event". The
button is there now, and opens the managers of the regions above their own
events - nearest first, with their emails - instead of a create screen the
server would refuse.

Reading those details is one step past `mayReadManagerContacts`, which
shows a class manager no region manager's at all (#908). Anton priced that
on 12 Nov 2026 for this drawer alone, so the gate is the caller's own
`manager` listings: nothing in the loader takes a region or a manager from
the request, and the manager read selects the two columns the drawer
renders.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYon8GptJgxetgmaii
… screen

Payload pins the language button 40px from the header's edge below 769px,
which is less than this file's wider gutter plus the account picture, so it
covered half of it. It parks on its own hidden spacer now, one gap further
in.

The breadcrumb trail truncates each crumb but never the row, and nothing
above it clips, so a deep trail - an admin opening a region from the
overview - pushed the account picture off the screen and took the whole
page sideways with it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYon8GptJgxetgmaii
`access.md` said two surfaces read a manager's contact details, both behind
`mayReadManagerContacts`. A third now reads past it, so the gate alone is no
longer the whole story there.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYon8GptJgxetgmaii
Reuse what the request already holds and stop the shared layer depending on
one home:

- `loadRegionContacts` reads the ancestor chain and each region's name off
  `getRegionTree`, which `loadOpenItems` has already resolved and memoised on
  this request. That drops a `regions` query and, more to the point, the
  second derivation of the hierarchy `regionTree`'s own docblock warns about.
- `HomeHeader` takes an `action` node instead of `canCreate` and `contacts`,
  and `AskToAddButton` moves beside its loader. `shared/` no longer imports
  from a home, and the other two homes no longer carry a prop pair only one
  of them can use.
- The all-clear banner calls the rows optional only when a recommendation is
  one of them. `counts.all` also counts up-to-date events, so it promised
  suggestions that were not there.
- Nobody is listed as someone to email themselves.
- The header's gap is declared across only, so stacking needs no override of
  it; the stacked row separator exempts all but the first cell instead of
  redrawing itself; and the localizer takes one logical offset rather than a
  mirrored pair.
- The breadcrumb trail scrolls rather than clipping: Payload styles that
  wrapper for a scrollable trail, gradient included.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYon8GptJgxetgmaii
@railway-app

railway-app Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-1147 environment in sahajcloud

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Nov 13, 2026 at 11:08 pm UTC
1 service not affected by this PR
  • mailpit

@sydevs-bot

sydevs-bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 02:43Z address-review · attempt 1 · session · done
  • 02:43Z address-review · attempt 1 · session
  • 22:51Z address-review · attempt 1 · session · done
  • 22:51Z address-review · attempt 1 · session
  • 19:03Z address-review · attempt 1 · session · done

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 13, 2026
@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 13, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

The diff is the size of #1140 and no larger: every hunk maps to an acceptance criterion, and the joined header fix shares both the file and the symptom. HomeHeader taking an action node in place of canCreate plus a home-specific prop is a smaller surface than what it replaces. regionContacts.ts says why it does not call getRegionManagers, and it is right — loadOpenItems memoises that map for an admin scope only, so the program home would pay for a full-atlas read. One gap: the drawer can name a deactivated manager as the person to ask.

Findings

  • should-fix — regionContacts.ts:86 offers inactive managers as contacts.

What was checked

  • Ladder on the new pieces. AskToAddButton composes Payload's Drawer and Table through the repo's own tableColumn, as ManagerContactsTable.tsx does; regionContacts.ts is narrower than the existing getRegionManagers.
  • Traced the ordering by hand: chainById reversed, min-distance, then Map insertion order through the flatMap — "nearest first" holds for a manager running events in several regions, and self-exclusion matches the spec's fixtures.
  • Checked the ## Change outline claim that the tab counts every event. For role: 'program', scopedEventsWhere is manager == caller and no standalone proposal enters rows, so counts.all is exactly that.
  • scope.managerId is req.user.id, and none of the three reads takes a region or a manager from the request — the new access.md paragraph holds.
  • No contract surface: no payload-types.ts, no responseTypes.ts, no atlas-url-contract.json, so no consumer to sync.
  • All three preview links 302 to the Cloudflare Access login for pr-1147.cloud-preview.sydevelopers.com. This environment holds no service token, so they are unreachable from here and nothing is raised about them.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 13, 2026
An inactive manager is denied every operation by the access bypass, so
they cannot add the event the drawer asks for. Where the nearest region
lists only deactivated people, they were the only name offered.

Every sibling "who to contact" surface already excludes them: the digest
recipients, the verification reminder's manager lookup, and the
invitation send.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWNW4BU6XFtH6XLkea
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1147 November 13, 2026 17:12 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

One finding from the adversarial review, adopted.

Merged origin/main into the branch first. Clean, no conflict.

Lean gate green: 3794 unit tests. Targeted specs: 44 passed (atlas-overview, manager-contacts).

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 13, 2026
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 13, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review November 13, 2026 17:32
@sydevs-bot
sydevs-bot requested a review from Ardnived November 13, 2026 17:32
@sydevs-bot
sydevs-bot enabled auto-merge November 13, 2026 17:32
@sydevs-bot sydevs-bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 13, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 13, 2026
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 13, 2026
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 13, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 13, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 13, 2026
A row stacked at phone width lost its headers: Payload's `Table` prints
them once, above the first row, and nothing named the lines below. The
Regions overview read as eight unlabelled values per region.

`StackedTable` wraps Payload's `Table` and carries each cell's heading
into the cell, so a stacked row reads as named lines. Payload has no
responsive mode of its own — `Table` only scrolls sideways — so the
wrapper is where this can live at all, and the element-level rules move
out of the dashboard's stylesheet with it. What stays there is the
widths this one table asked for.

The overview's own column widths now reset when stacked: at 30% and 1%
they squeezed the region's name and its Edit button into a sliver.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZPCoKeK4D9eWfqzvE
The region a manager looks after was a second line under their name, to
keep a third column off a phone's screen. The table stacks into named
lines there now, so the region is a column like the others and reads
with its own heading.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZPCoKeK4D9eWfqzvE
`StackedTable` is where a phone layout for a CMS table lives now, so
admin-ui.md names it rather than the dashboard's own stylesheet. Two
comments beside the contacts loader still called its surface a drawer.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZPCoKeK4D9eWfqzvE
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1147 November 13, 2026 23:06 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Three threads from your review built, one left open for you.

#1140 gained a criterion for a stacked table, and its first one now says modal rather than drawer.

Merged origin/main in first; clean. Lean gate green: 3839 unit tests, 44 targeted specs.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 13, 2026
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 13, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 14, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 14, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

One thread from your review, answered. Nothing is pushed — your answer was B, so nothing changes here.

  • Filed — a stacked table, everywhere. The other seven CMS tables are fix(admin): stack the remaining CMS tables on a phone #1151. Event registrations and Import results are the two that lose columns off a phone today; the other five are two-column tables, and whether stacking beats scrolling is judged per table there. Both conversion hazards are recorded: the import table's checkbox heading, and the Activity log's delegated row listener.

StackedTable and its three consumers stand as they are. origin/main is already in; nothing to merge.

This PR waits on nothing now.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 14, 2026
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 14, 2026
Merged via the queue into main with commit 1f594b0 Nov 14, 2026
94 of 100 checks passed
@sydevs-bot
sydevs-bot deleted the claude/fix-1140-phone-start-pages branch November 14, 2026 03:02
@sydevs-bot sydevs-bot moved this from Pending to Done in SYDevelopers Technical Roadmap Nov 14, 2026
Ardnived added a commit that referenced this pull request Nov 15, 2026
`securityReview.triggerPattern` covered only `src/components/admin/SignIn/`,
so a change that reads past the caller's access anywhere else under the admin
components merged with no security review. PR #1147 did exactly that: it read
managers' names and emails on the Atlas start page past
`mayReadManagerContacts`.

The pattern now names the whole folder rather than the seven files that read
with `overrideAccess: true` today. A server field component answers a
`form-state` request for a row the caller chooses, so any of them owes its own
read gate (docs/rules/admin-ui.md, #1126). The hazard belongs to the folder.

Closes #1153

Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-1147 — 3ac0480b Deployed Nov 13, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

fix(atlas): fit the start pages to a phone

3 participants