Repository navigation
feat(atlas): give program organisers their own dashboard - #1017
antontcymbal wants to merge 6 commits into
Conversation
Atlas managers working in the Sahaj Atlas project now land on "Your programs" instead of collection cards: their programs in one native Payload table, draft and review states, filters, and buttons to add a program or open the public map. Admins and other projects keep the collection cards. The program list uses the Events collection's update access, so it shows exactly what the organiser can edit. "Add new program" follows the create access. A small shared theme layer in custom.scss gives headings, secondary buttons, field labels and tables more room across the admin. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Use the existing admin/helpers/tableColumn instead of a copy. - One isAtlasOrganiser in admin/helpers, shared by AtlasNav and the home. - Program status, sort and tab groups come from one typed stage map; counts are derived once on the client instead of twice. - Read latest and published events concurrently, each on its own req copy. - Drop AdminNavLinks' unused `disabled` prop. - Narrow `.empty span`, which also hit the Button's inner spans, and keep Payload's bolder active list tab by not overriding tab button weight. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The beforeDashboard fallback built its request from the `user` prop, which Payload has run through a field read: that flattens a manager's per-locale roles, and docs/rules/access.md calls that shape wrong for deciding access. It now re-authenticates, only when the fallback actually renders. The two access checks in the data loader also run concurrently, so each now gets its own request copy, as the concurrent-read rule asks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The dashboard adds one unit spec, and perf-figures-pinned holds PERF.md and its consumer docs to the count on disk. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🚅 Deployed to the SahajCloud-pr-1017 environment in sahajcloud
1 service not affected by this PR
|
|
@sydevs-bot revise |
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
One dashboard listing one collection arrives as seven new modules plus 58 lines of global SCSS. The data layer earns its keep — reading the Events update scope rather than project read access is the right call, and localeIsolatedReq on the concurrent reads follows src/collections/AGENTS.md. The two layers I would cut are the global theme block and PreferenceFallback: the first restyles the whole CMS to style one page, the second guards a state the body itself measured as never having occurred. Remove both and this is a focused PR. No contract surface is touched.
Findings
- blocker —
custom.scss:136drops zebra striping from every collection list in both projects. - should-fix —
custom.scss:93restyles the panel's headings, buttons and labels globally, with hardcoded sizes. - should-fix —
PreferenceFallback.tsx:12guards an unobserved state, on an unexported preference shape. - should-fix —
model.ts:57overlapping groups make the summary line double-count a program. - consider —
payload.config.ts:147duplicatesATLAS_PROGRAMS_WIDGETas a literal.
What was checked
Diff read whole against origin/main (21 files), then every new module, both specs and custom.scss.
Verified from the code, not the body: scopeRegionSubtreeWrite returns a boolean for events create with no data and a Where for list update, so canCreate === true and where: scope are both right and agree with the sidebar's new permissions path; excludeFinishedEvents fires for clients only, so the finished rank is live for a manager; ownManagerPreferences scopes the preference read to its caller.
Preview /admin and /admin/map answer 200, unsigned-in — no PREVIEW_ADMIN_EMAIL here, and the body says the seeded user is an admin, so the organiser home is not visible there.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
|
@sydevs-bot address |
|
Addressed in #1029, stacked on this branch. A human's PR, so nothing was pushed here. Every thread carries its reply and SHA. Adopted, one commit each:
Rebutted — Asked, left open — do ⚠ This PR conflicts with 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Ardnived
left a comment
There was a problem hiding this comment.
There are a few high level issues with this PR that need to be addressed:
- We should be using the term "Manager" instead of "Organizer" for consistency.
- Currently the Atlas dashboard is configured as a widget that overrides all dashboards on all projects, instead of being contained to the Atlas project.
- Let's create a generic custom Dashboard component which mediates the dashboard view and replaces the built-in widgets view. It should display a different custom view for each project - very similar to the analytics page. No need to check the role of the user for now, the dashboard is based only on the currentProject. For now the WeMeditateWeb and SahajAtlasWeb projects can just be a placeholder. If possible, incorporate
ProjectSelectionPromptinto this dashboard when no project is selected and remove it as a separate component
|
@sydevs-bot Revise. There are a few high level issues with this PR that need to be addressed:
|
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
Second pass, on request, after the maintainer's three asks.
Those asks remove more of this diff than they appear to. A per-project dashboard view keyed on currentProject leaves no widget grid. So PreferenceFallback.tsx has nothing to fall back from, atlasDashboardLayout and needsAtlasDashboardFallback have nothing to lay out, index.tsx's CollectionCards branch has nothing to guard, and payload.config.ts keeps neither the widget nor defaultLayout. The payload.auth(headers) re-read goes too — a views.dashboard Component receives the auth-strategy user, as AtlasNav already does. Four of the seven new modules exist only to sit inside Payload's widget grid. data.ts, model.ts's sorting and grouping, and OrganiserHome survive, and they are the parts worth keeping. No contract surface is touched.
Findings
- should-fix —
OrganiserHome.tsx:66repeatsAdminNavLinks' own/admin/maplink under a second label. - should-fix —
AtlasNav.tsx:19one predicate answers two questions, and the "Manager" rename makes its name claim a role it never tests. - consider —
OrganiserHome.tsx:3a client module takes its prop type from the server loader.
What was checked
Diff re-read whole against origin/main, then every new module and both nav files. scopeRegionSubtreeWrite makes the sidebar's new permissions.collections.events.create gate equal the old regions.length > 0, plus the role grant, so that swap holds. docs/rules/admin-ui.md and the four count docs match the code. First-pass custom.scss and grouping findings are answered in #1029. The two open field-label questions are yours.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
|
@sydevs-bot address |
|
Built in #1029, stacked on this branch. A human's PR, so nothing was pushed here. Your three asks, all in 4c2d3bb:
⚠ Confirm one reading. You named SahajAtlasWeb as a placeholder, but that is the project this home serves, and your second ask keeps it there. So the two WeMeditate projects got the placeholder. Your call: an admin switching into a WeMeditate project now sees that placeholder, where Payload's collection cards were. "All Content" keeps the cards. Critic threads answered in place. The field-label question is still yours. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
Superseded by #1029, which carries every commit from this branch, now targets |
Summary
Change outline
Flow — which dashboard a user gets
defaultLayoutpicks the widget per user. A layout saved before this widget existed beatsdefaultLayout, so abeforeDashboardfallback covers it.Flow — what the home lists
The list is the Events collection's own
updatescope, so it is exactly what the organiser can edit.Components — the organiser home
Built from Payload's
Table,Banner,Button,Pilland icons. Counts and tabs come from oneprogramGroups, and status labels from oneprogramStatus.Behaviour — the Atlas sidebar and nav
Preview
The preview's seeded user is an admin, so it sees the collection cards. Seeing the organiser home needs a
managersrow oftype: 'manager'with theatlas-managerrole and Sahaj Atlas selected.Test results
atlas-dashboard.int.spec.ts6 passed,atlas-dashboard-model.spec.ts3 passedpnpm format:check: ✓Manual verification
/admin: "Your programs" lists your programs; "View public map" opens the map./adminstill shows the collection cards.Notes for reviewer
h1,label.field-label,.field-descriptionand.tablerules have no Payload variable behind them, so they are overrides. They are unlayered, so they also reach Payload's ownh1s in modals and drawers, and every list loses its zebra stripes. Moving them intoOrganiserHome.module.cssis the alternative if you'd rather not restyle the whole CMS.PreferenceFallbackparses Payload's unexporteddashboard-layoutpreference shape and its${slug}-${index}widget ids, in an@experimentalAPI. It also re-adds the home for an organiser who saved an empty layout, outside the grid where it can't be removed. The other option is to drop it and reset organisers' saved layouts once. The local prod snapshot (2026-10-12) had nodashboard-layoutrows at all, since organisers had no Dashboard link before.bucketForEvent(its order putsexpiredafterneedsVerification, which the home ranks together); takingcanCreatefrom thepermissionsprop (keeping it in the loader lets the integration spec assert "assigned without create access").Detail
AGENTS.md's Next.js block heading changed from#to##becausenext dev16.4.2 writes##; committing it keeps the tree clean, as the root guide says.tests/PERF.mdand its three consumer docs now say 225 files / 2890 tests, whichperf-figures-pinnedrequires.payload.config.tsmatches the trigger. No findings: every new read usesoverrideAccess: false, and the re-authentication reads the same request headers as the admin shell.🤖 Generated with Claude Code