Repository navigation
Let owners and admins rename the workspace from Settings - #439
Merged
abhishekgahlot2 merged 1 commit intoNov 11, 2026
Merged
abhishekgahlot2 merged 1 commit into
abhishekgahlot2 merged 1 commit into
Conversation
The welcome page says the workspace name can change later in Settings, but the General card showed it as read-only text. Once the workspace had been renamed or had a second member, the welcome form was gone and the app offered no way to rename it. The Workspace name row in Settings, General is now a field with Save for owners and admins, using the same renameWorkspace call as the welcome page. Save sends the trimmed name, stays off for a blank or unchanged name, and shows the server's own reason under the field when the rename is refused. Text typed while a save is in flight stays in the field, and "Saved." only shows when the field holds the saved name. Members still see the name as plain text; the server refuses their rename either way. The user menu reads the workspace list once per session, so a rename used to show there only after a reload. lib/auth.ts now has a small workspacesChanged signal: the General card fires it after a successful rename and the user menu reads the list again when it hears it, so the new name shows in the menu straight away. The Settings docs page now says owners and admins rename the workspace there. Fixes useagenthq#285
Contributor
|
Merged, thanks @officialasishkumar. Renaming the workspace from Settings was overdue, and the owner/admin check sits on the server, so the UI can't be talked past. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
By opening this pull request you agree to the Contributor License Agreement. On your first pull request a bot asks you to sign it with a one-line comment.
Fixes #285
The welcome page says the workspace name "can change later in Settings", but Settings, General showed the name as read-only text. Once the workspace had been renamed, or had a second member, the welcome form was gone and the app had no way left to rename it.
What changed
frontend/app/(workspace)/settings/general-card.tsx): owners and admins now get an inline field with Save. Members still see the name as plain text. The role comes from the same/api/team/workspacesread the card already used, and the check is the existingcanManageTeam.renameWorkspacefromteam-api.ts, the same call the welcome page makes, with the trimmed name. It stays off for a blank or unchanged name.aria-describedby.frontend/lib/auth.ts,frontend/components/shell/user-menu.tsx): the menu reads the workspace list once per session.lib/auth.tsnow has a smallworkspacesChanged/onWorkspacesChangedsignal next tolistWorkspaces. The General card fires it after a successful rename, and the user menu reads the list again when it hears it. Because the next read hasdefaultName: false, the menu's "Set up your workspace" entry also goes away after the first rename.docs-site/docs/product/settings.mdx) now says owners and admins rename the workspace there.No backend change: better-auth's default access control already lets owners and admins update the organisation and refuses members.
Tests
general-card.test.tsx: a member gets the name as text with no input or Save. An owner and an admin each get the field holding the current name, plus Save.activeWorkspacekeeps the id and role and still treats a list without the active workspace as a failed read.New
general-card.interaction.test.tsxmounts the card next to the realUserMenuunder happy-dom. It uses the realteam-apiandauthhelpers over a stubbed fetch and covers:{ organizationId, data: { name: "Acme Robotics" } }for" Acme Robotics ", shows "Saved.", and the user menu requests/api/team/workspacesonce moreWithout the change, four of these five fail. With only the user menu change reverted, the "reads the list again" assertion fails.
Checks, with Bun 1.3.14:
cd frontend && bun run test: 1938 pass, 0 failcd frontend && bun run typecheck: passescd frontend && bun run lint: no new findings (the one warning insettings/is the existing one intheme-toggle.tsx)cd frontend && bun run build: passesbun test scripts/agent-docs.test.ts: passesEnd to end
I ran a real backend (dev mode, on its own pgvector Postgres) and a production build of the frontend (
next start), then drove them with Playwright:/settings. The field held "Ada's workspace" and Save was off. I typedAcme Roboticsand pressed Save. The row showed "Saved.", the user menu fetched/api/team/workspacesonce more, and without a reload the opened account menu listed "Acme Robotics / Owner / Selected"./api/team/workspacesreturnedAcme Robotics./settingsas them. The row showed "Acme Robotics" as text, with no field and no Save. A directPOST /api/auth/organization/updatefrom that session returned403 {"message":"You are not allowed to update this organization"}, the message the field shows to anyone the server refuses.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.