cbfdf5289e
Phase 5: Multi-user authentication with session cookies, bcrypt passwords, first-user-is-admin pattern, per-user data isolation, backup/restore, Docker Swarm production stack with secrets and network isolation. Phase 5.1: Chat UX improvements: - Background generation architecture (GenerationBuffer + asyncio task) with SSE fan-out, reconnect support, and periodic DB flushes - LLM-generated conversation titles (first exchange + every 10th message) - Stop generation button with cancel_event and partial content preservation - Relative timestamps in sidebar (5m ago, 3h ago, then dates) - Empty chat auto-cleanup on navigation away - Save-as-note uses LLM for title generation, tags notes with "chat" - Summarize-as-note also tags with "chat" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
29 lines
677 B
TypeScript
29 lines
677 B
TypeScript
import { ref } from "vue";
|
|
import { defineStore } from "pinia";
|
|
|
|
export interface Toast {
|
|
id: number;
|
|
message: string;
|
|
type: "success" | "error" | "warning";
|
|
}
|
|
|
|
let nextId = 0;
|
|
|
|
export const useToastStore = defineStore("toast", () => {
|
|
const toasts = ref<Toast[]>([]);
|
|
|
|
function show(message: string, type: "success" | "error" | "warning" = "success") {
|
|
const id = nextId++;
|
|
toasts.value.push({ id, message, type });
|
|
setTimeout(() => {
|
|
toasts.value = toasts.value.filter((t) => t.id !== id);
|
|
}, 4000);
|
|
}
|
|
|
|
function dismiss(id: number) {
|
|
toasts.value = toasts.value.filter((t) => t.id !== id);
|
|
}
|
|
|
|
return { toasts, show, dismiss };
|
|
});
|