mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
fix(activity): roll subagent activity up to its root and accept only selectable windows
- 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
This commit is contained in:
1 parent
8b6251d83b
commit
84cdffa261
22 files changed
+343
-48
No files matched your search
@@ -66,10 +66,18 @@ export type STTConfig = {
|
||||
|
||||
export const DEFAULT_LEADER_KEY = 'Ctrl+X';
|
||||
|
||||
export const DEFAULT_ACTIVITY_WINDOW_MINUTES = 30;
|
||||
|
||||
export const ACTIVITY_WINDOW_MINUTE_OPTIONS = [15, 30, 60, 120, 240, 480, 1440] as const;
|
||||
|
||||
export const ActivityWindowMinutesSchema = z.literal(ACTIVITY_WINDOW_MINUTE_OPTIONS);
|
||||
|
||||
export type ActivityWindowMinutes = z.infer<typeof ActivityWindowMinutesSchema>;
|
||||
|
||||
export const DEFAULT_ACTIVITY_WINDOW_MINUTES: ActivityWindowMinutes = 30;
|
||||
|
||||
export function isActivityWindowMinutes(value: unknown): value is ActivityWindowMinutes {
|
||||
return ActivityWindowMinutesSchema.safeParse(value).success;
|
||||
}
|
||||
|
||||
export const DEFAULT_KEYBOARD_SHORTCUTS = {
|
||||
submit: 'Cmd+Enter',
|
||||
abort: 'Escape',
|
||||
@@ -196,7 +204,7 @@ export const UserPreferencesSchema = z.object({
|
||||
mode: z.enum(["plan", "build"]),
|
||||
defaultModel: z.string().optional(),
|
||||
walkthroughModel: z.string().optional(),
|
||||
activityWindowMinutes: z.number().int().min(5).max(1440).optional(),
|
||||
activityWindowMinutes: ActivityWindowMinutesSchema.optional(),
|
||||
defaultAgent: z.string().optional(),
|
||||
autoScroll: z.boolean(),
|
||||
expandDiffs: z.boolean(),
|
||||
|
||||
Reference in new issue
Block a user