Repository navigation
feat: replace inert Project tab with working Organization tab - #825
Conversation
gkhngyk
left a comment
There was a problem hiding this comment.
The Organization tab and Account Save work is exactly what #753 asked for — requireAdmin, validation, slug untouched, auth-metadata sync all check out, and the component follows the TeamSection pattern well.
One blocking issue: the en.json cleanup removed more than the three Project-tab keys. signalTexts.visibility_slipping, states.slipping, actionTexts.protect_visibility, and the diagnose_slip / review_responses / reinforce_content task keys are all live — they're referenced through dynamically composed keys (t(`${kind}.title`)) in web/src/lib/signals/display.ts and web/src/lib/action-center/display.ts, and the server emits those kinds in production (server/src/lib/pulse/metrics.js, server/src/lib/action-center/generate.js). An unused-key scan can't see dynamic composition, which is probably how they got flagged. Please restore those blocks — keeping only the project / projectName / domain removals — and this is good to go.
…nsvisor#753) - add updateOrganizationName server action (requireAdmin, trim, max 100 chars, slug untouched) - add getOrganization server action (name, slug, plan, memberCount) - add updateAccountName server action (writes profiles.full_name + syncs auth metadata) - new OrganizationSection component following TeamSection/AgentSection pattern - settings page: project → organization tab, wire Account Save button - en.json: remove dead project/projectName/domain keys, add org_* keys
662db2c to
2cc6db9
Compare
|
Fixed. The en.json was rebuilt from the latest main as the base, so visibility_slipping, protect_visibility, diagnose_slip, review_responses, and reinforce_content are all restored. Only project, projectName, and domain were removed. Force-pushed. |
gkhngyk
left a comment
There was a problem hiding this comment.
Verified the update: the en.json cleanup is now scoped to the three Project-tab keys only, with all the dynamically referenced actionCenter keys intact, and the code is unchanged from the version already reviewed. Thanks for the quick turnaround — good to go.
Closes #753
What
Replaces the dead "Project" settings tab (inputs with no handlers, a Save
button that did nothing) with a fully working "Organization" tab, and wires
the Account tab's Save button which had the same dead-button bug.
Changes
web/src/lib/actions/organization.tsThree new server actions:
updateOrganizationName(name)requireAdmin()(belt-and-braces on top of RLS, mirrorsteam.ts)organizations.nameonly — leavessluguntouchedgetOrganization(){ name, slug, plan, memberCount }for the current orgupdateAccountName(name)profiles.full_name(the column all app queries read)auth.users.user_metadata.full_namesosupabase.auth.getUser()reflects the new name immediately without waiting for a session refresh
web/src/components/settings/organization-section.tsx(new)Follows
TeamSection/AgentSectionpatterns exactly:useCallbackload inuseEffect,Skeletonwhile loadingcanAdmingate viauseUserRole()— non-admins see all fields read-onlywith a lock hint; admins get an editable name field
toast.success/toast.error,Loader2spinner on the buttonweb/src/app/.../settings/page.tsx'project'removed from theSectiontype; replaced with'organization'OrganizationSectionimported and rendered for the new tabupdateAccountNamewired to the Account Save button with loading stateand
toaston success/error?tab=projectpreserved — still maps toorganizationLabel/Input/Buttonblock for the oldProject card (Label import kept — still used in the Account tab)
web/messages/en.jsonproject,projectName,domainorganization,org_title,org_description,org_name,org_namePlaceholder,org_slug,org_slugHint,org_plan,org_members,org_adminOnly,org_loadFailed,org_saveFailed,accountSaveFailedVerification
yarn lint— 0 errorsyarn build— compiled and type-checked successfully (supabaseUrlerroris a missing local env var, not related to these changes)
yarn format:check— all files pass Prettier