Skip to content

Adapt Logseq journals and navigation to iPhone Duo - #297

Open
tiensonqin wants to merge 6 commits into
mainfrom
codex/iphone-duo-reading
Open

tiensonqin wants to merge 6 commits into
mainfrom
codex/iphone-duo-reading

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Put Journals, Tasks, and Notifications on the system's side tab bar on iPhone Duo.
  • Show one journal date on each side of the unfolded display. Horizontal swipes turn the two-day spread with a small, gesture-driven tilt. Reduce Motion keeps the spread flat.
  • Keep the graph switch in the Journals heading on the cover display and in the active journal pane when unfolded. Opening the sidebar adjusts its position with the available space. PDF and search use their own controls.
  • Open PDFs in the left pane and keep notes on the right, including in right-to-left languages.

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

  • Built the iOS simulator app and exercised both Duo displays, the graph menu, page turns, the native sidebar, and the PDF workspace in Device Hub.
  • Passed the iPhone graph-title and PDF workspace runtime checks.
  • Passed all 1,472 OCaml core tests.

Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 5 potential issues.

Devin Review

Comment on lines +610 to +620
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +606 to +609
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +560 to +567
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])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +606 to +609
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 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.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +240 to 245
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Toolbar test misses side tab taps

DuoToolbarLayoutCheck measures the combined rail but hit-tests only capture actions. It can pass with Journals, Tasks, or Notifications missing or untappable.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant