Repository navigation
docs(settings): explain menu access (menu access, part 7) - #1708
Merged
Merged
Conversation
… part 1)
Menu access, part 1 of 7: the data and the rule, with no UI yet.
- 00374 adds organization_menu_roles, the sections a role (not admin)
doesn't see. Members of the organization read it and the server
writes it.
- On profiles it adds menu_shown, menu_hidden and can_manage_menus,
which only the server sets (00228's guard is extended), and
work_areas and work_areas_asked_at, which the person sets.
- lib/menu-access.ts holds the rule: the role's sections, then the
person's exceptions, narrowed to their work areas.
- Action Center is always on.
- Nobody takes a section off an admin's menu; only their own work
areas narrow it.
- A section is named by its route, so a new one shows by default.
- lib/actions/menu-access.ts covers getMyMenu, the Settings data, the
role table, per-person exceptions and menu managers (admin only).
It also writes the person's own work areas.
Hide only: pages still open from a link, roles and data access don't
change.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…enu access, part 2) The dashboard layout reads the viewer's menu once (getMyMenu, part 1) and hands the sections it leaves out to a MenuAccessProvider. Both menus filter by them through shouldShowDashboardNavItem: - the sidebar drops a group whose sections are all off the menu, title and all; - the mobile menu drops the active brand's Prompts link with the Prompts section. If the menu can't be read, the whole menu shows. Hide only: an address still opens its page. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A removed member keeps their profile and an invitation moves it to the next organization, so a menu manager of one organization arrived in another still able to change its menus, with their old exceptions. A trigger now clears menu_shown, menu_hidden and can_manage_menus on a new organization and can_manage_menus on a new role, unless the same update sets them; it fires after the guard, so the guard still checks what the person asked for. Also reloads PostgREST's schema at the end of 00374, validates setMenuManager's flag with Zod, and tests that the work-area check in the database lists exactly the app's work areas. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…access, part 3)
A new Settings section, Menu access, for admins and the managers they let
change menus. Others don't see it in Settings, and its address tells them
who can.
- A table of the menu's sections by its groups, with a column per role:
- each box saves at once, and is put back with a toast if the save
fails;
- Admin is always Everything, and Action Center can't be turned off;
- "Use a set…" fills a role from a work area's ready-made set, or
Everything.
- Fixed column shares keep the table inside Settings' column at 1024 px.
- en.json carries the copy and the nine work areas' names and lines, so
the Account and welcome-step parts can use them too.
- MenuAccessProvider also carries whether the viewer can change menus.
The plan dialog for a workspace whose plan has ended follows once ansvisor#1599
lands.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ions (menu access, part 4)
Two more cards on Settings › Menu access.
Who can change menus:
- lists the managers;
- an admin switches one on (setMenuManager) to let them use this page;
- a manager who changes menus sees the switches but can't flip them.
People: every non-admin with their role, work areas, menu ("{role}'s
menu", or "Custom: +Prompts, −Content") and how many sections it keeps.
Customize opens their sections:
- ticked as their role has them;
- a change from the role marked "shown for them" or "hidden for them";
- Action Center always on;
- each box saved at once (setMemberMenu);
- "Use {role}'s menu" goes back to the role's.
A failed save puts the switch or box back, with a toast. A row lays out on
one line when the card is wide, and on two when it's narrow (1024 px).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t (menu access, part 5) Settings › Account gets "Your work areas": the nine areas as chips plus Everything. - Picking one narrows the person's own left menu; admins can pick too, since nobody else narrows an admin's menu. - Each change is saved at once (setMyWorkAreas) and the menu refreshes; a failed save puts the chips back, with a toast. - "Your menu" lists the sections. One that's off says why: "Hidden by your admin" (role or exception) or "Not in your work areas". A note says how many the admin took off. - getMyMenu now also returns hiddenByAdmin. The sidebar says "N sections off your menu. Change" above Send feedback when something is off, with Change linking to Account. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…areas "What do you work on?" is for new sign-ups and people joining from an invite, once. Without this, every existing person would get the step at their next sign-in. They can still pick work areas in Settings › Account. Co-Authored-By: Claude Opus 5.5 <[email protected]>
"What do you work on?" is a step of its own (components/onboarding/
work-areas-step.tsx). It shows:
- the nine work areas as cards, with each area's line and sections;
- the menu they give as they're picked, with the count the admin took off.
Continue or "Skip: show me everything" saves (setMyWorkAreas), so it's
asked once; it changes later in Settings › Account.
- Cloud sign-up: it comes after the competitors and before the plan.
WORK_AREAS_STEP and PLAN_STEP name the two steps, so the plan step and
anything added to it move together. Resuming a finished sign-up opens
whichever of the two is still owed.
- Anyone not asked in onboarding (an invited person, or a self-hosted
admin with no plan step) is sent by the dashboard layout, once, to
/dashboard/welcome. It sits in the onboarding group, so the layout can't
send it to itself.
- An invited person reads "Welcome to {brand} Workspace, {first name}"
and "You've joined as {role}." (the organization's name when it has
several brands).
- An admin is asked "What do you work on?".
- lib/menu-access.ts gets hiddenWithWorkAreas, which the Account card now
uses too.
People already here were counted as asked by 00374.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… access, part 2 review) The dashboard layout read the viewer's menu through getMyMenu, a second user check and profile read after its own: two or three requests in a row on every render. The menu columns now come with the profile the layout already reads. The role's row (none for admins) is read alongside the organization and the brands. menuOfProfile builds the menu from both, and getMyMenu uses the same. - A role row that can't be read is logged (console.error) and the menu shows whole, rather than the failure passing silently. - The sidebar no longer reads the tracked prompts' count while Prompts is off the menu. - Tests cover a group dropped with its title when all its sections are hidden, the whole menu without a menu to go by, the count not read, the mobile menu leaving hidden sections off (the brand's Prompts link with Prompts), and readRoleHidden. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ettings # Conflicts: # web/src/app/[locale]/(dashboard)/layout.tsx
…let "Use a set…" fit (menu access, part 3 review) - A failed save on Menu access reads the role table again, instead of putting back the state from before it, which also undid a later save that had gone through. - No router.refresh after a save: setRoleMenu's revalidatePath already brings the menu up to date, so each click no longer renders twice. - The role columns get a little more of the table, and the select's chevron is smaller, so "Use a set…" isn't cut at 1024 px with the sidebar open. - Tests: picking a ready-made set saves it; a failed save next to a successful one keeps the successful one; Settings lists Menu access only for someone who can change menus. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…access, part 4 review) As with the role table: a failed save on Who can change menus or People reads the settings again (onFailed), instead of putting back the state from before it, which could undo a later save that had gone through. No router.refresh after a save: setMenuManager and setMemberMenu revalidate already. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rk-areas # Conflicts: # web/src/components/layout/sidebar.test.tsx # web/src/lib/actions/menu-access.ts
…ss, part 5 review) As on Menu access: Settings › Account's work areas read the menu again when a save fails, instead of putting back the state from before it. No router.refresh after a save: setMyWorkAreas revalidates the layout already. The Settings list test mocks the Account card too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s-welcome # Conflicts: # web/src/lib/menu-access.test.ts # web/src/lib/menu-access.ts
…menu access, part 3 review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
A new guide, Menu access, covers: - who changes menus, and letting a manager do it; - choosing what each role sees, with "Use a set…"; - changing one person's menu (People → Customize); - the nine work areas and their sections; - when "What do you work on?" is asked, and changing the answer in Settings → Account; - how a menu is worked out, and what "hide only" means; - a self-host note on migration 00374. Add your first brand now lists the cloud's step 6 (What do you work on?) before the plan step, which becomes step 7. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
gkhngyk
approved these changes
Oct 28, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good with 1746d5d: the three places that put curly braces in plain text ({Role}'s menu, Use {Role}'s menu, Welcome to {brand} Workspace, {your first name}) now use example words, since MDX reads braces as code. The rest of the page matches the code: the work-area table against WORK_AREAS, the UI labels against en.json, how a menu is worked out against hiddenMenuSections, the self-host note against 00374, and the 7-step cloud sign-up against part 6.
Follow-ups (none block):
- Invitations. Someone invited as an admin gets "What do you work on?" rather than the welcome, and someone who already had an account isn't asked again. The invitation line could say "on your first sign-in with a new account" and mention the admin wording.
- Self-hosted first visit. On self-host, any new account that finishes onboarding is asked, not only the first admin. "The first time someone opens the dashboard after onboarding" would be closer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Menu access, part 7: the guide. Stacked on part 6 (#1707). Docs only.
docs/guides/menu-access.mdx: who can change menus (admins, and managers an admin lets; the right goes with a role change, and nothing carries over to another organization), the role table and Use a set…, People › Customize, the nine work areas and their sections, when "What do you work on?" is asked (sign-up, an invite, a self-hosted first visit), Skip and changing it in Settings › Account, how the menu is worked out ("hide only"), and the self-host note (apply 00374 before the web; everyone already there counts as asked).docs/mint.json: Platform Guides lists it after Daily pulse.docs/guides/add-your-first-brand.mdx: cloud sign-up has 7 steps; step 6 is "What do you work on?", the plan is step 7.Related issue
None.
Type of change
docs— DocumentationHow to test
cd docs && npx mintlify dev, then open Platform Guides › Menu access and Add your first brand.Checklist
🤖 Generated with Claude Code