Skip to content

feat(actions): run 10xer custom actions on the focused folder with ; . - #1826

Merged
l0gicgate merged 16 commits into
stack/1924from
feat/1743-folder-actions-chord
Nov 7, 2026
Merged

l0gicgate merged 16 commits into
stack/1924from
feat/1743-folder-actions-chord

Conversation

@ogarza

@ogarza ogarza commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Description

In 10xer mode the cursor always sits on an item, so ; then a digit always targets the cursor item or the fill. An action meant for the current folder could only be reached with the mouse, through the background menu. Using {parent} instead still matched [when] against the cursor item, so folder-only actions disappeared over files, and an empty folder offered no actions at all.

; . now switches the ; panel to the actions matching the keyboard-focused folder, the same ones its background menu offers. A digit (; . 1–; . 9 / ; . 0) runs one with the folder as its only input and as {parent}, and with STRATA_ACTION_SOURCE=background. If the folder changes before the digit, it flashes Folder changed and runs nothing. Non-local places list No matching actions.

  • The ; panel lists the new . step. The shortcut reference gains a ; . 1–9 / ; . 0 row; Digits now supports a two-key chord prefix to render it.
  • New strings are translated into all 12 languages.
  • docs/10xer-mode.md and docs/custom-actions.md describe the chord.
  • New QA scenario: tenxer-folder-action-runs-on-focused-folder.

Validation notes:

  • Container scripts were unavailable locally (no Docker socket access), so cargo fmt --check and clippy -D warnings ran natively on the pinned 1.98.1 toolchain instead of through ./scripts/quality.sh.
  • The new QA scenario passed with ./scripts/qa.sh tenxer-folder-action-runs-on-focused-folder in the pinned container (PR CI skips QA scenarios). It has no cost yet, because cost is relative to the whole suite; the next suite-wide scripts/qa_cost.py run will set it.
  • The targeted Rust tests ran through ./scripts/test-headless.py.

Visual evidence

N/A. The change adds a keyboard chord and a panel row; the steps below describe it.

How to test

  1. Create ~/.config/strata/actions/folder-log/action.toml with kinds = ["folder"] under [when], and a command run such as program = "/bin/sh", args = ["-c", "printf '%s\\n' \"$STRATA_ACTION_SOURCE\" \"$@\"", "sh", "{paths}"].
  2. Turn on 10xer mode (Ctrl+Shift+M), open a folder, and put the cursor on a file or subfolder.
  3. Press ;. The panel lists . "Actions for this folder…". Press .: the pill reads ; .- and lists "Folder log" as 1. Press 1.
  4. Repeat in an empty folder, and open F1 and search "focused folder".

Expected result: Jobs shows the run, and Details prints background and the path of the folder you are in, not the cursor item. It works in an empty folder too. ; then a digit still runs on the cursor item or fill with source selection. F1 lists ; . 1–9 / ; . 0.

Related issue

Closes #1743

In 10xer mode the cursor always sits on an item, so `;` then a digit could
never target the folder itself, which only the mouse could reach through the
background menu. `; .` now lists the actions matching the keyboard-focused
folder, as its background menu does, and a digit runs one with the folder as
its input and parent and source `background`, even in an empty folder.

The shortcut reference shows `; . 1–9 / ; . 0`, the `;` panel offers the new
step, and the custom actions and 10xer docs describe it.

Refs #1743
@ogarza
ogarza force-pushed the feat/1743-folder-actions-chord branch from b474962 to 35f3872 Compare October 23, 2026 14:34
@ogarza

ogarza commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator Author

Review and cleanup

Merged main at 8cdc93f4. No conflicts.

Review against the description and #1743. The chord does what the description says. ; still runs the first ten matches for the cursor item or the filled selection, with STRATA_ACTION_SOURCE=selection. ; . re-arms on the keyboard-focused folder through folder_input, the same input, paths, parent, and background source as the folder background menu, including an empty folder. A later digit refuses with Folder changed when that folder's location no longer matches, and with No action N for a vacant slot. Places without a native path take the existing empty-actions row (No matching actions), because folder_input returns nothing. The ; panel lists ., the F1 row is ; . 1–9 / ; . 0 via Digits::after_chord, and the three new strings are in all twelve catalogs. #1743 asked for the current folder unless a folder is specifically selected, and suggested an explicit second chord. This PR keeps ; on the selection and uses ; . for the folder, which is that explicit choice. No review comments were open.

Validation

  • ./scripts/test-headless.py tenxer_folder_actions_run_on_the_focused_folder_not_the_cursor_item — 1 passed
  • ./scripts/test-headless.py tenxer_numbered_actions_run_the_listed_match_on_the_current_targets — 1 passed
  • ./scripts/test-headless.py tenxer_dot_toggles_hidden_files_in_every_window_and_filter — 1 passed
  • ./scripts/test-headless.py tenxer_action_chord_terminal_refuses_a_non_local_folder — 1 passed
  • ./scripts/test-headless.py keys::tests:: — 19 passed
  • ./scripts/test-headless.py i18n:: — 12 passed
  • cargo fmt --all --check and cargo clippy --locked --all-targets --all-features -- -D warnings on Rust 1.98.1 — clean
  • Not run: ./scripts/quality.sh fmt, ./scripts/quality.sh clippy, and ./scripts/qa.sh tenxer-folder-action-runs-on-focused-folder. This machine has no Podman, and the Docker socket is not accessible. CI's Quality build and lint passed. Pull-request CI still skips QA scenarios.

Follow-ups outside this PR

  • adapters::local_operations::tests::merge::merge_never_overwrites_an_entry_created_during_the_merge failed once on shard 3 (photos/makefile recorded instead of photos (1)/makefile). It passed on the rerun, on main at 8cdc93f4, and locally. A failed-job rerun then died because quality-bundle-2 was already gone; the full workflow rerun is the green one.

CI: required checks green as of 2026-10-23 16:05 UTC. QA scenarios is skipped, as on other pull requests.

@wmfeht

wmfeht commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

Review

Reviewed at head c6df706d. The feature logic looks correct; the problems are the merge with current main and how the new . key is defined.

Blocking

1. The branch conflicts with main, and #1885 (remappable shortcuts) changes how . must be defined.
A trial merge conflicts in 8 files: src/ui/browser/file_commands.rs, src/ui/keys/bindings/tenxer.rs, src/ui/keys/label.rs, src/ui/shortcut_reference.rs, src/ui/tenxer_mode.rs, src/ui/window/keyboard/files.rs, src/ui/window/tests/keyboard_dispatch/file_verbs.rs, and docs/custom-actions.md.

On main, each chord key is a remappable command (e.g. ACTIONS_TERMINAL: Command "actions.terminal" step(Actions)), and Digits::after takes a Shown instead of a Binding. As written here:

  • ACTIONS_FOLDER is a fixed constant in the unlisted block, so it can't be remapped and the conflict checker (src/ui/keys/conflicts.rs) never sees it.
  • complete_action checks press.is(ACTIONS_FOLDER) before the other ; steps, so if a user remaps another ; step to ., that step is silently shadowed with no conflict reported.
  • Digits::after_chord(ACTIONS, ACTIONS_FOLDER, …) and Chord::mark's Keys::Chord(&[ACTIONS, ACTIONS_FOLDER]) would show the built-in keys, not the user's mapping.

Fix: declare ACTIONS_FOLDER: Command "actions.folder" step(Actions) = Binding::plain(Key::period), and build ACTIONS_FOLDER_NUMBERS and the ; .- pill from the Shown values the way ACTIONS_NUMBERS now does.

2. Hungarian translations are missing.
hu.json landed on main in #1918. The three new strings ("Actions for this folder…", "Folder changed", "Run one of the first ten custom actions for the focused folder") are in only 12 catalogs, so i18n::catalog_tests::catalogs_cover_all_languages_and_preserve_interpolation should fail after the merge. AGENTS.md requires all 13 languages.

Minor

3. ACTIONS_FOLDER is in the wrong catalog block (src/ui/keys/bindings/tenxer.rs). unlisted means "shown in neither F1 reference", but . does appear in F1 (via the ; . 1–9 / ; . 0 row) and in the ; panel. The fix in 1 replaces this.

4. Two doc comments were deleted without replacement: on Digits (src/ui/keys/label.rs) and on Chord::options (src/ui/tenxer_mode.rs). The Chord::options one is still accurate and now covers both Action and FolderAction. Suggest restoring both and noting then in the Digits comment.

Not verified: this review is from reading the diff and a trial merge (git merge-tree) against main; no build or tests were run.

…tions-chord

Resolve the conflicts with remappable shortcuts (#1885) by making the
folder actions step a command, "actions.folder" step(Actions) on ".", so
it can be rebound, the conflict checker sees it, and Settings lists it
as "Actions for the focused folder" in the 10xer table. The digits after
it and the "; .-" pill are built from Shown values and follow the user's
keys for both ";" and ".". Lettered steps are read before it, and digits
after, as an armed chord reads its steps first.

Restore the Digits and Chord::options doc comments, and document the new
step in the keymap, preferences and keyboard-shortcuts guides. It has no
path in the default map, where there is no panel to switch.
The folder actions step follows the user's key in the ; panel, the ; .- pill and the digits after it, conflicts with another Action step on its key, and has no path in the default map. The catalog test reads a two-key digit row as the second key's reference row.
@wmfeht

wmfeht commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

Fixes applied

  • 1. Conflicts and remappable .: fixed in bc994fdc, tests in 27cce9b6. Merged main, made . the remappable actions.folder step of ;, and built the ; . digits, pill and F1 row from the user's current keys. The t/c/e/E steps are now checked before ., so it no longer shadows them.
  • 2. Hungarian: fixed in e4119d68.
  • 3. Catalog block: fixed by 1; the constant moved to tenxer_only.
  • 4. Doc comments: restored in bc994fdc.

Validation: targeted ./scripts/test-headless.py filters all passed (keys:: 36, i18n:: 12, settings::keyboard:: 13, keyboard_dispatch::file_verbs 24, plus the folder-action and keymap tests). ./scripts/qa.sh tenxer-folder-action-runs-on-focused-folder passed in the pinned container, and ./scripts/quality.sh fmt and clippy passed. Full suites were not run locally.

# Conflicts:
#	src/ui/keys/tests.rs
#	src/ui/window/tests/keyboard_dispatch/file_verbs.rs
…nfirms

The separate tenxer-folder-action-runs-on-focused-folder launch repeated what
file_verbs::actions::tenxer_folder_actions_run_on_the_focused_folder_not_the_cursor_item
already checks (pill, rows, background source, path, empty folder, Folder
changed, rebinding). Its only unique part, the real ; . 1 key presses, now
runs at the end of tenxer-numbered-action-confirms, which already owns the
real ; route and the Jobs run. The Jobs popover the first run opens is closed
with Escape and focus returned to the listing before the chord.
@wmfeht
wmfeht changed the base branch from main to stack/1924 November 6, 2026 05:51
@wmfeht

wmfeht commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Review and cleanup

This PR is now stacked. Its base is stack/1924, a mirror branch in lgse/strata that holds #2070 → #1925 → #1924. Merge it after those three.

Merged stack/1924 at 616e616e. Two conflicts, both caused by the stack splitting large test files into modules:

  • src/ui/window/tests/keyboard_dispatch/file_verbs.rs: took the split version and moved this PR's test changes into file_verbs/actions.rs. The ActionManifest builder now takes the whole [when] body, so a test can install a kinds = ["folder"] action. The recorder prints "<id> $STRATA_ACTION_SOURCE" (expected lines are now top-a selection and so on). LETTERED_ACTIONS has the . row, and tenxer_folder_actions_run_on_the_focused_folder_not_the_cursor_item now lives in file_verbs::actions with its assertions unchanged.
  • src/ui/keys/tests.rs: took the split version and put the FOLDER_NUMBERS label cases back in keys/tests/labels.rs and the two-key-chord digits arm in keys/tests/catalog.rs.

Everything else merged automatically. . (a 10xer ; step) can't collide with #1925's Alt+Down (a top-level key in the default map) or with #2070's new Sort steps, and audit_of_default_tables_is_clean passes.

Review against the description and #1743. Every claim holds after the merge:

  • ; plus a digit is unchanged, with source selection.
  • ; . lists the focused folder's background-menu actions.
  • ; . plus a digit runs with the folder as {paths} and {parent} and source background, including in an empty folder.
  • If the folder changes after ; ., the digit flashes Folder changed.
  • Non-local places list No matching actions.
  • The pill reads ; .-, and F1 shows ; . 1–9 / ; . 0.
  • actions.folder can be rebound, and the conflict checker sees it.
  • All new strings are in all 13 catalogs.

#1743 suggested an explicit second chord, and ; . is that chord. The October review's four points stay fixed: the remappable actions.folder step in tenxer_only, the lettered steps checked before ., Hungarian, and the restored doc comments.

Fixes pushed

  • 7d9d13aa style(actions): format the folder action dispatch tests. The merge left actions.rs failing cargo fmt.
  • 14d307a9 test(qa): fold the folder action chord into tenxer-numbered-action-confirms (see below).
  • 43e855eb test(actions): cover the folder actions chord in a non-local folder. ; . in Trash now lists only No matching actions, and 1 gives No action 1. The test is renamed to tenxer_action_chord_steps_refuse_a_non_local_folder because it no longer covers only the terminal step.
  • f1e700e2 test(actions): install a folder action before checking a non-local folder. Without an installed action, those assertions passed even if folder_input accepted non-native places. The test now installs a kinds = ["folder"] action, uses a named Trash folder (trash:///trashed-folder; the Trash root has no file name, which hid the regression), and checks that nothing runs. With the native-path check in folder_input removed, the test fails ([("1", "Folders")]).
  • 619191e1 docs(preferences): clarify which Action steps the default keymap runs. The actions.folder exception read backwards.

Tests removed

  • QA scenario tenxer-folder-action-runs-on-focused-folder: it repeated what file_verbs::actions::tenxer_folder_actions_run_on_the_focused_folder_not_the_cursor_item checks (pill, rows, background source, path, empty folder, Folder changed, rebinding). Its only unique part, real ; . 1 key presses, is now at the end of tenxer-numbered-action-confirms. That scenario installs a record-folder action, closes the Jobs popover the earlier run opened, presses ; . 1, waits for 2 jobs finished, and checks the file reads background\n<fixture>\n. Coverage owners: that scenario and the Rust test above.

Validation

  • ./scripts/test-headless.py file_verbs::actions: 4 passed
  • ./scripts/test-headless.py keys::: 47 passed
  • After the merge: i18n:: 12, ui::keys:: 36, settings::keyboard:: 13, shortcut_reference 1, and keyboard_dispatch 179 passed, including both keymap_conflicts tests
  • ./scripts/qa.sh tenxer-numbered-action-confirms: passed 4 times. With the expected source changed to selection, it fails at the new file check as it should.
  • Mutation check: with the native-path check in folder_input removed, tenxer_action_chord_steps_refuse_a_non_local_folder fails.
  • ./scripts/quality.sh fmt and ./scripts/quality.sh clippy: clean
  • Not run locally: the full ./scripts/quality.sh test and the full ./scripts/qa.sh. CI ran the full Rust suite. Pull-request CI skips QA scenarios.

Follow-ups outside this PR

  • The PR description is out of date. It says the strings are in 12 languages (there are 13), its validation notes describe earlier local limits, and it names the deleted tenxer-folder-action-runs-on-focused-folder scenario.
  • Running any custom action opens the Jobs popover (src/ui/actions.rs → jobs::present_for). After Escape, focus stays on the Jobs toggle, so a keyboard user can't get back to the listing without the pointer or Tab. This was already the case before this PR.
  • The cost of tenxer-numbered-action-confirms (columns: 1.1) predates the added steps. The next scripts/qa_cost.py run will update it.

CI: all checks green on f1e700e2 as of 06:03 UTC (2026-11-06). QA scenarios is skipped, as on other pull requests. The Rust tests shard ${{ matrix.shard }} check shows cancelled; it belongs to a CI run for the same commit that the base change superseded.

wmfeht added a commit to FelipeJz/strata that referenced this pull request Nov 6, 2026
Resolve conflicts with the stacked PRs (lgse#2070, lgse#1925, lgse#1924, lgse#1826,
lgse#1802) and re-home the bookmark changes in the files they split:

- keys/conflicts.rs: keep the split step_digits/fixed_top_level_key and
  give the bookmark groups no digit range;
- keys/label.rs: keep both the two-key Digits `then` and the Letters
  range;
- keys/tests.rs: take the split modules and move the Letters cases of
  catalog_bindings_use_the_canonical_key and
  every_listed_binding_has_its_own_row_in_its_maps into tests/catalog.rs;
- shortcut_footer.rs: take the split modules and move the chord panel
  refill (show while rows exist, so the ' menu appears once the saved
  letters load) into shortcut_footer/indicators.rs;
- tenxer_mode.rs: add the bookmark marks and options next to
  FolderAction;
- window/keyboard.rs: take the split key routing, keep the pending
  bookmark cancel before the tab-shortcut check, and move the focus and
  mode-exit cancels into keyboard/footer_bindings.rs;
- keymap.md: list the bookmark chords alongside `; .`;
- keyboard_dispatch.rs: declare both letter_bookmarks and list_motion.
@wmfeht

wmfeht commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Merged the #2070 update (6da9d77) in through the stack at 653b85c. No fixes were needed. CI green.

* feat(10xer): enter filtered folders with slash

Keep the filter ready for the next level when entering its first matching folder.

Refs #1744

* feat(browser): extend slash navigation to normal filters

Let Ctrl+F filters enter the first displayed folder with slash in all three
views and the chooser, keeping the filter ready for the next level.

Keep pending navigation through empty indexing batches, and cancel it when
the query or input focus changes.

Refs #1744

* fix(filter): type letters that read as / only through the layout fallback

On Arabic, Thai and similar layouts the key where US has / types a letter;
the filter field and the 10xer f prompt now type it instead of entering
the first matching folder.

* fix(filter): wait for a folder still listing before entering a match

A filter read while its folder is still loading now waits until a folder
is the first match or the listing ends, and re-evaluates the pending /
when the folder finishes loading or fails.

* test(keys): give the slash filter key its fixed-binding reason

FILTER_DESCEND is a fixed binding, so unlisted_constants_are_commands_or_excluded needs a reason for it not to be a remappable command.

* feat(reference): list slash filter navigation in F1

Move FILTER_DESCEND to the listed catalog block and give it a row in both maps' reference, so every_listed_binding_has_its_own_row_in_its_maps keeps it there. Translate the row in all thirteen catalogs.

* refactor(search): keep the result hook beside the session it overrides

Move the test-only results hook from search_session/tests.rs into search_session.rs under cfg(test), as browser/progress.rs does for its delay override, so the tests module stays private.

* test(browser): keep the Ctrl+F slash tests with the filter focus tests

The two normal-mode slash tests exercise the Ctrl+F entry, not the 10xer footer prompt; the Arabic fallback helper they share with the 10xer test moves to keyboard_dispatch.rs.

* test(10xer): cancel a pending filter slash when the prompt loses focus

Focus leaving the footer prompt and returning before its idle close must still cancel the pending descent, which only the prompt focus check in FilterDescent::is_current does.

* test(qa): enter filtered folders with slash through real key input

Ctrl+F, a query and / enter the matching folder and leave an empty, focused filter, in Columns, Icons and List, with and without Include subfolders. The second level types / as Shift+7 on the German layout.

* fix(filter): read the slash descent after the input method

Catching the / key press swallowed it before an in-process input method saw it, so a Zhuyin, Array30 or Boshiamy code starting with / could not be typed into a filter. The window now leaves / to the field, and a lone / the field commits, read from its insert-text, enters the folder instead of reaching the query. Longer committed text holding / is typed. The layout-fallback guard and its Arabic test go, since a letter on the slash key commits that letter.

* feat(10xer): enter the highlighted filter result with slash

Once Up or Down moves the f prompt's result cursor, / enters the result under it rather than the first; editing the query or reopening the prompt goes back to the first. The prompt keeps a stepped hit through edits, so a flag rather than the cursor itself says whether it moved since the query changed. Ctrl+F keeps entering the first result. The 10xer F1 row says so in all thirteen catalogs.

* style(filter): format the slash descent hook

* fix(filter): keep a selected query when slash enters a folder

GTK deletes a selection, or the character overwrite mode replaces, before it inserts a commit, so / over a query that Ctrl+F or Tab had selected cleared the query and entered nothing. The hook now records that deletion within the change and puts the text back when it takes the /, and only for a field that accepts the /. The change GTK still reports afterwards leaves the text as it was, so a pending descent now ends only when the text differs from its query. Tests commit through the field's input method, which replaces a selection as typing does.

* test(qa): enter a folder with slash after Ctrl+F reselects the query

Down into the results and Ctrl+F back select the filter's query, the route on which / used to clear it.

* fix(10xer): follow the cursor with slash in folders filtered in place

A folder without a native path, such as a remote share, filters its listing in place and has no result rows, so / entered the first match even after Up or Down moved the listing cursor. The in-place branch now takes the entry under that cursor too. The remote case reuses RemoteFolders, now beside RemoteShare.

* style(filter): format the selection restore

* test(10xer): name the focus bug the remote slash case works around

* fix(10xer): ignore prompt changes that keep the text

The changed GTK reports after a / puts back a selection left the text as it was, yet cleared the result cursor flag. Prompt listeners now skip a change whose text equals the last one seen, so the filter prompt's descent cancel needs no text comparison of its own.

* fix(filter): restore an overwritten grapheme and the cursor with it

Overwrite mode replaces the grapheme at the cursor, which may hold several characters, so the record no longer assumes one. A / that restores the text puts the cursor back where it was: at the end of the restored selection, or where overwrite would have written. The hook also names the preedit limit.

* docs(filter): say which change keeps a pending descent

* style(filter): format the overwrite cursor check

* test(qa): select the filter query with Ctrl+A before slash

Down into the results raced subfolder results still arriving under CI load, leaving nothing focused (list-subfolders). Ctrl+A selects the query in the field itself, so / still replaces a selection without depending on the result rows.

---------

Co-authored-by: William Feht <[email protected]>
@l0gicgate
l0gicgate merged commit 0e1f5e6 into stack/1924 Nov 7, 2026
11 checks passed
@l0gicgate
l0gicgate deleted the feat/1743-folder-actions-chord branch November 24, 2026 05:18
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.

Decide current folder vs selection for custom action

4 participants