Skip to content

fix(context-menu): create siblings from entry context menus - #1973

Merged
l0gicgate merged 5 commits into
lgse:mainfrom
OmarGonD:fix/1972-create-siblings-from-entry-menu
Nov 3, 2026
Merged

l0gicgate merged 5 commits into
lgse:mainfrom
OmarGonD:fix/1972-create-siblings-from-entry-menu

Conversation

@OmarGonD

Copy link
Copy Markdown
Contributor

Description

Add plain New Folder and New File actions to entry context menus, so a full pane does not require exposed background space to create an item. Both actions create siblings in that pane’s directory, for single or multiple selections, without moving existing entries. New Folder with Selection remains separate; plain creation is hidden in Trash, Recent, and recursive search results.

Visual evidence

N/A — agent-authored PR; adds the existing translated New Folder and New File rows above New Folder with Selection.

How to test

  1. Open a directory with enough entries to fill the pane in Columns, Icons, or List view.
  2. Right-click a file, a folder, or a multiple selection. Choose New Folder, enter a name, and confirm.
  3. Repeat with New File. Check that New Folder with Selection still groups entries when explicitly chosen.

Expected result: The named empty folder or file appears in the pane’s directory; the original entries stay in place, and a clicked folder does not receive the new item.

Related issue

Closes #1972

@github-actions github-actions Bot added the fix label Oct 31, 2026
@OmarGonD

Copy link
Copy Markdown
Contributor Author

Targeted local validation passed against pinned environment sha256:7e4de6a7728868b9c5ddc9b67a6eafca1529b7f08d700f072cb1c616b42c40f8:

  • STRATA_TEST_CARGO_CACHE=target/quality-container ./scripts/qa.sh new-items-from-entry-menu new-folder-with-selection-groups new-items-in-empty-directory: 23 runs passed, including 18 new entry-menu cases.
  • ./scripts/test-headless.py ui::browser::context_menu::tests::: 11 tests passed. ./scripts/test-headless.py i18n::: 12 tests passed. Both ran inside the same pinned container using private Xvfb and D-Bus, with the shared Cargo cache and direct pinned toolchain PATH.
  • ./scripts/quality.sh fmt and ./scripts/quality.sh clippy: passed. The actual container engine was a temporary rootless Podman at /tmp/strata-1972-container-bin/podman, selected with STRATA_CONTAINER_ENGINE; its configuration and storage were kept in /tmp because the host root filesystem was full.

Negative control: temporarily requesting a nonexistent creation action made new-items-from-entry-menu/columns-folder-folder fail at the intended menu-action check; restoring the scenario passed. The existing all-menu shortcut expectation was adjusted for the newly exposed, valid New Folder shortcut. Full Rust and QA suites were intentionally omitted for this bounded menu change; targeted coverage includes all three view routes, multi-selection, existing grouping/background creation, virtual-directory gating, keyboard hints, and localization. The operation implementation, preferences, and test infrastructure are unchanged.

QA metadata: cost weights use the selected passing-run timings through scripts/qa_cost.py helpers. Primary grading is I3/C4/K3/D4 (42); independent grading is I3/C4/K4/D4 (49 by the rubric formula). The primary criticality rating accounts for the underlying creation logic's unit coverage. The independent review used Luna because the skill's suggested Haiku model was unavailable.

Re-apply the entry menu creation rows on main's split context menu
modules, sharing the group action's pane check and the folder menu's
deferred creation.
Keep the check that tenxer mode leaks no other Ctrl hint, and assert
that search result menus hide the plain creation rows.
Fold the creation gating into the Recent gating test and keep one view
across locations, so rows that only reflect the first location fail.
@l0gicgate

l0gicgate commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review and cleanup

Merged main at 1cf7134d3 in 2fc33a402. src/ui/browser/context_menu.rs conflicted because main split it into modules, so I took main's file and re-applied this PR's rows in item_options.rs and item_menu.rs.

Review against the description and #1972. No blocking defects, and there were no earlier reviewer comments to address.

  • New Folder and New File appear on entry menus and create the item in the pane's directory, for files, folders and multiple selections, in all three views: confirmed by new-items-from-entry-menu. A clicked folder receives nothing and selected items stay in place.
  • New Folder with Selection stays a separate row: confirmed by the driven menu and new-folder-with-selection-groups in Icons and List. Its Columns run fails on main too (see Validation).
  • Hidden in Trash and Recent: confirmed by the Rust test below.
  • Hidden on recursive search results: implemented, but untested until 2221dc4d6.

Changes made while porting (in the merge commit)

  • The rows now use the same pane check as New Folder with Selection (MenuTarget::can_create_in_pane), read when the menu opens.
  • The entry and background menus now share schedule_new_entry instead of each having their own copy.

Test changes

  • 2221dc4d6 adds the missing search coverage to space-previews-filtered-result-pointer. It also restores the check in context_hints_follow_the_active_map that no other Ctrl+ hint appears in tenxer mode, which this PR had replaced with a check on the New Folder hint alone.
  • a800406d9 merges entry_creation_is_unavailable_in_virtual_directories and remove_from_recent_is_gated_on_the_recent_location into item_menu_rows_follow_the_location. It keeps one view across Local, Recent, Trash and back to Local, so rows that only reflect an earlier location now fail. It also checks Open and Copy at every location rather than only Recent. This took tests/menus.rs from 9.21 back to main's 9.23.
  • 2fcfeebb7 is formatting only.

No tests were dropped as tautological. The new scenario's 18 runs each vary the view, the clicked entry type or the selection.

Validation

  • ./scripts/test-headless.py -- ui::browser::context_menu:: i18n::: passed on the final code (24 tests in the main target, 12 of them i18n::).
  • ./scripts/qa.sh --test-threads 6 <29 scenarios that open a context menu and then navigate it>: 80 of 81 runs passed, including all 18 new-items-from-entry-menu runs and the extended search scenario.
  • The one failure is new-folder-with-selection-groups/columns at line 34 (focused_pane). It fails the same way on unmodified main at 1cf7134d3, so it did not come from this PR.
  • Negative controls, both reverted: removing the search check fails space-previews-filtered-result-pointer in all three views, and removing the Trash/Recent check fails item_menu_rows_follow_the_location.
  • ./scripts/quality.sh fmt and ./scripts/quality.sh clippy: clean.
  • scripts/code-health.sh: no touched file scores below main.
  • Driven by hand in Columns with qa-drive: the menu shows New Folder and New File, a separator, New Folder with Selection, a separator, then Open.
  • Not run: the full quality.sh and qa.sh suites, because this is a bounded menu change. PR CI skips QA scenarios, so the QA results above are local only.

CI
All checks on 2fcfeebb7 are green on attempt 4, except QA scenarios, which PR CI skips. Two earlier attempts each failed on a different timing-dependent test in code this PR does not touch:

  • audio_steps_keep_playback_and_volume_but_never_reuse_an_ended_request passed locally and on the next attempt.
  • fast_delete_animates_only_its_own_success_without_showing_progress passed 5 of 5 local runs and on the next attempt.

Follow-ups outside this PR

  • Fix new-folder-with-selection-groups/columns, which is broken on main.
  • scripts/code-health.sh cannot install its CLI: the downloaded cs.sha256 lists target/cs, so sha256sum -c fails when run from target/cs-cli. I verified the hash by hand and used STRATA_CS_CLI.

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.

fix(context-menu): allow creating siblings from an entry menu

2 participants