Repository navigation
Fix mobile Recent navigation and Android surfaces - #323
tiensonqin wants to merge 2 commits into
Conversation
| let visits = List.take Graph_read.recent_page_limit (uuid :: List.filter ((<>) uuid) previous) in | ||
| Hashtbl.replace session.recent_page_visits graph_id visits; |
There was a problem hiding this comment.
🟡 Favorites evict pages from Recent
When visit history is full, record_page_visit lets a newly opened favorite evict the oldest visit. merge_recent_pages then hides the favorite, so Recent loses a visited page without showing a new one.
Learn more
The sidebar keeps Favorites and Recent separate. merge_recent_pages filters favorites out of Recent and fills any spare slots with recently edited pages. But select_page records favorite visits before that filter runs. The saved list has already lost its oldest entry by the time the merge drops the favorite.
Example: Open 15 non-favorite pages, starting with an old page that does not qualify for the edited-page fallback. Open a favorite from the sidebar. The old page disappears from Recent even though the favorite stays in Favorites.
Recommended fix: Keep favorite visits outside the capped candidate list for Recent, or filter them out before trimming the stored list. Add a regression test that opens a favorite after filling all 15 visit slots and checks that the displayed order remains unchanged after relaunch.
Was this helpful? React with 👍 or 👎 to provide feedback.
| let _, zoom = So.sidebar_node_destination session page in | ||
| let destination, zoom = So.sidebar_node_destination session page in | ||
| set_sidebar_page session page ~zoom; | ||
| So.record_page_visit session destination.uuid; |
There was a problem hiding this comment.
🟡 Reselecting a page leaves Recent unchanged
After opening another page in search and closing search, tapping the displayed page again never reaches select_page. SelectSidebarPage reuses the loaded page, leaving the searched page first in Recent.
Learn more
A page selected from the sidebar stays selected behind the search presentation. OpenSearch opens search without clearing that selection, and CloseSearch closes the search routes. The core promotes the searched page when it opens the route. Once search is closed, SelectSidebarPage skips the core effect when the tapped page is already loaded. The core never sees the explicit sidebar tap, so it cannot update the saved order.
Example: Open Alpha from Recent, open Beta in search, then close search to return to Alpha. Reopen the sidebar and tap Alpha. Recent still starts with Beta the next time the sidebar opens.
Recommended fix: Record explicit sidebar selections even when page content is reusable. Use a lightweight visit effect on the reuse branch, or move the reuse check into core selection after recording the visit so it can publish the new order without reloading the page.
Was this helpful? React with 👍 or 👎 to provide feedback.
Changes
Before and after
mobile-before-after.mp4
The Android recording uses the same offline fixture and Android 16 emulator on both builds. The first comparison includes the iOS 27.2 reference.
iOS Recent from a journal link
ios-journal-recent.mp4
Verification
dune build @shared/native/runtest, including offline restart, graph isolation, Recent ordering and deduplication.