Repository navigation
Build menu select and input payloads in one jq call - #19877
Merged
Merged
Conversation
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryReplaces Perl payload builders with one
Reviews (1) · Last reviewed commit: "Build menu select and input payloads in ..." · Reviewed by Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Replaces the three separate
perl -MEncode -MJSON::PPprocesses inbin/omarchy-menu-selectand theperlprocess inbin/omarchy-menu-inputwith a singlejqinvocation each.Every interactive picker and text prompt (
omarchy-menu-tmux-keybindings,omarchy-menu-herdr-keybindings,omarchy-reminder -i,omarchy-menu-plugin,omarchy-menu-timezone,omarchy-transcode, and the remove pickers) was paying ~120ms just to spawn Perl three times and serialize a single JSON payload (and ~40ms foromarchy-menu-input). Usingjqdrops that serialization to ~8ms while preserving UTF-8 handling, dash-prefixed options, tabs,--multiple/--selected/--on-change/--change-key, and optional integer dimensions.Verification
bash test/shell.d/menu-test.sh— passed, including new assertions exercisingomarchy-menu-select(UTF-8, tabs, dash-prefixed options,--multiple,--selected,--on-change,--change-key,--width,--maxheight, and minimal defaults) andomarchy-menu-input.bash test/shell.d/menu-plugin-test.sh— passed.omarchy-menu-selectinvocation against a stubomarchy-shell: dropped from ~150ms+ to ~30ms end-to-end (~120ms saved per open).Screenshots
No visible change: only CLI JSON payload serialization changed; the shell menu renders identically.