feat(workspace): journal panel toggle, view kept across tabs, sections nest under headings
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 2m9s

- the journal opens as a framed panel and closes on a second click,
  returning to the previous note; journal state and the last regular note
  survive tab switches, the fallback note is never a journal day
- pasted and imported markdown nests content under its heading (H2 below
  H1), Enter on a heading creates a child, '- ' / '* ' / '+ ' start a bullet

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
sandrodachandClaude Opus 5.5 committed 2026-10-30 20:11:09 +01:00
1 parent bc7bdc481e
commit 375dda982b
9 files changed
+145 -36

No files matched your search

+20
View File
@@ -60,3 +60,23 @@ export function monthGrid(year: number, month: number): (string | null)[][] {
for (let i = 0; i < cells.length; i += 7) weeks.push(cells.slice(i, i + 7));
return weeks;
}
// Workspace state for this browser tab: is the journal open, which regular note was open last
const WORKSPACE_SESSION_KEY = 'mindsift_workspace_view';
export function readWorkspaceSession(): { journal: boolean; docId: string | null } {
try {
const raw = JSON.parse(sessionStorage.getItem(WORKSPACE_SESSION_KEY) || '{}');
return { journal: raw.journal === true, docId: typeof raw.docId === 'string' ? raw.docId : null };
} catch {
return { journal: false, docId: null };
}
}
export function writeWorkspaceSession(state: { journal: boolean; docId: string | null }) {
try {
sessionStorage.setItem(WORKSPACE_SESSION_KEY, JSON.stringify(state));
} catch {
// storage blocked: the view simply starts fresh
}
}