feat(ui): back and forward also step through task lists and lists
The open task list and the open list are part of the place in the browser history; the app's own choice of a first list replaces the entry. Going back to a task list shows its tasks from memory right away. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
83bba8d20b
commit
b3767ab387
3 files changed
+42
-5
No files matched your search
@@ -1,5 +1,5 @@
|
||||
// In-app back and forward: where the user is (page, open note, workspace view, zoomed bullet, on phones
|
||||
// list or note) goes into the browser history, so the browser's back button (mouse button, Android back)
|
||||
// list or note, open task list and list) goes into the browser history, so the browser's back button (mouse button, Android back)
|
||||
// steps back inside the app instead of leaving it. Each part reports its own piece; changes from one
|
||||
// action (e.g. opening a note from a task switches page and note) become one entry. While the app follows
|
||||
// a back/forward step, reports change nothing: the step itself already is the entry.
|
||||
@@ -10,6 +10,8 @@ export interface NavPlace {
|
||||
view?: string | null; // workspace view: editor, todos, tags, trash, journal …
|
||||
zoom?: string | null; // bullet the open note is zoomed into
|
||||
detail?: boolean; // phones: the note (true) or the list of notes (false)
|
||||
taskList?: string | null; // open task list on the tasks page ("all" for Alle Aufgaben)
|
||||
shopList?: string | null; // open list on the lists page
|
||||
}
|
||||
|
||||
const RESTORE_MS = 600; // the app needs a moment to follow a step (views mount, notes load)
|
||||
@@ -25,7 +27,9 @@ const same = (a: NavPlace, b: NavPlace) =>
|
||||
(a.docId ?? null) === (b.docId ?? null) &&
|
||||
(a.view ?? null) === (b.view ?? null) &&
|
||||
(a.zoom ?? null) === (b.zoom ?? null) &&
|
||||
Boolean(a.detail) === Boolean(b.detail);
|
||||
Boolean(a.detail) === Boolean(b.detail) &&
|
||||
(a.taskList ?? null) === (b.taskList ?? null) &&
|
||||
(a.shopList ?? null) === (b.shopList ?? null);
|
||||
|
||||
function flush() {
|
||||
if (!pending) return;
|
||||
|
||||
Reference in new issue
Block a user