Skip to content

feat(columns): context menu from column headers - #1942

Merged
l0gicgate merged 3 commits into
lgse:mainfrom
adamcbrewer:feat/1916-column-header-context-menu
Oct 31, 2026
Merged

l0gicgate merged 3 commits into
lgse:mainfrom
adamcbrewer:feat/1916-column-header-context-menu

Conversation

@adamcbrewer

@adamcbrewer adamcbrewer commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

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

image

How to test

  1. Open Columns view and navigate into a child folder so several columns are visible. Use a folder with enough entries to fill a column.
  2. Right-click a parent column's title, choose New Folder and give it a name.
  3. Open the header menu again, dismiss it with Escape and use the arrow keys.

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

Keep folder actions reachable when entries fill a Miller column by opening its existing folder menu from the header.

Refs lgse#1916
@adamcbrewer
adamcbrewer marked this pull request as ready for review October 30, 2026 09:28
@adamcbrewer adamcbrewer changed the title feat(columns): open folder menus from column headers feat(columns): context menu from column headers Oct 30, 2026

@wmfeht wmfeht left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +37 to +50
{"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"]}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/ui/browser/columns.rs
Comment on lines +2008 to +2030
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, &gtk::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);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@l0gicgate

Copy link
Copy Markdown
Contributor

Review and cleanup

Merged main at e0c724aac. No conflicts.

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 folder_context_trigger as the empty column area (the chooser path included). Header buttons, menu buttons and the filter entry keep their own right-click, because is_column_background rejects them. The header-to-stack point conversion is correct. New Folder from the header creates inside the clicked column's folder, and keyboard navigation resumes in that column. The right-click gesture doesn't interfere with the header's left-button controllers (background focus click, marquee drag). Removing the header gesture makes both *-header variants fail at "the background context menu to open", so the scenario guards the feature.

Reviewer feedback (@wmfeht)

  • New Folder block in one variant: addressed in 5fd0ea343. Both header variants reach those steps in the same state, so the block now runs only in root-header, and columns-nested-header cost is back to 1.4.
  • Shared trigger-surface helper: left as is. There's only one extra trigger surface so far, and the reviewer marked it optional.

Fixes pushed

  • 5fd0ea343 test(columns): run header New Folder check in one variant. The second run repeated identical work.

Tests. No tautological tests. The scenario's header variants fail without the change. The PR adds no code comments.

Validation

  • ./scripts/qa.sh --test-threads 6 context-menu-keeps-column-target: 6 passed
  • Same scenario's header variants with the header gesture removed: 2 failed, as expected
  • ./scripts/quality.sh fmt, ./scripts/quality.sh clippy: clean
  • Not run: the full Rust and QA suites. The change is limited to one gesture in columns.rs plus one scenario.

CI: all checks green as of 04:47 UTC (QA scenarios job is dispatch-only and skipped on PRs).

@l0gicgate
l0gicgate merged commit 7051024 into lgse:main Oct 31, 2026
11 checks passed
wmfeht added a commit to wmfeht/strata-feature-map that referenced this pull request Nov 1, 2026
Sync lgse/strata#1942–#1966: printing removed, column-header menu, LUKS lock, EACCES placement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(columns): open the folder context menu from a Miller column header

3 participants