Repository navigation
feat(columns): context menu from column headers - #1942
Conversation
Keep folder actions reachable when entries fill a Miller column by opening its existing folder menu from the header. Refs lgse#1916
wmfeht
left a comment
There was a problem hiding this comment.
The header gesture looks correct: button rejection through is_column_background, the header-to-stack coordinate conversion (the popover helpers re-run compute_point, so the negative y is fine) and the chooser path all hold up. Two suggestions inline, mainly to keep QA run time down.
| {"wait":{"panes":{"excludes":["nested"]}},"message":"keyboard selection to close the nested pane","variants":["root-header","nested-header"]} | ||
| {"settle":{"role":"label","name":"documents","description":"$fixture/documents","within":{"pane":"documents"}},"variants":["root-header","nested-header"]} | ||
| {"click":{"role":"label","name":"documents","description":"$fixture/documents","within":{"pane":"documents"}},"button":3,"variants":["root-header","nested-header"]} | ||
| {"wait":{"present":{"menu_item":"New Folder"}},"message":"the header folder menu to offer New Folder","variants":["root-header","nested-header"]} | ||
| {"settle":{"menu_item":"New Folder"},"variants":["root-header","nested-header"]} | ||
| {"click":{"menu_item":"New Folder"},"variants":["root-header","nested-header"]} | ||
| {"wait":{"field":{}},"message":"the new folder name editor","variants":["root-header","nested-header"]} | ||
| {"key":"ctrl+a","variants":["root-header","nested-header"]} | ||
| {"type":"header-created","variants":["root-header","nested-header"]} | ||
| {"wait":{"field":{"text":"header-created"}},"message":"the new folder name to be entered","variants":["root-header","nested-header"]} | ||
| {"key":"Return","variants":["root-header","nested-header"]} | ||
| {"fs":{"path":"documents/header-created","exists":true},"message":"New Folder from the header to create inside documents","variants":["root-header","nested-header"]} | ||
| {"fs":{"path":"documents/nested/header-created","exists":false},"timeout_ms":0,"variants":["root-header","nested-header"]} | ||
| {"fs":{"path":"header-created","exists":false},"timeout_ms":0,"variants":["root-header","nested-header"]} |
There was a problem hiding this comment.
Suggest running this New Folder block in only one header variant (for example root-header) to trim QA run time.
By the time these steps run, Down has selected notes.txt and the excludes: ["nested"] wait has confirmed nested is closed, so root-header and nested-header reach this block in the same state and execute it identically. The second variant adds ~0.7 s without exercising anything new, and AGENTS.md asks that every variant dimension affect the exercised behaviour. Restricting lines 37–50 to one variant (and lowering the other variant's cost back to ~1.4) keeps the same coverage.
| let header_context_click = gtk::GestureClick::new(); | ||
| header_context_click.set_button(3); | ||
| let open_folder_context = folder_context_trigger.clone(); | ||
| let context_anchor = presentation.stack.downgrade(); | ||
| header_context_click.connect_pressed(move |gesture, _, x, y| { | ||
| let (Some(header), Some(anchor)) = (gesture.widget(), context_anchor.upgrade()) else { | ||
| return; | ||
| }; | ||
| let Some(picked) = header.pick(x, y, gtk::PickFlags::DEFAULT) else { | ||
| return; | ||
| }; | ||
| if !is_column_background(&header, &picked) { | ||
| return; | ||
| } | ||
| let Some(point) = | ||
| header.compute_point(&anchor, >k::graphene::Point::new(x as f32, y as f32)) | ||
| else { | ||
| return; | ||
| }; | ||
| gesture.set_state(gtk::EventSequenceState::Claimed); | ||
| open_folder_context(f64::from(point.x()), f64::from(point.y())); | ||
| }); | ||
| header.add_controller(header_context_click); |
There was a problem hiding this comment.
Minor, optional: this mirrors the right-click gesture inside install_folder_context_menu (context_menu.rs, pick → filter → claim → open), with a coordinate conversion and is_column_background instead of is_item_target. If more header-style triggers are expected, letting install_folder_context_menu (and chooser_context::install_folder) accept extra trigger surfaces with their own filter would keep the open logic in one place. Fine as is otherwise.
Both header variants reach the New Folder steps in the same state, so the second run repeated identical work.
Review and cleanupMerged Review against the description and #1916. Confirmed. Right-clicking a Miller column's title or empty header space opens that column's folder menu, using the same Reviewer feedback (@wmfeht)
Fixes pushed
Tests. No tautological tests. The scenario's header variants fail without the change. The PR adds no code comments. Validation
CI: all checks green as of 04:47 UTC (QA scenarios job is dispatch-only and skipped on PRs). |
Sync lgse/strata#1942–#1966: printing removed, column-header menu, LUKS lock, EACCES placement
Description
Right-click a Miller column's title or header space to open that column's existing folder menu. This keeps New Folder, Paste and other folder actions reachable when entries fill the column. Header buttons keep their existing behaviour.
Visual evidence
How to test
Expected result: The menu opens beside the header click, New Folder creates inside the clicked column's folder, and keyboard navigation resumes in that column. Header controls and existing item/background menus continue to work.
Related issue
Closes #1916