Repository navigation
Adapt Logseq journals and navigation to iPhone Duo - #297
tiensonqin wants to merge 6 commits into
Conversation
| let empty = Signal.map (fun rows -> rows = []) recorded_rows in | ||
| box ~grow:1.0 ~accessibility_identifier:("journal.duo.day." ^ string_of_int day) [ | ||
| if_ ~test:empty | ||
| (column ~padding:16 [ | ||
| View_outliner.page_heading_text ~tracks_scroll_title:false | ||
| ~accessibility_identifier:"journal.duo.empty-title" | ||
| (Signal.map (fun current -> View_base.journal_display_title current (Some day) | ||
| (Journal.day_title day)) model_source); | ||
| spacer ~grow:1.0 []; | ||
| ]); | ||
| if_ ~test:(Signal.map not empty) (root_outliner_view context projection visible send) |
There was a problem hiding this comment.
🟡 Missing Add block on empty journals
On an existing empty journal, duo_journal_book shows a static heading instead of the Add block control. The unfolded pane offers no way to start editing that journal inline.
Learn more
The core sends existing journal pages with no blocks separately from the block rows, as verified by empty_journal_pages_keep_their_heading. The normal journal_entries projection uses that page metadata to create an Add block placeholder. Duo switches to the static heading whenever there are no rows, even when it has an existing page with a valid insertion target.
Example: Open the unfolded view on a graph with an existing, empty journal for today. Today's pane shows a date but offers no Add block control; the classic Journals list offers it for the same page.
Recommended fix: Give each spread pane the empty-journal metadata for its own date. Render the regular outliner when either rows or an existing journal page are available, and keep the title-only fallback for dates with no existing page.
Was this helpful? React with 👍 or 👎 to provide feedback.
| let projection = Signal.map2 (fun (current : Model.logseq_model) rows -> | ||
| View_base.journal_navigation_model | ||
| {current with journal_outliner_rows = rows; has_older_journals = false}) | ||
| model_source recorded_rows in |
There was a problem hiding this comment.
🟡 Empty journals appear in unrelated panes
When a graph has empty journals, projection passes them all to every populated pane. journal_entries inserts their headings and Add block controls alongside that pane’s own date.
Learn more
Each pane receives the block rows for a single date. The journal_navigation_model uses those rows but leaves the graph-wide list of empty pages unchanged. journal_entries merges those empty pages into the list with their own headings and insertion controls.
Example: Today and yesterday have blocks, and Monday is an existing empty journal. Monday appears under both today's and yesterday's content, even though each pane represents a different date.
Recommended fix: Restrict empty_journals to the pane's date in the same projection that filters journal_outliner_rows. Check a spread with two populated dates and an empty journal outside the spread.
Was this helpful? React with 👍 or 👎 to provide feedback.
| let window = Signal.map2 (fun (active, index) ((anchor, days), has_more) -> | ||
| if not active then [] else | ||
| let oldest = Hashtbl.fold (fun day _ oldest -> min day oldest) days anchor in | ||
| List.filter (fun candidate -> | ||
| candidate >= 0 | ||
| && (candidate = index || has_more | ||
| || Option.fold ~none:false ~some:(fun day -> day >= oldest) | ||
| (day_plus anchor (-2 * candidate)))) [index - 1; index; index + 1]) |
There was a problem hiding this comment.
🟡 Journal paging skips older empty dates
Once all history has loaded, window stops at the oldest date with blocks. Empty journals on earlier spreads never get their own pane.
Learn more
The book calculates its paging bounds from the dates in journal_outliner_rows. The core exposes loaded empty journals separately through empty_journals. When there are no more journals to fetch, the book rejects any spread whose newer date is older than the minimum date in the rows. That excludes an already-loaded empty journal if it is in a spread beyond that bound.
Example: Today has blocks and the graph's only other journal is an empty one from four days ago. After those two journals load, the book no longer offers any spread earlier than today and yesterday.
Recommended fix: Include dates from loaded empty_journals in the history bounds and use the same oldest-date calculation for the prefetch check. Test a graph whose oldest spread has an existing empty page but no blocks.
Was this helpful? React with 👍 or 👎 to provide feedback.
| let projection = Signal.map2 (fun (current : Model.logseq_model) rows -> | ||
| View_base.journal_navigation_model | ||
| {current with journal_outliner_rows = rows; has_older_journals = false}) | ||
| model_source recorded_rows in |
There was a problem hiding this comment.
🔍 Journal panes displace cached section markers
On each model update, active Duo panes reuse a single-entry marker cache for different row lists. Typing can rebuild markers for unchanged dates, so Release-device edit measurements matter here.
Was this helpful? React with 👍 or 👎 to provide feedback.
| let railFrame = rail.convert(rail.bounds, to: window) | ||
| guard window.bounds.maxY - railFrame.maxY <= max(44, window.safeAreaInsets.bottom + 10) else { | ||
| throw failure("Side controls must stay near the bottom edge, without a duplicate safe-area inset: \(railFrame)") | ||
| } | ||
| guard actionFrames.allSatisfy({ frame in | ||
| window.hitTest(CGPoint(x: frame.midX, y: frame.midY), with: nil)?.isDescendant(of: rail) == true |
Summary
iPhone Duo recording
Field Notes on the cover and inner displays, including the graph menu, page turns, Favorites and Recents, and the PDF workspace.
duo-field-notes-pr.mp4
Verification