Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apple/Sources/Logseq/LGNavigationExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,15 @@ private struct LGSidebarNavigation: View {
child(at: 1)
.lineLimit(1)
.truncationMode(.middle)
.frame(maxWidth: LGNavigationSurfacePolicy.sidebarGraphWidth(geometry.size.width))
.frame(width: LGNavigationSurfacePolicy.sidebarGraphWidth(geometry.size.width), alignment: .leading)
}
.sharedBackgroundVisibility(.hidden)
ToolbarItem(placement: .topBarTrailing) { child(at: 2) }
.sharedBackgroundVisibility(.hidden)
} else {
ToolbarItem(placement: .topBarLeading) {
child(at: 1).lineLimit(1).truncationMode(.middle)
.frame(maxWidth: LGNavigationSurfacePolicy.sidebarGraphWidth(geometry.size.width))
.frame(width: LGNavigationSurfacePolicy.sidebarGraphWidth(geometry.size.width), alignment: .leading)
}
ToolbarItem(placement: .topBarTrailing) { child(at: 2) }
}
Expand Down
6 changes: 4 additions & 2 deletions apple/Tests/UI/sidebar-long-graph-name.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ import UIKit
}
try await Task.sleep(for: .milliseconds(600))
try backend.performPress(node: node("button.sidebar"))
for name in ["Short", "Abhilesh_Knowledge_Graph", String(repeating: "Long graph name ", count: 8), "Short again"] {
for name in ["My notes", "Short", "Abhilesh_Knowledge_Graph", String(repeating: "Long graph name ", count: 8), "Short again"] {
try runtime.applyCoreResponse(snapshot(name))
try backend.performToggle(node: node("application.shell"), checked: true)
try await Task.sleep(for: .milliseconds(800))
let settingsID = try node("button.sidebar.settings")
let graphID = try node("button.graph-switch")
Expand All @@ -47,9 +48,10 @@ import UIKit
}
guard let settings = frames[settingsID], let graph = frames[graphID],
settings.width >= 40, settings.height >= 40,
graph.minX >= 12, graph.width >= 80,
window.bounds.contains(settings), window.bounds.contains(graph),
settings.minX >= graph.maxX - 1 else {
throw failure("Global settings must remain visible and unobscured for graph \(name): settings=\(String(describing: frames[settingsID])) graph=\(String(describing: frames[graphID]))")
throw failure("The graph switch must fit its label without clipping and preserve Settings for graph \(name): settings=\(String(describing: frames[settingsID])) graph=\(String(describing: frames[graphID]))")
}
}
try backend.performPress(node: node("button.sidebar.settings"))
Expand Down
6 changes: 4 additions & 2 deletions shared/src/logseq/view_outliner.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1059,8 +1059,10 @@ let outliner_editor_toolbar (context : Lui_ui.ui_context) model_source send
Option.fold ~none:false ~some:(fun editing ->
List.exists (fun (row : Model.outline_row) -> row.row_uuid = editing.Model.editing_uuid
&& row.row_display_type = Some "code") current.outliner_rows) current.outliner_editing) model_source)
(button ~icon:(`app "add") ~variant:`ghost ~size:`icon
~width:(if Lui_ui.host context = KotlinHost then 48 else 38) ~height:42
(button ~icon:(`app "add") ~variant:`ghost
?size:(if Lui_ui.host context = KotlinHost then Some `icon else None)
~width:(if Lui_ui.host context = KotlinHost then 48 else 38)
~height:(if Lui_ui.host context = KotlinHost then 48 else 42)
~label:(View_base.tr (Signal.sample model_source) "Create new block")
~accessibility_identifier:"button.outliner.editor.newBlock"
~on_press:(fun _ -> ignore (send (Model.PerformOutlinerToolbarAction "newBlock"))) []) in
Expand Down
2 changes: 1 addition & 1 deletion shared/src/logseq/view_sidebar.ml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ let sidebar_graph_switch (context : Lui_ui.ui_context) model_source send : t =
[ sidebar_graph_switch_content model_source ])
else
View_base.with_label "Switch graph"
(button ~variant:`ghost ~min_height:44
(button ~variant:`ghost ~min_height:44 ~grow:1.0
~text_signal:(Signal.map View_base.graph_label model_source)
~text_alignment:`start ~style_class:"semibold" ~foreground:"foreground"
~icon:(`app "chevron-down") ~icon_placement:`trailing
Expand Down
4 changes: 4 additions & 0 deletions shared/test/logseq/editor_command_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,10 @@ let code_toolbar_creates_a_block_without_a_hardware_keyboard () =
let host = Lui_app.runtime app in
let button = App_test.descendant_with_identifier host (Lui_app.root_node app) "button.outliner.editor.newBlock" in
check ~msg:"the software keyboard exposes New block for Code and Calculator" (button <> -1);
let neighbor = App_test.descendant_with_identifier host (Lui_app.root_node app) "button.outliner.editor.moveDown" in
List.iter (fun key -> check_eq ~msg:"New block matches neighboring toolbar controls"
(App_test.property host button key) (App_test.property host neighbor key))
[Lui_protocol.WidthValue; Lui_protocol.HeightValue; Lui_protocol.SizeValue; Lui_protocol.VariantValue];
App_test.dispatch app (Lui_protocol.Press button); App_test.flush app;
check ~msg:"the native toolbar forwards the shared structural action"
(List.exists (function Model.OutlinerToolbarEffect (_, "newBlock") -> true | _ -> false)
Expand Down
Loading