Skip to content

Give empty menu file searches real feedback instead of a usage error - #7320

Open
wbarakat wants to merge 9 commits into
omacom:quattrofrom
wbarakat:fix-menu-select-empty-list
Open

wbarakat wants to merge 9 commits into
omacom:quattrofrom
wbarakat:fix-menu-select-empty-list

Conversation

@wbarakat

Copy link
Copy Markdown

Fixes #7114.

Picking Transcode from the menu with empty ~/Pictures and ~/Videos was a silent no-op, and running omarchy transcode from a terminal printed an internal usage string for a command the user never typed. omarchy-menu-select couldn't tell an empty option list piped on stdin apart from a caller passing no options at all, so it treated both as a usage mistake.

  • omarchy-menu-select: an empty piped list now exits 2 with no output — it's the caller's "nothing to offer", not a usage error. Argument errors keep the usage string and exit 1, and cancelling a menu still exits 1, so existing callers are unaffected. This also stops the usage leak for the other pipe-callers (omarchy-menu-plugin, omarchy-menu-timezone, omarchy-menu-keybindings).
  • omarchy-menu-file: an empty find result reports No matching files under <paths> on stderr and exits 2 instead of summoning the menu.
  • omarchy-transcode: on an empty search it sends a "Nothing to transcode" notification (the menu's trigger.transcode has no terminal, so a notification is the only feedback channel) and exits 1.
  • omarchy-games-retro-install: an empty ~/Games/roms now mirrors the script's existing "No RetroArch cores found" notification instead of exiting silently.

Regression tests in test/cli cover the quiet exit-2, the preserved usage error, the menu-file message, and an end-to-end transcode run with a stubbed omarchy-notification-send. Full ./test/cli passes, and the populated-search path was verified end-to-end against a stubbed omarchy-shell summon.

An empty list piped into omarchy-menu-select read as "no options given",
so it printed its own usage string and exited 1. Picking Transcode from
the menu with empty ~/Pictures and ~/Videos was a silent no-op, and from
a terminal it printed an internal usage message for a command the user
never typed.

An empty piped list now exits 2 with no output, omarchy-menu-file
reports the empty search on stderr with the same code, and the two
callers exposed to it give real feedback: transcode sends a "Nothing to
transcode" notification and the retro game installer mirrors its
existing "No RetroArch cores found" notification.
Copilot AI balanced review requested due to automatic review settings August 17, 2026 21:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR improves CLI behavior when menu inputs are empty by introducing distinct, quiet exit codes for “nothing to offer” cases and ensuring callers provide user-friendly notifications instead of leaking usage text.

Changes:

  • Add omarchy-menu-select behavior: empty piped option list exits 2 quietly (no usage output).
  • Update omarchy-menu-file to detect “no matches” early, print a targeted error, and exit 2.
  • Adjust callers (notably omarchy-transcode and retro install) and extend CLI tests to validate exit codes, output, and notification behavior.

Reviewed changes

Copilot reviewed 1 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/cli Adds regression tests for empty menu inputs, no matching files, and transcode notification behavior.
bin/omarchy-transcode Handles omarchy-menu-file exit 2 by notifying “Nothing to transcode” and exiting non-zero.
bin/omarchy-menu-select Exits 2 quietly when stdin is a pipe with zero options to distinguish “empty offer” from usage errors.
bin/omarchy-menu-file Detects no matching files and exits 2 with a clear message instead of invoking the menu.
bin/omarchy-games-retro-install Adds notification + non-zero exit when no ROMs are found.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

The glyph after -g was empty, so omarchy-notification-send took "Nothing to transcode" as the glyph and showed the path list as the headline with no description. Use the menu's Transcode glyph, and have the test record each argument separately and check the whole call, so a dropped or merged argument fails it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Codex Medium <[email protected]>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Sep 28, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and tested on a disposable Omarchy worker. The fix works, and I pushed one small correction to your branch.

Reproduced. On current quattro, omarchy transcode --path <empty dir> prints Usage: omarchy-menu-select … and exits 1. With this branch merged into quattro, it prints No matching files under … and sends the "Nothing to transcode" notification. With the four bin/ changes reverted, the new menu-select exits 2 test fails again.

Pushed: 330d6ef. In bin/omarchy-transcode:174 the glyph after -g was empty, so omarchy-notification-send read "Nothing to transcode" as the glyph. The notification then showed the folder list as its headline, with no description. It now uses the menu's Transcode glyph (󰧸). The test's stub records each argument separately and compares the whole call, so it now fails if an argument is dropped or merged. The old grep passed either way.

Tests. ./test/cli passes in full at this head. Merged into quattro, it passes apart from three vscode-theme assertions that fail the same way on quattro alone on this worker. menu-plugin, screenrecording and theme-install-guards in test/shell.d/ pass too; those are the shell tests that use these commands. I checked every caller of omarchy-menu-select and omarchy-menu-file in bin/, and none of them behaves worse with the new exit 2.

Second opinion. Codex Medium read the change twice. It agreed that the bug is real and the fix is the right size, and it found no caller broken by the exit 2. It suggested the tighter assertion, and it cleared the final head in a second round. Its independence from my review is not guaranteed. It also pointed out one case that predates this PR and isn't a blocker. If a searched folder holds an unreadable, non-hidden subdirectory, find exits non-zero and pipefail stops omarchy-menu-file at line 47. Before, the picker opened and transcode then failed. Now the picker doesn't open. Either way nothing gets transcoded. #13018, #12669 and #13197 change the same find pipeline for symlinked folders, so whichever lands second will need a rebase.

This is waiting on the maintainer now; nothing is needed from you.

@omarchybot omarchybot added ready Good to merge and removed ready Good to merge labels Sep 28, 2026
@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Oct 12, 2026
omarchybot and others added 3 commits October 13, 2026 00:02
Quattro added alias fast-path tests at the end of test/cli where this branch added its menu-select tests; both blocks are kept, quattro's first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…dable folders

Quattro now has omarchy-menu-select exit 2 when the menu cannot open, and typing_setup.py reads it that way, so an empty piped list exits 3 instead. Otherwise Transcode reported "Nothing to transcode" when the shell was down, and the retro installer reported no games. omarchy-menu-file also stops aborting on find's status, which an unreadable subfolder sets, so the matches it found are still offered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Codex Medium <[email protected]>
…root

An unreadable search folder now exits 1 with "Could not search", rather than 3 with "No matching files", so Transcode and the retro installer no longer claim there is nothing there. Matches found beside an unreadable subfolder are still offered. Root reads through chmod 000, so the permission assertions run only for an ordinary user, like the existing alias test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Codex Medium <[email protected]>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 12, 2026
@greptile-apps

greptile-apps Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the remaining feedback is a non-blocking request for retro-game tests.

Findings

  1. P2 Retro feedback lacks tests ▶

Summary

The PR gives empty file searches clear feedback instead of printing the selector’s usage text.

  • Empty file searches return a separate result for callers.
  • Transcode reports when its search finds no media.
  • Retro game install reports when the ROM folder is empty.

The previous-review comparison was not used because the two commits have different merge bases with the supplied target commit.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Search for matching files] --> B{Any matches?}
  B -->|Yes| C[Open picker]
  B -->|No| D{Search failed?}
  D -->|Yes| E[Print search error; exit 1]
  D -->|No| F[Print no matches; exit 3]
  F --> G[Caller sends notification]
  C --> H[Return selection or menu status]
Loading

Reviews (3) · Last reviewed commit: "Test that a non-empty file search still ..." · Reviewed by Greptile

Comment thread test/cli Resolved
Comment on lines +25 to +28
if (( game_status == 3 )); then
omarchy-notification-send -g 󰯉 "No retro games found" "$HOME/Games/roms"
exit 1
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Retro feedback lacks tests

The new “No retro games found” branch has no test. The transcode test cannot catch a wrong status check or notification in omarchy-games-retro-install.

Add tests for both outcomes:

  • A stubbed core choice and an empty ROM directory should send the notification and exit 1.
  • A cancelled file choice should stay quiet and exit 0.

@omarchybot omarchybot added the ready Good to merge label Oct 12, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This stopped merging cleanly after quattro moved, so I merged quattro into your branch, fixed what the merge broke, and tested it again on a disposable Omarchy worker. It's at 3fdf048.

The merge. The only conflict was at the end of test/cli, where quattro had added alias tests in the same place as yours. I kept both blocks.

What the merge broke. Since you opened this, quattro changed omarchy-menu-select to exit 2 when the menu can't open (omarchy-shell summon fails), and default/input-methods/typing_setup.py relies on that. Your empty-list exit was also 2, so with the shell down and a video in ~/Videos, Transcode reported "Nothing to transcode". The retro installer would have reported no games the same way. Pushed 2eb1f91, which:

  • moves "nothing to offer" to exit 3 in omarchy-menu-select and omarchy-menu-file, and has omarchy-transcode and omarchy-games-retro-install check for 3;
  • stops omarchy-menu-file from exiting when find fails on an unreadable subfolder. Capturing the list under set -euo pipefail had made it quit before showing the matches it did find.

3fdf048 makes a search root that can't be read at all exit 1 with "Could not search …" rather than "No matching files". It also adds tests for each case, with the permission checks skipped as root.

Tests. On current quattro, omarchy transcode --path <empty dir> prints menu-select's usage string. At this head it sends the "Nothing to transcode" notification, and with the shell stubbed to fail it sends nothing. ./test/cli passes in full at this head and on quattro alone. Each new test fails when the change it covers is reverted. menu-plugin, screenrecording and theme-install-guards in test/shell.d/ pass too. I rechecked every caller of omarchy-menu-select and omarchy-menu-file on quattro, including the new herdr, tmux and input-method pickers, and none of them handles the new exit 3 worse than before.

Review. Claude Opus 5.5 and Codex Medium both reviewed it. Codex found the exit-2 collision and the find problem in its first round, and the unreadable-root and root-user test problems in its second. Its third round, at this head, found nothing. Greptile's two notes ask for more tests: what a working menu receives, and the retro installer's empty branch. Neither points to a defect, so I left them.

This now waits on a maintainer.

@omarchybot omarchybot removed the ready Good to merge label Oct 13, 2026
@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 13, 2026
Quattro added the timed alias-dispatch test at the end of test/cli where this branch added its menu-select tests; both blocks are kept, this branch's first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 13, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

quattro moved again and this stopped merging cleanly, so I merged quattro into your branch and tested it again on a disposable Omarchy worker. It's at d36c030.

The merge. The only conflict was at the end of test/cli, where quattro added a timed alias-dispatch test in the same place as your menu tests. Both blocks are kept, yours first; nothing in bin/ conflicted, and the change against quattro is the same as before.

Tested. On current quattro, an empty omarchy transcode --path <empty dir> still prints Usage: omarchy-menu-select … and sends no notification. On this branch it sends "Nothing to transcode", and with the four bin/ files put back to quattro it fails again. ./test/cli passes in full on the worker at d36c030, including the new timed test.

Second opinion. Codex Medium reviewed the merge and found nothing: no lost or clashing test state, nothing in quattro's new commits that changes the exit statuses this relies on, and the fix still sized to the bug. It only agreed with my reading, and it isn't guaranteed to be independent of it. I reviewed it with Claude Opus 5.5. Greptile's two notes on the last head ask for more test coverage of the populated menu and the retro-install message. Neither is a defect, so I left them alone.

This is waiting on the maintainer.

@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Oct 14, 2026
omarchybot and others added 2 commits October 14, 2026 11:47
Quattro now prints its menu prompts and notifications through omarchy-i18n, so the two empty-search notifications this pull request adds read their text from new English keys in default/i18n/en/cli.json (games.noGames, transcode.nothing, transcode.nothingBody) rather than embedding English literals, which i18n-check flags on notification lines. Translations follow through the sync workflow, as for any new key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
omarchy-transcode now reads its notification text through omarchy-i18n, which looks the key up under $OMARCHY_PATH in the language the user picked. Left to the environment, the test resolved the keys against whatever Omarchy the machine has installed and in its language, so on an install predating these keys the notification read "transcode.nothing" and the test failed, and the negative check further down passed for the same wrong reason. Point both at the tree under test and at no language file, as test/shell.d/base-test.sh does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 14, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Quattro's move to translated strings (#15326) conflicted with this again, in bin/omarchy-transcode and bin/omarchy-games-retro-install, so I merged quattro into the branch and pushed two commits:

  • 2e34cfc resolves the conflicts. The two empty-search notifications now take their text from omarchy-i18n like the rest of quattro, through three new English keys in default/i18n/en/cli.json (games.noGames, transcode.nothing, transcode.nothingBody). Translations follow through the sync workflow, as docs/i18n.md describes.
  • b0cfb95 pins OMARCHY_PATH and the language file on the two omarchy-transcode calls in test/cli. Without that, omarchy-i18n looked the keys up in whatever Omarchy the machine had installed. On a worker that printed transcode.nothing and failed the test, and it would have made the later "does not report an empty search" check pass for the wrong reason.

Checked on an Omarchy ISO worker at b0cfb95 against quattro 84cfb93. For an empty search, quattro still prints Usage: omarchy-menu-select and the head reports "No matching files" and sends a notification. ./test/cli is green at the head and fails again with the four bin/ files reverted. I18N_STRUCTURAL=1 test/shell.d/i18n-test.sh and scripts/i18n-sync.py extract-scan --check both pass.

Codex Medium reviewed the whole diff, including the conflict resolution and the test change, and found nothing. It agreed with my own reading, but its independence isn't guaranteed.

This is waiting on the maintainer.

The list now reaches omarchy-menu-select as a here-string rather than a pipe, and nothing checked that the rows, their order, the extension filter or the returned pick survived that. Adapted from the test in omacom#14538, which fixes the same bug and was left in favour of this one.

Co-Authored-By: Omarchybot <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omarchybot

Copy link
Copy Markdown
Collaborator

#14538 fixes the same bug (#7114), and this pull request is the one recommended to land. The one thing #14538 had that this one lacked was a test for the path this one rewrites: when a search does find files, the list should still reach the picker newest first, filtered by extension, and the pick should come back. I added that test here as a871710, adapted into test/cli beside this pull request's other menu tests and crediting #14538 as co-author. Nothing outside test/cli changed.

Checked on an Omarchy ISO worker at a871710. Quattro at 51bfd1d still prints Usage: omarchy-menu-select for an empty omarchy-transcode search. ./test/cli is green at the head and when merged onto current quattro, and it fails again with the four bin/ files reverted. Taking the sort out of bin/omarchy-menu-file fails the new test, so it catches the thing it is there for. CI is green.

Codex Medium reviewed the new commit and the whole diff and found nothing. It agreed with my own reading, but its independence isn't guaranteed.

Next step: the maintainer decides whether to merge. Nothing is waiting on the author.

@omarchybot omarchybot removed the ready Good to merge label Oct 16, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

A correction to my last comment: CI is not green yet. The "Check translation structure" workflow (.github/workflows/i18n-check.yml) has not run on a871710, or on b0cfb95 before it. GitHub is holding both runs for a maintainer to approve, so the only check that has reported is Greptile.

Nothing else has changed since that comment. The head is still a871710, the reproduction and ./test/cli results on the Omarchy ISO worker stand, and the structural translation check that workflow runs (I18N_STRUCTURAL=1 test/shell.d/i18n-test.sh) passed on the worker at b0cfb95. a871710 changed only test/cli after that. Codex Medium's review of this head found nothing, and I reviewed it with Claude Opus 5.5.

Next step: a maintainer approves the workflow run. Once it passes, this needs only the merge decision. Nothing is waiting on the author.

ThePrimeagen added a commit to ThePrimeagen/omarchy that referenced this pull request Nov 6, 2026
With ~/Pictures and ~/Videos empty, as on a fresh install, `omarchy transcode` printed omarchy-menu-select's usage line and exited 1, and Transcode from the menu did nothing at all: omarchy-menu-file piped an empty find result into omarchy-menu-select, which read it as being called with no options. This is omacom#7320's fix: an empty piped list exits 3 quietly, omarchy-menu-file reports an empty search with 3 and a search it could not run with 1, and transcode and the retro game installer turn 3 into a notification.

Three other pickers were handed empty lists the same way. `omarchy plugin remove` with every plugin gone printed gum's "no options provided" and then "cancelled"; it now says "no plugins installed", as it already does when the plugins folder is missing. The background switcher, on a theme with no backgrounds, opened an image picker that never reveals itself without an image, yet takes the keyboard until Escape; omarchy-menu-images now exits 3 when it has nothing to offer, and the switcher sends the "No background was found for theme" notification that theme set and bg next already send. The Windows VM installer offers only RAM sizes from 2G up that fit the machine, so under 2G of memory it opened an empty gum list and said the installation was cancelled; it now stops first and says so, as it does for disk space.

Co-authored-by: Waleed <[email protected]>
Co-authored-by: Omarchybot <[email protected]>
Co-authored-by: Cursor <[email protected]>
@omarchybot

Copy link
Copy Markdown
Collaborator

The translation workflow run has now finished with a failure. GitHub created no jobs or check runs for it and has no test log, so this result does not identify a failing translation assertion. The workflow is unchanged from this branch’s merge base; the cause of the failure before any job started is still unknown.

Rechecked a871710 on a disposable Omarchy worker: ./test/cli and python3 scripts/i18n-sync.py extract-scan --check pass. The structural translation test stops at locale generation on both this head and its merge base, 84cfb93. That unchanged test invokes the worker’s newer installed locale helper, which its old stubs do not cover. This local failure is separate from the GitHub run, where no job started.

Codex High checked the run metadata and worker results. Opus 5.5 High and muse-wonder via pi, thinking high reviewed the CI diagnosis and found no change to push. They agreed with that assessment; independence from my review is not guaranteed.

Nothing was pushed. This waits on a maintainer to investigate the run that created no jobs and get the translation workflow running at this head. No action is identified for the author.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy transcode fails with an internal usage message when ~/Pictures and ~/Videos are empty

3 participants