feat: add writing analytics dashboard and daily word goal tracking

This commit is contained in:
2026-06-11 20:44:16 +05:30
parent 50f4f62575
commit 2389d4f297
19 changed files with 1161 additions and 61 deletions
+10
View File
@@ -21,6 +21,7 @@ interface EditorState {
setCursor: (id: string, line: number, column: number) => void;
closeBuffer: (id: string) => void;
setActive: (id: string) => void;
renameBuffer: (oldId: string, newId: string, newPath: string) => void;
}
export const useEditorStore = create<EditorState>()(
@@ -59,5 +60,14 @@ export const useEditorStore = create<EditorState>()(
set((s) => {
s.activeId = id;
}),
renameBuffer: (oldId, newId, newPath) =>
set((s) => {
const buf = s.buffers.get(oldId);
if (buf) {
s.buffers.delete(oldId);
s.buffers.set(newId, { ...buf, id: newId, path: newPath });
if (s.activeId === oldId) s.activeId = newId;
}
}),
}))
);