Cascade client view default to existing clients with confirmation#1319
Conversation
Apply a workspace client-view default change to every existing client's view setting atomically, and confirm the destructive override in the IU before persisting. - Wrap the workspace-setting update and per-client cascade in a single transaction so they commit together - Only cascade values that actually changed - Show a confirmation modal before applying; guard no-op dropdown changes Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR adds a confirmation step before cascading a workspace-level client-view default to all existing clients, and wraps the workspace-setting update plus the per-client
Confidence Score: 5/5Safe to merge; the transaction logic, diff-only cascade, and UI rollback path all hold up under inspection. The transaction wraps both writes atomically, the try/finally guard correctly restores this.db even when the cascade throws, and the optimistic-update rollback in the UI captures the right prior state. The only finding is a dangling aria-labelledby/aria-describedby pair on the confirmation modal that has no functional impact on the cascade logic itself. The ARIA attributes on the StyledModal in ClientViewSettingsSection.tsx reference IDs that ConfirmUI does not render — worth fixing before this ships to ensure the modal is accessible to screen-reader users. Important Files Changed
Sequence DiagramsequenceDiagram
actor User
participant UI as ClientViewSettingsSection
participant API as updateWorkspaceSettings (action)
participant Svc as WorkspaceSettingsService
participant DB as Prisma / DB
User->>UI: Changes dropdown or switch
UI->>UI: setPendingSettings(next)
UI->>User: Show confirmation modal
User->>UI: Clicks "Apply to all clients"
UI->>UI: setPendingSettings(null) — closes modal
UI->>UI: setSettings(next) — optimistic update
UI->>API: updateWorkspaceSettings(token, next)
API->>Svc: updateWorkspaceSettings(data)
Svc->>DB: $transaction start
DB-->>Svc: tx client
Svc->>Svc: setTransaction(tx)
Svc->>DB: workspaceSetting.findUnique (previous)
DB-->>Svc: previous row
Svc->>DB: workspaceSetting.update(data)
DB-->>Svc: updated row
Svc->>Svc: diff(previous, data) → cascade fields
Svc->>DB: viewSetting.updateMany (all clients in workspace)
DB-->>Svc: n rows updated
Svc->>Svc: unsetTransaction()
DB-->>API: commit
API-->>UI: success
UI->>User: Settings applied
alt API error
DB-->>Svc: error (rollback)
Svc->>Svc: unsetTransaction() [finally]
API-->>UI: error
UI->>UI: setSettings(previous) — rollback
UI->>User: Settings reverted
end
Reviews (2): Last reviewed commit: "Restore db handle in finally so cascade ..." | Re-trigger Greptile |
Addresses Greptile P1: unsetTransaction() only ran on the happy path, so a DB error inside the cascade left this.db pointing at the expired transaction client. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Deployment failed with the following error: Learn More: https://vercel.link/multiple-function-regions |
4de371a
into
anit/out-3851-cu-view-settings-foundation
What
Applies a workspace client-view default change to every existing client's view setting, with an IU confirmation step before the destructive override.
Stacked on top of
anit/out-3851-cu-view-settings-foundation.Changes
workspaceSettings.service.tsupdateManyin a single$transaction(using the repo'ssetTransaction/unsetTransactionpattern) so they commit atomically.clientHideSubtasksmaps to the inverse of the per-usershowSubtasksflag.ClientViewSettingsSection.tsxNotes
StyledModalfollow the existing repo-wideConfirmUIconvention.Screenshots
New confirmation UI
2026-06-15.16-11-16.mov
🤖 Generated with Claude Code