mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
- List child sessions in the activity query and credit each child's latest update to its root, so Recent includes roots whose subagents were active inside the window; children never become rows, and only roots of in-window children are fetched - Show and sort activity rows by that rolled-up time - Restrict activityWindowMinutes to the selectable options on write, and coerce a stored unknown value to the default on read so it cannot reset every preference
22 lines
830 B
TypeScript
22 lines
830 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import {
|
|
ACTIVITY_WINDOW_MINUTE_OPTIONS,
|
|
ActivityWindowMinutesSchema,
|
|
UserPreferencesSchema,
|
|
} from '@opencode-manager/shared/schemas'
|
|
|
|
describe('ActivityWindowMinutesSchema', () => {
|
|
it.each(ACTIVITY_WINDOW_MINUTE_OPTIONS)('accepts the configured option %s', (minutes) => {
|
|
expect(ActivityWindowMinutesSchema.safeParse(minutes).success).toBe(true)
|
|
})
|
|
|
|
it.each([5, 45, 2000, 30.5])('rejects %s', (minutes) => {
|
|
expect(ActivityWindowMinutesSchema.safeParse(minutes).success).toBe(false)
|
|
})
|
|
|
|
it('rejects a non-option value through UserPreferencesSchema', () => {
|
|
expect(UserPreferencesSchema.shape.activityWindowMinutes.safeParse(45).success).toBe(false)
|
|
expect(UserPreferencesSchema.shape.activityWindowMinutes.safeParse(60).success).toBe(true)
|
|
})
|
|
})
|