Skip to content

Fix mobile Recent navigation and Android surfaces - #323

Open
tiensonqin wants to merge 2 commits into
mainfrom
codex/android-recent-and-ui-fixes
Open

tiensonqin wants to merge 2 commits into
mainfrom
codex/android-recent-and-ui-fixes

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Changes

  • Update Recent on iOS and Android when a page is opened through a journal link, search, or the sidebar. Store the visit order locally per graph and retain the existing edited-page fallback.
  • Use the in-sheet sign-in progress indicator on Android, present compact Material confirmation alerts, and center the search empty state in the available viewport.
  • Give Android’s dark-mode glass circles and capsules a translucent black fill and a subtle rim, using the iOS dark appearance as the visual reference.

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.
  • Android 16 emulator with the shared core and Compose renderer. Checked sign-in progress, search centering, all three confirmation dialogs, search result visits, and dark glass.
  • iPhone 17 Pro simulator running iOS 27.2. Opened a page from search and from a journal link, checked the sidebar, and verified the local Recent order after relaunch.

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 2 potential issues.

Devin Review

Comment on lines +30 to +31
let visits = List.take Graph_read.recent_page_limit (uuid :: List.filter ((<>) uuid) previous) in
Hashtbl.replace session.recent_page_visits graph_id visits;

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.

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

Devin Review


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;

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.

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

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