feat(PBI-76): extend UserSettings schema with layout

Adds layout.splitPanePositions and layout.activeSprints. These will
hold values currently kept in client-side and server-side cookies
(Phase 2). Two new tests cover the shape.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Janpeter Visser 2026-05-10 15:18:19 +02:00
parent 852945efa3
commit a2267502ba
2 changed files with 16 additions and 0 deletions

View file

@ -109,7 +109,17 @@ describe('UserSettingsSchema', () => {
jobsColumns: { 'queue:active': { kinds: ['TASK_IMPLEMENTATION'], statuses: [] } },
},
devTools: { debugMode: true },
layout: {
splitPanePositions: { 'backlog-pid': [25, 35, 40] },
activeSprints: { 'product-1': 'sprint-1' },
},
})
expect(result.success).toBe(true)
})
it('accepts layout-only settings', () => {
expect(UserSettingsSchema.safeParse({
layout: { splitPanePositions: { x: [50, 50] }, activeSprints: { p: 's' } },
}).success).toBe(true)
})
})

View file

@ -43,9 +43,15 @@ const DevToolsPrefs = z.object({
debugMode: z.boolean().optional(),
}).strict()
const LayoutPrefs = z.object({
splitPanePositions: z.record(z.string(), z.array(z.number())).optional(),
activeSprints: z.record(z.string(), z.string()).optional(),
}).strict()
export const UserSettingsSchema = z.object({
views: ViewsPrefs.optional(),
devTools: DevToolsPrefs.optional(),
layout: LayoutPrefs.optional(),
}).strict()
export type UserSettings = z.infer<typeof UserSettingsSchema>