This commit is contained in:
tintinweb
2026-03-17 18:46:39 +01:00
parent c6769fdab1
commit ccddf93590
10 changed files with 160 additions and 46 deletions
+13 -12
View File
@@ -28,6 +28,17 @@ export async function openSettingsMenu(
): Promise<void> {
await ui.custom((_tui, theme, _kb, done) => {
const items: SettingItem[] = [
{
id: "taskScope",
label: "Task storage",
description:
"memory: tasks live only in memory, lost when session ends. " +
"session: persisted per session (tasks-<sessionId>.json), survives resume. " +
"project: shared across all sessions (tasks.json). " +
"Takes effect on next session start.",
currentValue: cfg.taskScope ?? "session",
values: ["memory", "session", "project"],
},
{
id: "autoCascade",
label: "Auto-execute with agents",
@@ -37,16 +48,6 @@ export async function openSettingsMenu(
currentValue: (cfg.autoCascade ?? false) ? "on" : "off",
values: ["on", "off"],
},
{
id: "persist",
label: "Persist tasks across sessions",
description:
"When ON: pending and in-progress tasks are saved to .pi/tasks/tasks.json so they " +
"survive a restart. Completed tasks are never written to disk. " +
"Toggle takes effect on next session start.",
currentValue: (cfg.persistTasks ?? true) ? "on" : "off",
values: ["on", "off"],
},
];
const list = new SettingsList(
@@ -58,8 +59,8 @@ export async function openSettingsMenu(
cfg.autoCascade = newValue === "on";
saveTasksConfig(cfg);
}
if (id === "persist") {
cfg.persistTasks = newValue === "on";
if (id === "taskScope") {
cfg.taskScope = newValue as "memory" | "session" | "project";
saveTasksConfig(cfg);
}
},
+4
View File
@@ -75,6 +75,10 @@ export class TaskWidget {
constructor(private store: TaskStore) {}
setStore(store: TaskStore) {
this.store = store;
}
setUICtx(ctx: UICtx) {
this.uiCtx = ctx;
}