From e16ac15bd15f3ca532e398d65f530e1838e029ae Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Thu, 3 Dec 2026 02:57:25 -0800 Subject: [PATCH] Restore scrolling under retained iOS panes --- shared/src/logseq/view_collaboration.ml | 13 +++++++--- shared/src/logseq/view_screens.ml | 32 ++++++++++++++----------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/shared/src/logseq/view_collaboration.ml b/shared/src/logseq/view_collaboration.ml index 28cdc29b..6578d8f4 100644 --- a/shared/src/logseq/view_collaboration.ml +++ b/shared/src/logseq/view_collaboration.ml @@ -343,7 +343,7 @@ let notification_menu ~android source send = ]; ] -let notification_screen ~bottom_spacing source send = +let notification_screen (context : Lui_ui.ui_context) ~bottom_spacing source send = let items = Signal.map Model.notification_items source in let current = Signal.sample source in let show_error = Signal.map (fun (current : Model.logseq_model) -> current.push_error) source in @@ -358,7 +358,7 @@ let notification_screen ~bottom_spacing source send = let list_scope = Signal.map2 (fun (current : Model.logseq_model) items -> let graph = Option.value ~default:"local" current.selected_graph_id in [Printf.sprintf "notifications:%s:%b:%b" graph current.notifications_recent_only (items = [])]) source items in - View_base.with_reading_insets + let content = View_base.with_reading_insets (box ~grow:1.0 [keyed ~source:list_scope ~key:Fun.id ~cmp:String.compare ~mount:(fun scope -> let list = View_base.with_selected_signal visible (virtual_list ~grow:1.0 ~gap:0 ~style_class:"retained-pane" @@ -425,4 +425,11 @@ let notification_screen ~bottom_spacing source send = ]])) (); box ~height:bottom_spacing []; ]) in - overlay ~grow:1.0 ~alignment:`center [list; if_ ~test:show_empty empty_state])]) + overlay ~grow:1.0 ~alignment:`center [list; if_ ~test:show_empty empty_state])]) in + match Lui_ui.profile context with + | { profile_os = IOS; profile_host = SwiftUIHost } -> + (* On iOS 18.1 the inset container can intercept touches even when + the list inside it is hidden. Gate the whole pane at the stack boundary. *) + View_base.with_selected_signal visible + (box ~grow:1.0 ~style_class:"retained-pane" [content]) + | _ -> content diff --git a/shared/src/logseq/view_screens.ml b/shared/src/logseq/view_screens.ml index c2276435..88b9d350 100644 --- a/shared/src/logseq/view_screens.ml +++ b/shared/src/logseq/view_screens.ml @@ -529,22 +529,26 @@ let retained_journal_pane (context : Lui_ui.ui_context) model_source send if current.home_scroll_request = 0 then "" else "home-top-" ^ string_of_int current.home_scroll_request) model_source) else None in + let visible = + Signal.map + (fun (current : Model.logseq_model) -> + View_base.journal_home_visible_ + { current with + Model.node_routes = []; + app_navigation_path = []; + search_open = false; + search_navigation_path = []; + }) + model_source in let content = root_outliner_view ?scroll_to_top context (Signal.map View_base.journal_navigation_model model_source) - (Signal.map - (fun (current : Model.logseq_model) -> - View_base.journal_home_visible_ - { current with - Model.node_routes = []; - app_navigation_path = []; - search_open = false; - search_navigation_path = []; - }) - model_source) - send - in - box ~grow:1.0 ~accessibility_identifier:"pane.journals" [content] + visible send in + let ios = uses_ios_native_header context in + let pane = box ~grow:1.0 ~accessibility_identifier:"pane.journals" + ?style_class:(if ios then Some "retained-pane" else None) [content] in + (* The retained Home pane sits above the selected page in the SwiftUI stack. *) + if ios then View_base.with_selected_signal visible pane else pane let journal_tree_panes (context : Lui_ui.ui_context) model_source send : t = @@ -617,7 +621,7 @@ let logseq_main_view (context : Lui_ui.ui_context) model_source send : t ~uses_header:(uses_ios_native_header context || Lui_ui.host context = KotlinHost) ~bottom_spacing:(if uses_ios_native_header context then 64 else 88) shell_model send); - View_collaboration.notification_screen + View_collaboration.notification_screen context ~bottom_spacing:(if uses_ios_native_header context then 72 else 80) shell_model send; if_ ~test:(Signal.map View_base.graphs_destination_ shell_model)