Files
PaperClipAI/ui/src/lib/recent-composer-effort.ts
T
DottaandPaperclip 2c43b39167 refactor(ui): share task composer and project/worktree controls (#15091)
Use the shared composer for new tasks, including project and worktree selection, rich mentions and slash commands, and remembered task settings.

Save project preferences after successful task updates. Show known agent models by name and use Default for unknown runtime defaults.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-05 18:06:40 -05:00

22 lines
763 B
TypeScript

const STORAGE_KEY = "paperclip:composer-effort";
/** Undefined means no preference; null is the user's explicit Default choice. */
export function getLastComposerEffort(companyId: string): string | null | undefined {
try {
const raw = localStorage.getItem(`${STORAGE_KEY}:${companyId}`);
if (raw === null) return undefined;
const value: unknown = JSON.parse(raw);
return value === null || typeof value === "string" ? value : undefined;
} catch {
return undefined;
}
}
export function rememberComposerEffort(companyId: string, effort: string | null): void {
try {
localStorage.setItem(`${STORAGE_KEY}:${companyId}`, JSON.stringify(effort));
} catch {
// The current run setting still works without persistent storage.
}
}