Skip to content

Accept numpad input in the image picker filter - #8023

Closed
wstock wants to merge 2 commits into
omacom:quattrofrom
wstock:numpad-input-keypad-modifier
Closed

wstock wants to merge 2 commits into
omacom:quattrofrom
wstock:numpad-input-keypad-modifier

Conversation

@wstock

@wstock wstock commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem

With --filterable, typing a digit on the numeric keypad into the image picker's filter does nothing. The same digit on the number row works.

Cause

Qt sets Qt.KeypadModifier on keypad key events. The image picker types into its filter from Keys.onPressed and only appends a character when event.modifiers is exactly Qt.NoModifier or Qt.ShiftModifier, so the keypad event is dropped even though event.text already holds the digit.

The menu used to have the same check. Since #15508 moved its search line onto Ui/FilterInput (a TextInput), it types keypad digits on its own, so this PR no longer touches it.

Fix

Add Util.extendsFilter(event) next to the existing editsFilter / editedFilter helpers. It accepts a single printable character and refuses only Ctrl, Alt and Super chords. The image picker now goes through it, so any panel that still filters from Keys.onPressed can use the same check.

+14 / −1 in shell/, plus one test.

Verification

On an Omarchy worker VM (from the review below), using wtype into omarchy-menu-images --filterable over images named alpha, beta5 and gamma:

Input quattro This branch
keypad 5 dropped beta5
row 5 beta5 beta5
Ctrl+keypad 5 refused refused

test/shell.d/filter-extends-test.sh runs the helper's own JavaScript against the real Qt modifier values (row and keypad digits, Shift, Ctrl/Alt/Super chords, empty, control and multi-character text) and checks that the picker routes through it. It fails with the picker line reverted.

Related

Developed with AI assistance (Claude Code); reviewed and tested on Omarchy.

Copilot AI balanced review requested due to automatic review settings August 24, 2026 09:56

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

Intends to fix numpad input filtering by ignoring Qt.KeypadModifier, but the branch contains 2,062 mostly unrelated file changes.

Changes:

  • Adds Util.baseModifiers() and applies it to menu/image-picker input.
  • Includes 1,811 unrelated commits requiring a rebase.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 57 out of 2062 changed files in this pull request and generated 1 comment.

File Description
shell/Commons/Util.qml Masks the keypad modifier.
shell/plugins/menu/Menu.qml Accepts numpad filter input.
shell/plugins/image-picker/ImagePicker.qml Accepts numpad filter input.
version and 2,058 other files Unrelated stale-branch changes.

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

Comment thread version Resolved
@wstock
wstock changed the base branch from master to quattro August 24, 2026 10:06
@wstock

wstock commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks — that was a base-branch mistake on my part, now fixed.

The branch was always cut from quattro (the repo's default branch) and is 0 commits behind it, but I opened the PR against master, which is 1,811 commits divergent. That's where the 2,062-file diff came from — the branch itself was never stale.

Retargeted to quattro. The diff is now the intended 3 files, +10/-3:

  • shell/Commons/Util.qml
  • shell/plugins/menu/Menu.qml
  • shell/plugins/image-picker/ImagePicker.qml

No rebase or cherry-pick needed.

@wstock

wstock commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current quattro (988da12) so the branch is no longer 213 commits behind. Same three-file, +10/−3 change; it applied with no conflicts, and the exact-comparison sites it fixes are still present on quattro at Menu.qml:1161 and ImagePicker.qml:429.

test/shell produces the same 17 environment-dependent failures (missing lua, no omarchy-pkgs checkout) on an unmodified quattro checkout as on this branch, and the qml-text-format-scan that landed after this PR was opened passes.

The caveat in the description still stands: this is verified by instrumentation and inspection, not in a running dev-linked shell. Happy to adjust if a maintainer wants it structured differently.

@wstock
wstock force-pushed the numpad-input-keypad-modifier branch from 2165a65 to cc07bd2 Compare September 6, 2026 09:09
Typing a digit on the numeric keypad did nothing in the Omarchy menu
search or the image picker filter, while the same digit on the number
row typed fine. Qt sets KeypadModifier on every keypad key while NumLock
is on, and both panels only typed a character when event.modifiers was
exactly NoModifier or ShiftModifier, so the keystroke was dropped with
event.text already holding the digit. Characters reached through AltGr,
such as "+" on some layouts, were dropped the same way because Qt flags
them with GroupSwitchModifier. The other searchable panels test
modifiers with bitmasks and were never affected.

The "does this keystroke type into the filter?" check was the same
expression in both panels. Move it into Util.extendsFilter next to
editsFilter, reject only Ctrl, Alt and Super chords there, and route
both panels through it. The test runs the helper against the real Qt
modifier values and checks the panels use it.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01D4yxzhnahYVFHVL1APLSkp
@wstock wstock changed the title Fix numpad input being dropped in menu and image picker Accept numpad and AltGr input in the menu and image picker filters Sep 11, 2026
@wstock

wstock commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Reworked, now that this has been run rather than read.

  • Verified live. Cloned the menu plugin on Omarchy 4.0.3 and injected KP_5 with wtype: the event arrives as mods=0x20000000 (KeypadModifier) with the digit in event.text, the current guard drops it, the fix types it. Table in the description.
  • Dropped the Ctrl+U change. The keypad bit is set per keypad key, not while NumLock is on, so Ctrl+U never carried it. The earlier description was wrong about that.
  • One helper instead of a mask. The character check was the same expression in both panels, so it now lives in Util.extendsFilter beside editsFilter, rejecting only Ctrl/Alt/Super chords. That also lets AltGr characters through, which is what fix(menu): accept plus in search input #7659 does for the menu alone (Menu prompts don't allow "+" character #7629).
  • Test added. test/shell.d/filter-input-test.sh runs the helper against the real Qt modifier values and fails on unmodified quattro.
  • Rebased onto current quattro.

#8176 / #8552 are the other keypad failure (Qt with NumLock out of sync, keys arrive as arrows with no text) and need #10530 / #8018; this is the in-sync case.

@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and verified on an Omarchy worker VM, with this branch merged into current quattro (b18ab49). Nothing found that needs changing.

Reproduction. Typing into omarchy-menu-input on the worker with wtype:

Input quattro With this PR
keypad 5, +, 1 (nothing) 5+1
row 6, then keypad 5 6 65
x, then Ctrl+A, Ctrl+keypad 5 or Alt+B x x (chords still refused)

The image picker goes through the same Util.extendsFilter, so it was checked by the tests rather than typed into.

Tests on the worker. test/shell.d/filter-input-test.sh passes (20 assertions) and fails with the three QML changes reverted, so it tests the helper's behaviour rather than its spelling. ./test/shell: 280 of 287 files pass; the other 7 (ascii, branding animation, kernel headers, captive portal, kernel migration, passwordless grant, video background) fail identically on quattro. ./test/cli has one failure, vscode generated theme references current theme file, which quattro shares. This PR has no CI checks.

Second opinion. Codex Medium reviewed the diff and found no functional defect; that agreement is not guaranteed to be independent of this review. It added one point of its own: on Wayland, Qt builds modifiers from xkb and never sets GroupSwitchModifier, so AltGr characters already arrived with no modifier and typed before this change. The comment in Util.qml and the two "AltGr" test cases describe a modifier Qt does not send there. It is harmless, since the helper only rejects Ctrl, Alt and Super, but the keypad is what this actually fixes.

Related. #7659 fixes the same keypad bug in the same two panels with the same rule, inline in each. Asked which to merge without being told this review's answer, Codex preferred this one for the shared helper and a test that exercises it; this review agrees. This one is marked as the fix for #7629. #8176 and #8552 are the separate NumLock-desync case and are not fixed by either.

Nothing is needed from you. It waits on the maintainer, who also decides between this and #7659.

@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 15, 2026
Quattro's menu now types into its filter through FilterInput, a TextInput (omacom#15508), so the menu's own printable-key branch is gone and the menu half of this fix with it; the menu takes quattro's side. The image picker still filters from Keys.onPressed with the exact-modifier check, so it keeps Util.extendsFilter. The helper's test moves to filter-extends-test.sh, since quattro's filter-input-test.sh now tests FilterInput, and stops asserting on the menu.

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

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

The image picker now accepts printable keypad and AltGr characters through Util.extendsFilter.

  • The image picker filter accepts numpad and AltGr characters.

Reviews (1) · Last reviewed commit: "Merge quattro into numpad-input-keypad-m..." · Reviewed by Greptile

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

Copy link
Copy Markdown
Collaborator

This stopped merging into quattro, so I merged current quattro (c582e1d) into the branch and pushed it as 4114ce2. No rebase, no force push.

What changed in the merge. Since this PR was opened, #15508 moved the menu's search line onto shell/Ui/FilterInput.qml, a TextInput, and removed the menu's own printable-key check. A TextInput already types keypad digits and AltGr characters, so the menu half of this fix is no longer needed and the menu takes quattro's version. The image picker still filters from Keys.onPressed with the exact-modifier check (ImagePicker.qml:723), so it keeps Util.extendsFilter. quattro now has its own test/shell.d/filter-input-test.sh for FilterInput, so your helper test moved to test/shell.d/filter-extends-test.sh, with the menu assertions dropped.

Reproduction on an Omarchy worker VM, typing with wtype into omarchy-menu-images --filterable over images named alpha, beta5 and gamma, then pressing Return:

Input quattro This branch This branch, picker line reverted
keypad 5 alpha (dropped) beta5 alpha (dropped)
row 5 beta5 beta5 beta5
Ctrl+keypad 5 alpha alpha (still refused) alpha

On quattro, keypad 5, +, 1 typed into omarchy-menu-input arrive as 5+1, and Ctrl/Alt chords are still refused, so dropping the menu change loses nothing.

Tests on the worker. filter-extends-test.sh 19 passed, and it fails with the picker line reverted. filter-input-test.sh and image-picker-test.sh (167) pass, and ./test/cli passes. In ./test/shell, 4 of 425 files fail (ascii, branding-about-animation, hyprland-startup-cursor-cold, i18n), and the same 4 fail on unmodified quattro.

Second opinion. Codex Medium reviewed the merge resolution and the remaining diff and found no defects. It agreed with my reading, and its independence is not guaranteed.

Nothing is left for you. This waits on the maintainer.

@wstock wstock changed the title Accept numpad and AltGr input in the menu and image picker filters Accept numpad input in the image picker filter Oct 15, 2026
@omarchybot omarchybot removed the ready Good to merge label Nov 18, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

I compared this with the older #7659. Both apply the same printable-character and modifier rules to the image picker; I found no additional input case fixed here. Codex GPT-6 High, Opus 5.5 High and muse-wonder via pi (thinking high) reviewed the comparison. They agreed that the implementations cover the same cases; independence of that agreement is not guaranteed. Both PRs remain open for the maintainer's choice.

I also investigated the failed translation workflow on 4114ce2. GitHub no longer retains its job logs, so its original cause remains unconfirmed. On a disposable Omarchy worker, the structural translation test failed during locale generation at both this head and its original base c582e1d. Current quattro and a local merge of it into this branch passed the translation checks; the local merge also passed test/cli. The full shell suite was stopped after the competing-fix comparison settled, with one OEM-logo assertion failing and an agent-account test still waiting in sign-in, so it was not a passing run. I did not run a new graphical keypad reproduction.

No changes were pushed. This remains with the maintainer to choose between the two fixes; nothing is requested from you.

@wstock

wstock commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Closing this in favour of #7659. Since #15508 moved the menu onto FilterInput, the image picker is the only place either PR still changes, and both apply the same rule there: a single printable character types unless Ctrl, Alt or Super is held. #7659 is older, does it in one line, and now has its own behavioural test, so the shared helper here would have a single caller and adds nothing. One fewer for the maintainer to choose between.

Thanks for the reviews and worker runs along the way. (Comparison done with AI assistance, as with the PR itself.)

@wstock wstock closed this Nov 26, 2026
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.

3 participants