Repository navigation
feat(admin): explain who can edit a manager, and add a Need help? link to the header - #1238
Conversation
…k to the header A non-admin opening another manager (from an event's or a region's manager picker) now sees a notice at the top of the drawer: only an admin or the manager themself can edit a manager, with the support address and an Email support button. It shows only when Payload reports no save permission on that document. Every admin page gets a "Need help?" button to the right of the locale select, a mailto: to CONTACT_EMAIL. Payload has no header slot there, so it mounts as a header action and portals itself beside the localizer, which custom.scss moves in by the button's width. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🚅 Deployed to the SahajCloud-pr-1238 environment in sahajcloud
1 service not affected by this PR
|
|
🤖 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
The notice half is right: a notice over InfoBanner reads like EventScheduleNotice, and hasSavePermission is Payload's own answer, not a copy of the access rule. The header half is the opposite — six bespoke pieces, two of them repo firsts, to move a button from the left of the localizer to its right, which nothing requires. custom.scss now carries a third independent override of that one absolutely-positioned localizer, and the newest kills the oldest. One header-layout block would be the systemic answer to all three.
Findings
should-fix— the placement machinery exists for the ordering alone (NeedHelpButton.tsx:30).should-fix— the new:has()rule outranks the phone localizer fix at every width (custom.scss:157).should-fix— three routes to the samemailtoon one screen (ManagerEditNotice.tsx:28).should-fix— PR body: no## Previewsection, though the diff touches fourfixture.surfacePathsentries. The link: https://pr-1238.cloud-preview.sydevelopers.com/admin/collections/events/1025004consider— the banner's sentence restates the access rule (ManagerEditNotice.tsx:31).
What was checked. Read whole: both new components, custom.scss, Managers.ts, InfoBanner, fixture/views.ts, both specs. Ladder: InfoBanner and CONTACT_EMAIL already existed and are reused; createPortal has one precedent (AtlasNav/HoverTooltip); useLayoutEffect and ResizeObserver have none in src/. Fixture: 1025004 is EVENT_IDS.escalated, its manager is 1001006, and 1001002 is the region manager — the walkthrough holds. The copy is accurate against plugins/access/config/roles.ts. English literals match every other notice here, so not raised. Payload's header markup was not read: no node_modules here, so "no slot there" is taken as stated.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
The right-of-localizer position was nobody's requirement, and it cost a portal, a marker span, a useLayoutEffect, a ResizeObserver, a custom property written onto Payload's own node, and 28 lines of custom.scss. Payload's actions row already draws an action in the header, in flow, left of the localizer, and bounds its width per breakpoint. That also retires the `:has(.need-help)` rule, which at 0,4,0 outranked the phone localizer fix at 0,2,0 and so killed it at every width. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYdMpBbiNE6D6w7zjV
The banner spelled the address in prose beside its own Email support button. The prose goes; the button is InfoBanner's one control, and it is the only route reachable here — the drawer is fixed and 100vh over a header at the same z-index, so the header's own button sits behind it. Dropping "Only" also stops the sentence claiming exclusivity it reads off nothing: who may edit a manager is a role grant that can widen, and the notice already shows only when Payload reports no save permission. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYdMpBbiNE6D6w7zjV
|
Four critic threads answered in two commits.
Lean gate green: lint, format, both typechecks, 3843 unit specs. 🤖 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.
Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. Enable auto-merge when you want it merged: the queue tests it against its base. 🤖 Written by the sydevs autonomous loop — see what this is
The notice moves from the drawer's header (the collection Description slot) to the first field of the edit form, and becomes a warning. Payload draws the auth block (Email, Verified) ahead of every field with no slot before it, so the notice sits directly below that block. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… into claude/feat-manager-edit-notice
The read-only notice is a top-level `ui` field ahead of `name`, so the tabs field sits at position 3 among Managers' fields, not 2. `seedTabPreference` reads that position off the sanitized config and followed the move; the spec pins the literal Payload writes, so it did not. Payload indexes an unnamed field by its place in the parent's field array, counting a `ui` field, and appends the auth fields rather than prepending them — so the admin writes `_index-3` here too. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYm89ZFjtQ8AurVPxB
This reverts commit 82a54fe. The position to the right of the locale select is the owner's requirement for this PR (Ardnived, 2026-11-20), so the portal and the custom.scss offsets that make it work come back. The `:has(.need-help)` rule does outrank the phone localizer rule, on purpose: it restates that rule's offset (gutter + account picture + gap) plus the button's width at every width, so the phone layout keeps its spacing. Checked at 390px and 1280px. Co-Authored-By: Claude Opus 5.5 <[email protected]>
What
A read-only warning on a manager you can't edit. When a non-admin opens another manager, a warning appears at the top of the edit form: "You can't edit this manager. An admin, or the manager themself, can make this change." It has an Email support button, a
mailto:toCONTACT_EMAIL. Admins never see it, and neither does a manager looking at their own record.A "Need help?" button on every admin page, to the right of the locale select (language, help, account picture). It is a
mailto:to the same address.How
uifield, the first inManagers.fields(ManagerEditNotice). It renders when Payload's own per-documenthasSavePermissionis false, so it followsaccessPluginrather than restating its rules. Payload draws the auth block (Email, Verified) ahead of every field and offers no slot before it, so the warning sits directly below that block. In practice a non-admin reaches another manager only through a document drawer, from an event's Manager or a region's Managers field.managersis hidden from them, so Payload answers the full-page route with a 404.admin.components.actionsand portals itself. Payload's header has no slot to the right of the localizer. Actions render to its left, and the localizer is positioned absolutely outside the header's clipped row.NeedHelpButtontherefore portals itself into.app-headerand publishes its width as--need-help-width.custom.scssuses that width to move the localizer and its hidden spacer in. The:has(.need-help)rule deliberately outranks the phone localizer rule: it restates that rule's offset (gutter + account picture + gap) plus the button's width, at every width. The open phone nav hides the button along with the localizer.src/fixture/views.tslists both components.need-helpand--need-help-widthjoin the allowlists inadmin-custom-css.spec.ts.Built-ins used:
InfoBanner(Payload'sBanner,warningtype) and Payload'sButton el="anchor".Preview
Testing
tests/unit/need-help-button.spec.ts(jsdom) checks that the button portals into the header, publishes its width there, and clears the width on unmount.check.sh) passes.🤖 Generated with Claude Code