Skip to content

feat(settings): redesign General and Members - #1526

Merged
Makisuo merged 17 commits into
feat/settings-redesign-foundationfrom
feat/settings-general-members
Oct 17, 2026
Merged

Makisuo merged 17 commits into
feat/settings-redesign-foundationfrom
feat/settings-general-members

Conversation

@Makisuo

@Makisuo Makisuo commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

General (was Organization) and Members redesign.

  • General: logo saves on upload, name goes through the save bar, data region is its own read-only section ("cannot be changed", true per OrganizationService), one accurate list of what deleting removes, and a new Leave organization (blocked for the last admin).
  • Members: role changes confirm inline before they apply, invitations show when they were sent and can be resent (revoke + re-invite) or revoked from one row menu, skeleton rows while loading. Members see a single admin notice and no actions.

Verification

  • org-membership tests, web typecheck, local stack screenshots below. Role confirm needs a second member and is covered on the preview.

General
Members

Stack

Settings redesign, bottom to top: #1525 foundation, #1526 general and members, #1527 billing and usage, #1528 keys, ingestion and sampling, #1529 audit log, setup health and data platform, #1530 MCP, #1531 AI and email preferences. Bug fixes from the same audit shipped in #1524. Alerts routing is a later stack.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added organization settings for changing the name and logo, viewing the data region, leaving an organization, and deleting one.
    • Added member role changes with confirmation, plus invitation resend and revoke actions.
    • Added read-only image previews and an optional title-and-hint layout.
  • Bug Fixes
    • Prevented the last admin from leaving an organization; admins are prompted to promote another member first.
  • Improvements
    • Added loading placeholders for member lists and invitation details, including roles and invitation times.

… and leave organization

Name edits go through the settings save bar while the logo still saves on upload. The data
region gets its own read-only section, and the danger zone lists what deletion removes,
what ages out and what is kept, matched to the organization delete purge. Members can
leave the organization unless they are its only admin.
… invitation actions

Members use the wide width with one line on what admins manage. A role select on each row
opens a confirm strip before the change, and the row menu keeps only Remove, hidden on your
own row. Invitations show when they were sent and share the same row menu with Resend
(revoke and re-invite with the same role) and Revoke. The status column is gone.
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 35 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9d011430-9337-4ec8-8109-444d3da39a3f
📥 Commits

Reviewing files that changed from the base of the PR and between 3adcd4e and 1408fd2.

📒 Files selected for processing: 8
  • apps/web/src/components/common/image-dropzone.tsx
  • apps/web/src/components/settings/general-section.tsx
  • apps/web/src/components/settings/members-section.tsx
  • apps/web/src/components/settings/org-membership.test.ts
  • apps/web/src/components/settings/org-membership.ts
  • apps/web/src/components/settings/organization-section.tsx
  • apps/web/src/routes/settings.tsx
  • knip.json

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 20350ec6-e985-46d9-9253-eef7ae506b66
📥 Commits

Reviewing files that changed from the base of the PR and between 704f6df and 3adcd4e.

📒 Files selected for processing: 1
  • apps/web/src/components/settings/general-section.tsx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The settings page now uses a general organization settings section with organization editing, deletion, and leave controls. Member settings add confirmed role changes, member removal, and invitation resend and revoke actions. ImageDropzone supports titled and read-only presentation.

Changes: Organization Settings and Membership Updates

Layer / File(s) Summary
Organization role and leave rules
apps/web/src/components/settings/org-membership.ts, apps/web/src/components/settings/org-membership.test.ts
Adds typed role conversion and labels, leave eligibility, and role-change prompts. Tests cover role conversion and leave eligibility outcomes.
ImageDropzone title and read-only behavior
apps/web/src/components/common/image-dropzone.tsx
Adds an optional title and read-only mode. Read-only mode removes interactive target behavior and hides upload and removal actions.
Organization details, deletion, and leaving
apps/web/src/components/settings/general-section.tsx, apps/web/src/components/settings/organization-section.tsx, apps/web/src/routes/settings.tsx, knip.json
GeneralSection replaces OrganizationSection on the general settings tab. It adds organization name and logo controls, home-region display, and gated deletion and leave flows. The Knip ignore list is updated.
Member and invitation management
apps/web/src/components/settings/members-section.tsx
Adds confirmed role changes, member removal, invitation resend and revoke controls, and loading placeholders for the member table.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor OrganizationAdminOrMember
  participant GeneralSection
  participant Clerk
  participant Router
  OrganizationAdminOrMember->>GeneralSection: Confirm organization deletion or membership leave
  GeneralSection->>Clerk: Delete organization or leave membership
  Clerk-->>GeneralSection: Return operation result
  GeneralSection->>Clerk: Attempt to activate another membership or no organization
  GeneralSection->>Router: Navigate home
Loading

Suggested reviewers: jeremyfunk

Merge Risk: ⚪ Minimal · up to 3adcd

No actionable issue remains from this review; the change is ready to merge after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main changes: redesigning the General and Members settings pages.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@maple-review-bot

maple-review-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 8/10 · likely safe to merge
The one place needing care is the leave gate, which rests on Clerk's role-filtered membership count; the destructive paths stay behind Clerk's own last-admin rule and typed confirmation.
quality 100/100 · no findings · tests partial · risk medium

Replaces OrganizationSection with GeneralSection (draft-backed rename and save bar, logo, a new leave-organization flow, delete with typed confirmation) and gives MembersSection resend-invitation and inline role changes backed by tested pure helpers. Contained; safe to merge.

  • GeneralSection takes over org name, logo, data region, leave and delete from OrganizationSection
  • Name edits move to useSettingsDraft + SettingsSaveBar, committed with the trimmed value
  • New leave-organization flow gated by leaveEligibility on the admin count
  • MembersSection adds resend-invitation and an inline role-change confirm strip
What was checked
  • General and members tabs are Clerk-only (settings-nav.tsx:225), so the new Clerk hooks never run self-hosted
  • DELETION_FACTS matches what OrganizationService.delete purges (OrganizationService.ts:105)
  • Org switching reloads the page (org-switcher-menu.tsx:88), so a dirty name draft cannot follow the user

f2b08a5 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@maple-review-bot

maple-review-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 8/10 · likely safe to merge
All 8 settings files and the two files changed since f2b08a5 were read; the deletions there are unused exports and the leave/role helpers are pinned by tests.
quality 100/100 · no findings · tests partial · risk medium

Replaces the Organization settings tab with a General tab (save-bar name, upload-on-select logo, read-only data region, delete and leave) and rewrites Members with inline role confirm, invitation resend/revoke and loading skeletons. All UI; the two files changed since the last review only delete unused exports, and nothing blocks a merge.

  • GeneralSection replaces organization-section.tsx: name via SettingsSaveBar, logo saved on upload, delete gated by typing the org name
  • leaveEligibility blocks the sole admin from leaving (org-membership.ts:18)
  • MembersSection confirms a role change on an inline row strip before applying it
  • Invitations can be resent (revoke then re-invite) or revoked per row; tagFacets/filterByTags and MODEL_CALL_ATTEMPT_ATTR's export removed
What was checked
  • tag-grouping.ts only loses filterByTags, tagFacets and TagFacet; rules-tab.tsx:30 imports only groupByTag, TagGroup, UNTAGGED_KEY
  • MODEL_CALL_ATTEMPT_ATTR is still used in-file after losing its export (genai-spans.ts:292)
  • leaveEligibility's four states and toOrgRole's fallback are asserted in org-membership.test.ts

704f6df · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@maple-review-bot

maple-review-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 8/10 · likely safe to merge
I read the new draft-commit path, the last-admin guard and every changed hunk; the role-confirm and resend flows have no unit test of their own.
quality 100/100 · no findings · tests partial · risk medium

Redesigns the General and Members settings tabs: the org name saves through a draft save bar, the logo uploads directly, and members get an inline role confirmation strip plus resend/revoke on invitations. The new controls only gate the UI; the API still enforces admin, so it is safe to merge.

  • GeneralSection replaces OrganizationSection, with the name in a useSettingsDraft save bar and a Leave organization row
  • leaveEligibility blocks only the last admin from leaving
  • Members role changes confirm inline before member.update runs
  • Invitation resend revokes and re-invites the same email and role
What was checked
  • switchAway discards the name draft before navigating, so the unsaved guard cannot trap a deleted or left org (general-section.tsx:113)
  • ImageDropzone's read-only target still no-ops: openFilePicker and selectFile both bail on !interactive (image-dropzone.tsx:70)
  • DELETION_FACTS matches the purged tables in ORG_SCOPED_TABLES, and the audit log is not in it (OrganizationService.ts:105)

3adcd4e · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@maple-review-bot

maple-review-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 7/10 · likely safe to merge
The delete dialog's copy overstates what deletion erases (25 retained org-scoped tables), and only the pure gating helpers have tests.
quality 90/100 · 1 warning · tests partial · risk medium

Adds a General settings section (logo, name through the save bar, read-only data region, leave and delete) alongside the reworked Members section. Gating and draft handling look right; the new deletion copy misstates what a delete keeps.

  • GeneralSection replaces organization-section.tsx; the name now saves through the save bar
  • Logo saves on upload, the data region is read-only, and the last admin cannot leave
  • leaveEligibility and roleChangePrompt hold the membership rules, with unit tests

Findings

🟠 Warning · F1 · DeletionFacts says only the audit log and billing survive a delete

correctness · apps/web/src/components/settings/general-section.tsx:41

OrganizationService.delete purges ORG_SCOPED_TABLES and deliberately leaves UNPURGED_ORG_SCOPED_TABLES behind — 25 org-keyed tables such as Investigations, AnomalyIncidents, PlanetscaleDatabases, OrgIngestSamplingPolicies and ScrapeTargetChecks (packages/backend/src/services/org/OrganizationService.ts:199). The dialog lists only the audit log and billing as kept, so someone confirming the delete is told their settings and history rows are gone when they remain.

	{ key: "Kept", value: "The audit log, billing records and retained settings and history such as investigations and anomaly detector state.", destructive: false },
🤖 Prompt to fix this finding with an AI agent
Findings from an automated review of commit 258b7675096287c960d8107e9b574770328e85bd. Verify each one against the current code before changing anything, fix only those that still apply, and keep each fix to the lines it names.

---

F1 · Warning · correctness · apps/web/src/components/settings/general-section.tsx:41
`DeletionFacts` says only the audit log and billing survive a delete
`OrganizationService.delete` purges `ORG_SCOPED_TABLES` and deliberately leaves `UNPURGED_ORG_SCOPED_TABLES` behind — 25 org-keyed tables such as `Investigations`, `AnomalyIncidents`, `PlanetscaleDatabases`, `OrgIngestSamplingPolicies` and `ScrapeTargetChecks` (packages/backend/src/services/org/OrganizationService.ts:199). The dialog lists only the audit log and billing as kept, so someone confirming the delete is told their settings and history rows are gone when they remain.
Replace those lines with:
	{ key: "Kept", value: "The audit log, billing records and retained settings and history such as investigations and anomaly detector state.", destructive: false },
What was checked
  • Leave gating reuses admin-only-notice.tsx:30's filtered Clerk admin query; count is Clerk's filtered total
  • Deletion copy read against ORG_SCOPED_TABLES and UNPURGED_ORG_SCOPED_TABLES in OrganizationService.ts:105-225
  • git diff 4950e5d..258b7675 shows the submit/abort draft API is already in the base

258b767 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@maple-review-bot maple-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 inline note from Maple's review. The score and summary are in the review comment above.

Comment thread apps/web/src/components/settings/general-section.tsx Outdated
@maple-review-bot

maple-review-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 8/10 · likely safe to merge
Since the last review only the deletion-facts copy changed, and I verified it against UNPURGED_ORG_SCOPED_TABLES; the rest was reviewed at 258b767.
quality 100/100 · no findings · tests partial · risk medium

The only change since the last review is the deletion-facts copy: the Kept row now names the retained history and settings, matching UNPURGED_ORG_SCOPED_TABLES. The rest of General and Members was reviewed at 258b767; safe to merge.

Fixed since the last review

  • ✅ F1 · DeletionFacts says only the audit log and billing survive a delete
What was checked
  • The Kept row's five names all appear in UNPURGED_ORG_SCOPED_TABLES (OrganizationService.ts:199)
  • organizationHomeRegion(metadata)[0] always indexes MAPLE_REGION_LABELS (organization-regions.ts:79)
  • handleSaveName still pairs submit() with commit({ submitted, sent }) or abort() (settings-draft.ts:120

1408fd2 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@Makisuo

Makisuo commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

Preview test results and traces for the whole stack are on #1531 (all flows passed on the latest deploy).

@Makisuo
Makisuo merged commit ff283f4 into main Oct 17, 2026
32 checks passed
@Makisuo
Makisuo deleted the feat/settings-general-members branch October 17, 2026 14:55
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