feat(view-settings): seed client view defaults for new clients (OUT-3851 soft default)#1311
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR adds workspace-level client default seeding for new client users' first
Confidence Score: 4/5Safe to merge — the seeding logic is self-contained and only fires for new client users with no existing row. The new Only Important Files Changed
Sequence DiagramsequenceDiagram
participant Client as Client User
participant SVC as ViewSettingsService
participant DB as Database
Client->>SVC: getViewSettingsForUser()
SVC->>DB: viewSetting.findFirst(userIds)
DB-->>SVC: null (no row yet)
SVC->>SVC: createInitialViewSettings(userIds)
SVC->>SVC: getClientViewDefaults()
SVC->>DB: workspaceSetting.findUnique(workspaceId)
DB-->>SVC: workspaceSetting (or null)
Note over SVC: clientDefaultViewMode ?? DEFAULT_VIEW_MODE
Note over SVC: clientShowSubtasks ?? true
SVC->>DB: viewSetting.create(data)
DB-->>SVC: new ViewSetting (seeded)
SVC-->>Client: ViewSetting
Note over SVC: IU path: getClientViewDefaults() returns null immediately
Note over SVC: hardcoded defaults used (internalUserId check short-circuits)
|
be07f11 to
d1b0832
Compare
|
Deployment failed with the following error: Learn More: https://vercel.link/multiple-function-regions |
d1b0832 to
d99e75d
Compare
d99e75d to
0825511
Compare
…soft default) PR3 of OUT-3851. When a client user gets their first ViewSettings row, seed viewMode/showSubtasks from the workspace-level client defaults when set. Existing client users and IUs are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…asks Foundation renamed the column to clientHideSubtasks (non-null); seed showSubtasks as its inverse. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0825511 to
d8dcad2
Compare
What & why
PR3 of OUT-3851 — the soft default behavior. Builds on the foundation PR (#1308) and targets that branch.
When a client user gets their first
ViewSettingsrow, seedviewMode/showSubtasksfrom the workspace-level client defaults (when set), instead of the hardcodedboard/showSubtasks: true. The client keeps full control afterward.How
viewSettings.service.tsonly:getClientViewDefaults()— for a client user, returns the workspaceclientDefaultViewMode/clientShowSubtasks;nullfor IUs.createInitialViewSettingsuses those values with fallback to the existing hardcoded defaults.Scope notes
Testing
yarn tscclean for the changed file, eslint 0 errors, prettier clean.🤖 Generated with Claude Code