Repository navigation
feat(onboarding): ask "What do you work on?" once, at sign-up and on joining (menu access, part 6) - #1707
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]>
4 tasks done
gkhngyk
approved these changes
Oct 28, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good, with follow-ups.
What I checked:
- Own change. The diff against part 5 (4b89f5d..8c2e172): one feature commit (9e6ac7c) and two merges of part 5. Part 5's head is the last merge's parent, so nothing else is hidden in the merges. It doesn't touch 00374 or
supabase/at all. On today's main the branch conflicts only insupabase/schema.sql, which comes from part 1. This part's own files merge clean. - Asked once. The layout sends someone to
/dashboard/welcomeonly whenwork_areas_asked_atis null. The welcome page sends anyone already asked back to the dashboard. Continue and Skip both go throughsetMyWorkAreas, which setswork_areas_asked_at. After that, a full page load (window.location.assign) means the layout reads the new value, so there's no redirect loop. 00374 marks everyone already here as asked, so existing people aren't stopped. A failed save shows a toast and keeps the step open (tested). - Doesn't block sign-up or joining. The welcome page is in the onboarding group, so the dashboard layout's redirect can't send it to itself. The redirect comes after the subscription check, so a blocked member still sees the notice and an admin who needs to pay still goes to the plan. On the cloud the step comes after competitors (when
onboarding_completedis already set) and before the plan. Resuming lands on the work areas or the plan depending onwork_areas_asked_at. Self-host keeps 5 steps and asks on the dashboard instead. - No organization. Someone without one (onboarding, or removed) is sent to onboarding by the layout before the menu is worked out, and the welcome page does the same. Its
getMyMenu()call has a.catch, so a failed read gives an empty "hidden by admin" list instead of an error page. - Hide only.
hiddenWithWorkAreasgives the same result asmenuOfProfile. It's what the role and exceptions hide, plus what the work areas narrow. Action Center always stays, and a section no work area names isn't hidden. The Settings card now uses the same helper. - Copy. The
welcomenamespace inen.jsonis used by every key, andsettings.team_role_*covers everyTeamRole. - Tests. On the PR's tree,
work-areas-step.test.tsx,menu-access.test.ts, the actions tests, and the settings, layout and onboarding component tests all pass: 25 files, 222 tests.tsc --noEmiton the web package reports nothing in this PR's files. The only errors are missing modules and types in my local test setup (@ai-sdk/*,sanitize-html) in files this PR doesn't change.
Follow-ups (none block):
- Analytics step numbers.
onboarding_step_completedused to sendstep: 6for the plan. It now sendsstep: 7, andstep: 6meanswork_areas. Any funnel or insight that filters on the step number rather thanstep_namewill mix the two from the day this ships. Either check the funnels before merging, or note the cut-over date. - Invited admins. Anyone joining with the admin role gets the sign-up copy: "What do you work on?" and "...your team can pick their own when they join." The docs say an invitation shows "Welcome to {brand} Workspace". Either welcome invited admins too (
invitedcould come from the page, not fromrole !== 'admin'), or say in the docs that admins get the plain question. - Empty workspace name. When the organization has no brand and no name, the title reads "Welcome to Workspace". Fall back to
invitedTitleNoName's wording without the workspace, or to the organization's name only. - People who already had an account. Someone with an existing profile who accepts an invitation keeps their
work_areas_asked_atand isn't asked. That's fine, butacceptInvitationis where it would be reset if you want joining a new organization to ask again. Either way, the docs should match (see part 7). - Continue with nothing picked does the same as Skip. You could disable Continue until something is picked, so the two buttons don't mean the same thing.
This was referenced Oct 28, 2026
Merged
Merged
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 6: "What do you work on?", asked once. Stacked on part 5 (#1706).
components/onboarding/work-areas-step.tsx: the nine areas as cards with a live menu preview, Continue and Skip: show me everything (both save throughsetMyWorkAreas, which also setswork_areas_asked_at).onboarding/page.tsxnames its steps (WORK_AREAS_STEP,PLAN_STEP) instead of numbers; resuming lands on the right one. Self-host keeps its 5 steps; the layout asks instead./dashboard/welcome(in the onboarding group, so it can't redirect to itself), after the subscription check. "Welcome to {brand} Workspace, {first name}" / "You've joined as {role}."; the organization's name when it has several brands; admins get "What do you work on?".en.json(welcomenamespace).Related issue
None.
Type of change
feat— New featureHow to test
Same setup as part 2.
update profiles set work_areas_asked_at = null where id = '1111…';then open the dashboard: it goes to/dashboard/welcome. Pick Brand & PR, Continue: back on the dashboard, the sidebar follows Brand & PR. Reloading doesn't ask again.NEXT_PUBLIC_IS_CLOUD=true, a new account): after competitors comes "What do you work on?", then the plan step.update profiles set work_areas = '{}', work_areas_asked_at = now() where id = '1111…';Checklist
yarn lint/yarn typecheck/yarn formatpassyarn testandyarn buildpass, on this PR's tip: 465 files, 4,561 tests; build OK (on part 6's tip 8c2e172).work-areas-step.test.tsx)npm run version:check(fails on main too: docker-compose images 0.2.0)🤖 Generated with Claude Code