Files
PaperClipAI/ui/src/lib/recent-projects.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

31 lines
854 B
TypeScript

import {
readRecentSelectionIds,
trackRecentSelectionId,
} from "./recent-selections";
const STORAGE_KEY = "paperclip:recent-projects";
export function getRecentProjectIds(): string[] {
return readRecentSelectionIds(STORAGE_KEY);
}
/** Undefined means no history; an empty string remembers an explicit No project. */
export function getLastProjectId(companyId: string): string | undefined {
try {
return localStorage.getItem(`${STORAGE_KEY}:${companyId}`) ?? undefined;
} catch {
return undefined;
}
}
export function trackRecentProject(projectId: string, companyId?: string): void {
trackRecentSelectionId(STORAGE_KEY, projectId);
if (companyId) {
try {
localStorage.setItem(`${STORAGE_KEY}:${companyId}`, projectId);
} catch {
// Selection remains usable when browser storage is unavailable.
}
}
}