Skip to content

feat(den): rename organization from Members page - #1482

Merged
benjaminshafii merged 5 commits into
devfrom
task/members-rename-org
Apr 17, 2026
Merged

benjaminshafii merged 5 commits into
devfrom
task/members-rename-org

Conversation

@benjaminshafii

Copy link
Copy Markdown
Member

Summary

  • Adds a PATCH /v1/orgs/:orgId endpoint (owner-only) on den-api to update an organization's display name. Slug stays immutable so dashboard URLs do not break.
  • Wires a new updateOrganizationName mutation through OrgDashboardProvider so the web app can call the endpoint.
  • Adds an Organization settings card at the top of the Members page (/o/:orgSlug/dashboard/members). Owners see a Rename button that swaps in an inline edit form; non-owners see a read-only summary explaining who can rename.
  • The sidebar org chip + dashboard header reflect the new name immediately because they all read from the refreshed org context.
  • Includes a companion fix (fix(den-api)) that tolerates a missing apps/desktop/package.json when building the den-api container. PR feat(den): gate desktop updates by supported version #1476 added a build step that reads the Tauri package.json, but packaging/docker/Dockerfile.den does not ship those sources, which had broken packaging/docker/den-dev-up.sh. We fall back to `0.0.0` (matching the runtime default) and let deployers override via DEN_API_LATEST_APP_VERSION.

UX notes

  • Scope: name only, owners only. Slug is intentionally not editable to keep `/o/:slug` links stable.
  • Guardrails: API validates `name` (2–120 chars, trimmed) and requires `ensureOwner`; UI uses the same min length plus a `maxLength=120`.
  • Feedback: on success the card collapses and shows "Organization renamed."; on failure we surface a red page-level error banner (same pattern as other Members mutations).

Screenshots

Before (Members page with Organization card + Rename button, owner):

before

Editing (inline form with current name pre-filled):

editing

After (new name + success state, sidebar also updated):

after

Screenshots are also committed under `ee/apps/den-web/docs/screenshots/`.

Testing

End-to-end via Chrome MCP against the Docker dev stack:

  1. `packaging/docker/den-dev-up.sh` → healthy at web=64449, api=64448 (verified `/` = 200, `/health` = 200).
  2. Signed up fresh (`[email protected]`), completed OTP verification (code pulled from `docker logs`).
  3. Created org "Acme Starter", navigated to Members.
  4. Clicked Rename, changed name to "Acme Inc.", clicked Save name → UI updated, "Organization renamed." success shown, sidebar chip flipped to "AI Acme Inc. Owner".
  5. Verified persistence in MySQL: `SELECT id, name, slug FROM organization` returned the new name and the unchanged slug.
  6. Re-opened the form and tried `x` (1 char) → browser HTML5 validation blocked the submit ("Please lengthen this text to 2 characters or more").
  7. Navigated back to Dashboard → org badge reads "Acme Inc."; URL path still contains the original `org_01kpev9w...` slug.
  8. No console errors during the flow.

Commands for reviewers:

```bash
cd _repos/openwork
packaging/docker/den-dev-up.sh # prints web/api URLs and env file path

then Chrome MCP:

/ → signup (use OTP from `docker logs `)

create org → /o//dashboard/members

click Rename → edit → Save

```

Out of scope

  • Renaming the slug / changing the URL path.
  • Non-owner rename permissions (e.g. admins).
  • Changing the logo/avatar.

Benjamin Shafii added 4 commits April 17, 2026 15:38
- Owners can update the display name (2-120 chars) via a new PATCH route.
- Slug stays immutable to keep dashboard URLs stable.
- Adds updateOrganizationName helper in orgs.ts.
- Adds an 'Organization' settings card above the Members tabs with inline
  rename for workspace owners.
- Non-owners see a read-only summary explaining who can rename.
- Wires a new updateOrganizationName mutation through OrgDashboardProvider
  that calls PATCH /v1/orgs/:orgId.
PR #1476 introduced a build step that reads apps/desktop/package.json to
bake in a default latest-app-version, but packaging/docker/Dockerfile.den
does not ship the Tauri desktop sources. As a result, the den-dev Docker
stack fails to build after the PR landed. Gracefully fall back to 0.0.0
(matching the runtime default) when the file is absent, and allow a
DEN_API_LATEST_APP_VERSION env override so deployers can still pin a
real value.
Captured via Chrome MCP against packaging/docker/den-dev-up.sh:
- before: Members page shows Organization card with Rename button.
- editing: inline form with the current name pre-filled.
- after: new name shown with success state, sidebar also updated.
@vercel

vercel Bot commented Apr 17, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openwork-app Ready Ready Preview, Comment Apr 17, 2026 11:25pm
openwork-den Ready Ready Preview, Comment Apr 17, 2026 11:25pm
openwork-den-worker-proxy Ready Ready Preview, Comment Apr 17, 2026 11:25pm
openwork-landing Ready Ready Preview, Comment, Open in v0 Apr 17, 2026 11:25pm
openwork-share Ready Ready Preview, Comment Apr 17, 2026 11:25pm

The dashboard has been inlining the same card style (rounded-[30px] + p-6
+ shadow-[0_18px_48px_-34px_rgba(15,23,42,0.22)]) on every form surface.
Per Den visual language we do not use drop shadows, so the repeated
shadow class is both incorrect and a copy-paste risk.

- Add ee/apps/den-web/app/(den)/_components/ui/card.tsx exporting DenCard
  with two size presets (comfortable + spacious). Shadows are explicitly
  omitted and the component is designed so they cannot be re-introduced
  via className (no tokens ever emit shadow utilities).
- Replace all five inline cards in manage-members-screen.tsx with DenCard.
- Replace the reused sibling card in api-keys-screen.tsx with DenCard.
- Re-capture members-rename screenshots against the refactored UI.
@benjaminshafii

Copy link
Copy Markdown
Member Author

Added a follow-up commit: extracted a reusable DenCard primitive under ee/apps/den-web/app/(den)/_components/ui/card.tsx and removed the inline drop shadows that had been copy-pasted on every Members/API Keys card (Den visual language does not use drop shadows).

  • Two explicit size presets (comfortable — current Members/API Keys style, spacious — editor-screen style) so we can keep standardising the rest of the dashboard in follow-up PRs.
  • No shadow utilities are emitted by the primitive; consumers pass layout classes only.
  • Swept 6 cards total (5 in manage-members-screen.tsx, 1 in api-keys-screen.tsx) which all rendered with the identical inline class string.
  • Re-captured the members-rename screenshots against the refactored UI.

Other screens still using inline shadow-laden cards are out of scope for this PR; I left them for a follow-up so this diff stays reviewable.

@benjaminshafii
benjaminshafii merged commit 0655ee5 into dev Apr 17, 2026
9 checks passed
benjaminshafii pushed a commit that referenced this pull request May 15, 2026
* feat(den-api): add PATCH /v1/orgs/:orgId to rename organization

- Owners can update the display name (2-120 chars) via a new PATCH route.
- Slug stays immutable to keep dashboard URLs stable.
- Adds updateOrganizationName helper in orgs.ts.

* feat(den-web): rename organization from Members page

- Adds an 'Organization' settings card above the Members tabs with inline
  rename for workspace owners.
- Non-owners see a read-only summary explaining who can rename.
- Wires a new updateOrganizationName mutation through OrgDashboardProvider
  that calls PATCH /v1/orgs/:orgId.

* fix(den-api): tolerate missing apps/desktop/package.json in Docker build

PR #1476 introduced a build step that reads apps/desktop/package.json to
bake in a default latest-app-version, but packaging/docker/Dockerfile.den
does not ship the Tauri desktop sources. As a result, the den-dev Docker
stack fails to build after the PR landed. Gracefully fall back to 0.0.0
(matching the runtime default) when the file is absent, and allow a
DEN_API_LATEST_APP_VERSION env override so deployers can still pin a
real value.

* docs(den-web): add rename organization screenshots

Captured via Chrome MCP against packaging/docker/den-dev-up.sh:
- before: Members page shows Organization card with Rename button.
- editing: inline form with the current name pre-filled.
- after: new name shown with success state, sidebar also updated.

* refactor(den-web): extract DenCard primitive and drop drop shadows

The dashboard has been inlining the same card style (rounded-[30px] + p-6
+ shadow-[0_18px_48px_-34px_rgba(15,23,42,0.22)]) on every form surface.
Per Den visual language we do not use drop shadows, so the repeated
shadow class is both incorrect and a copy-paste risk.

- Add ee/apps/den-web/app/(den)/_components/ui/card.tsx exporting DenCard
  with two size presets (comfortable + spacious). Shadows are explicitly
  omitted and the component is designed so they cannot be re-introduced
  via className (no tokens ever emit shadow utilities).
- Replace all five inline cards in manage-members-screen.tsx with DenCard.
- Replace the reused sibling card in api-keys-screen.tsx with DenCard.
- Re-capture members-rename screenshots against the refactored UI.
benjaminshafii pushed a commit that referenced this pull request May 15, 2026
* feat(den-api): add PATCH /v1/orgs/:orgId to rename organization

- Owners can update the display name (2-120 chars) via a new PATCH route.
- Slug stays immutable to keep dashboard URLs stable.
- Adds updateOrganizationName helper in orgs.ts.

* feat(den-web): rename organization from Members page

- Adds an 'Organization' settings card above the Members tabs with inline
  rename for workspace owners.
- Non-owners see a read-only summary explaining who can rename.
- Wires a new updateOrganizationName mutation through OrgDashboardProvider
  that calls PATCH /v1/orgs/:orgId.

* fix(den-api): tolerate missing apps/desktop/package.json in Docker build

PR #1476 introduced a build step that reads apps/desktop/package.json to
bake in a default latest-app-version, but packaging/docker/Dockerfile.den
does not ship the Tauri desktop sources. As a result, the den-dev Docker
stack fails to build after the PR landed. Gracefully fall back to 0.0.0
(matching the runtime default) when the file is absent, and allow a
DEN_API_LATEST_APP_VERSION env override so deployers can still pin a
real value.

* docs(den-web): add rename organization screenshots

Captured via Chrome MCP against packaging/docker/den-dev-up.sh:
- before: Members page shows Organization card with Rename button.
- editing: inline form with the current name pre-filled.
- after: new name shown with success state, sidebar also updated.

* refactor(den-web): extract DenCard primitive and drop drop shadows

The dashboard has been inlining the same card style (rounded-[30px] + p-6
+ shadow-[0_18px_48px_-34px_rgba(15,23,42,0.22)]) on every form surface.
Per Den visual language we do not use drop shadows, so the repeated
shadow class is both incorrect and a copy-paste risk.

- Add ee/apps/den-web/app/(den)/_components/ui/card.tsx exporting DenCard
  with two size presets (comfortable + spacious). Shadows are explicitly
  omitted and the component is designed so they cannot be re-introduced
  via className (no tokens ever emit shadow utilities).
- Replace all five inline cards in manage-members-screen.tsx with DenCard.
- Replace the reused sibling card in api-keys-screen.tsx with DenCard.
- Re-capture members-rename screenshots against the refactored UI.
@benjaminshafii
benjaminshafii deleted the task/members-rename-org branch May 15, 2026 17:38

This branch was successfully deployed

5 active deployments
Preview – openwork-den-worker-proxy — 9f82753e Deployed Apr 17, 2026 by vercel[bot]
Preview – openwork-den — 9f82753e Deployed Apr 17, 2026 by vercel[bot]
Preview – openwork-landing — 9f82753e Deployed Apr 17, 2026 by vercel[bot]
Preview – openwork-app — 9f82753e Deployed Apr 17, 2026 by vercel[bot]
Preview – openwork-share — 9f82753e Deployed Apr 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant