Skip to content

Fix graphical acceptance navigation and OCR matching - #16028

Closed
Gberfield wants to merge 1 commit into
omacom:quattrofrom
Gberfield:fix-graphical-acceptance-upstream
Closed

Gberfield wants to merge 1 commit into
omacom:quattrofrom
Gberfield:fix-graphical-acceptance-upstream

Conversation

@Gberfield

Copy link
Copy Markdown

The graphical acceptance suite navigates the old Menu Bar location and waits for the old Apps menu surface. Its Weather check can also reject a visible multiword location because 2× OCR puts SAN and FRANCISCO on different lines.

This test-only change:

  • Traverses Root → Trigger → Appearance → Menu Bar → Position Bar, retaining the setting, geometry, menu-close, and restoration assertions.
  • Exercises the actual omarchy-dock-apps grid through search, Omawrite launch, grid closure, and app closure; failure cleanup starts only after the no-preexisting-window guard.
  • Retains scaled OCR for small captions and tries native resolution when the same expected phrase is not found at 2×. Missing text, capture failures, and OCR failures still fail.
  • Adds six focused OCR-helper regressions.

Only four test files change. This branch is based directly on upstream quattro at 81fd2d23ca6e3462183a4dc8360de3113fa8d80c; it contains none of the LocalSend implementation or documentation commits from #14480.

Validation at 1755c7fc47fbfabfe6ab6e6eb0ec414b3499713a:

  • OCR helper: six checks pass; the new multiword case failed before the helper fix.
  • Real Tesseract replay of the retained Weather capture reproduces rejection by the original helper at 2×, recognition by the new helper, and rejection of absent text.
  • Current-upstream menu-parser suite: 164 checks pass. Dock suite: 39 checks pass. Bash syntax and git diff --check pass. The new shell test passes ShellCheck; the touched existing files retain the baseline SC2016/SC2034/SC2053 diagnostics.
  • Fresh ISO built from this checkout and installed without --reuse-base: 10/10 graphical acceptance files passed in 293 seconds, including unchanged session-test.sh, with no diagnostic sampling during acceptance. Eleven installed menu/bar/dock/helper/default-file hashes matched the checkout. Screenshots of the left bar, Weather panel, and Apps grid search were visually reviewed. A separate post-suite bar hypothesis probe failed its expected-result assertion (observed recovery instead of stale state), making the combined harness exit 1 after the suite itself exited 0; this is not counted as an acceptance-file failure.

Previous graphical evidence for the identical patched acceptance files, using an older installed runtime: one full run passed 9/10 files, failing only unchanged session-test.sh at revealed bar layer returns on screen; a clean diagnostic rerun passed 10/10. That rerun included read-only bar sampling, which may affect timing. The three corrected test files passed in both runs. These historical results are not presented as current-upstream installation acceptance, and the intermittent hide/reveal failure remains unresolved.

The session test, its timeout, and its assertions are unchanged. No sleeps, retries, or runtime fixes were added to obtain a passing result. The bar refresh investigation is separate from this PR.

The separate bar probe did not reproduce the suspected dropped in-flight refresh. The historical intermittent failure remains unexplained; this PR makes no stability claim. The disposable VM was stopped and its overlay removed; the reusable base, ISO, screenshots, and unedited logs are retained locally.

@greptile-apps

greptile-apps Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

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

Summary

Updates graphical acceptance tests to follow the current menu and Apps grid, and adds native-resolution OCR fallback.

  • Screen text checks try native size when 2× OCR misses a phrase.
  • The app test searches the dock grid and checks that Omawrite launches.
  • The menu test reaches bar settings through Trigger and Appearance.

No actionable issues found. This review inspected code; it did not rerun the graphical suite.

Reviews (1) · Last reviewed commit: "Fix graphical acceptance navigation and ..." · Reviewed by Greptile

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for this, and for writing up the evidence so carefully. I read it against quattro at 7075b61. It was not run on a test machine: two older open pull requests already fix the two failures it shares with them, so this one is not the fix that goes forward for those, and running it would not change that.

Overlaps. #15465 (opened 2026-10-14) makes the same omarchy-dock-apps change to shell-surfaces-test.sh. #15550 (opened 2026-10-15) makes the same Trigger > Appearance > Menu Bar route change to menu-test.sh. When fixes are this similar, the older one goes forward so whoever got there first keeps the credit.

The menu route is already out of date, here and in #15550. Since #15973, Appearance is a root entry (Apps, Learn, Appearance, Trigger, …) and its rows begin Theme, Background, Font, Menu Bar. Two Downs from the root now land on Appearance. The "Appearance" check at menu-test.sh:76 passes on that submenu's own heading, and the next Return opens Theme, so the test times out at menu-test.sh:80 waiting for "Menu Bar". The route on current quattro is Appearance > Menu Bar > Position Bar > Left Bar, with 2, 3, 1 and 2 Downs. This needs fixing in #15550 before it can land.

What this adds that the older pull requests do not:

  • The cleanup_app_launch EXIT trap in shell-surfaces-test.sh, which closes the grid and any Omawrite window when the test fails partway through. I've marked it to be folded into Look for the dock's app grid in the apps menu acceptance test #15465 with credit to you.
  • The native-resolution fallback in screen_contains and test/shell.d/acceptance-ocr-test.sh. Neither older pull request touches the Weather OCR problem. Nothing wrong was found in it: missing text, a failed capture and a failed OCR run all still fail, and the snapshot is removed either way. It would stand well as a pull request of its own containing just those two files, and nothing else would compete with it.

Who checked it. Claude Opus 5.5 reviewed this. Codex Medium, omabot's second reviewer, compared all three pull requests separately and reached the same conclusion on both overlaps. It found the same out-of-date route, including the wrong Down count to Menu Bar, and found nothing wrong with the OCR fallback or the trap. It could read this session's notes, so its agreement is not guaranteed to be independent. Both models agreed this is a bug.

This now waits on the maintainer, who decides between the competing pull requests.

@Gberfield

Copy link
Copy Markdown
Author

Thanks for the review and for carrying the cleanup trap into #15465 with credit.

Before opening an OCR-only PR, I found an older overlapping proposal: #12828 (24e25ec9ad5063b7bb07dd394702db404f9c86eb) changes the same screen_contains helper, using native-resolution OCR first, then 2×, and normalizing whitespace. The two-file extraction from #16028 is prepared locally at 4dcdb8c998fdc36c81aee38331560c4325e9fa0b, based on quattro at 7075b61c6aaa5d8589f6e816867508fc96dc49d9. It preserves 2×-first ordering and existing line-based matching. There is substantive overlap, so I have held back the separate PR pending coordination.

I checked both helpers against retained native/2× Weather captures with real Tesseract 5.5.3. The unchanged upstream helper misses the visible SAN FRANCISCO label; both the extraction and #12828 recognize it and WIND, reject absent San Diego, and remove the temporary capture. The native image was also visually inspected. This was an offline replay: capture was substituted with the retained images, while OCR and the Bash helper were real. It was not a new live graphical acceptance run.

Both implementations also pass the same six focused checks:

  • Native OCR finds a visible multiword label split by scaled OCR.
  • Scaled OCR still finds small captions absent from native OCR.
  • Missing text fails at both resolutions.
  • Failed captures never reuse a previous image.
  • OCR errors do not pass a text assertion.
  • The temporary capture is removed after success and failure.

The new regression fails against the unchanged upstream helper. These results support coordinating through #12828 rather than opening a duplicate OCR PR. Would you prefer the Weather reproduction and these checks to support that older PR, or a separately scoped proposal preserving the current OCR ordering and matching semantics?

The menu/dock work remains in its existing PRs. #16095 remains separate; #16182 stays draft, and the unresolved Escape investigation and baseline failures are not claimed as fixed by this OCR work.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for finding #12828. My earlier comment was wrong to say nothing else competes with the OCR fallback here: #12828 (opened 2026-09-21) changes the same screen_contains helper and already handles the Weather case. I compared the two against quattro at 7075b61; neither was run on a test machine this time, since the older one goes forward either way.

Why #12828 goes forward. It tries native resolution as well as 2×, so small captions still match, and it collapses whitespace before matching, so SAN and FRANCISCO on separate OCR lines still match SAN FRANCISCO at either scale. The fallback here only matches when one of the two scales happens to keep the label on one line. The fixes are similar and #12828 misses no case this one handles, so the older one keeps it. The trade-off is that collapsing whitespace can join two unrelated adjacent words into a phrase; that is the maintainer's to weigh on #12828, and it does not make this one clearly better. There is no need for a separate OCR-only pull request.

What this adds. Your acceptance-ocr-test.sh checks two things #12828's tests do not: that an OCR failure does not pass an assertion, and that the snapshot is removed afterwards. I've marked those to be folded into #12828 with credit to you. Your Tesseract replay of the real Weather captures is useful evidence for #12828 too, if you want to post it there.

With #15465 carrying the dock change and #15550 the menu route, every part of this pull request now has an older one going forward, so this one is not the fix that lands for any of them.

Who checked it. Claude Opus 5.5 reviewed this. Codex Medium, omabot's second reviewer, compared #12828 and this pull request separately and reached the same conclusion: #12828 wins, its whitespace normalization handles a split the native fallback can miss, and the OCR-failure and cleanup checks are what this one adds. It also raised the cross-line joining risk above. It could read this session's notes, so its agreement is not guaranteed to be independent.

This waits on the maintainer, who decides between the competing pull requests.

omarchybot added a commit to jdx/omarchy that referenced this pull request Oct 22, 2026
screen_contains must not pass when tesseract itself fails, and must remove its snapshot whether or not the text was found. Both checks come from omacom#16028's acceptance-ocr-test.sh, folded in here in this file's stub style.

The failing tesseract stub still prints the phrase, and the check runs under pipefail as every acceptance caller does, so it fails if the helper ever stops honouring tesseract's exit status; a stub that printed nothing would pass on the missing text alone. The cleanup check runs straight after a match and straight after a miss, so a missing rm on either path is caught rather than masked by a later call reusing the same path.

Co-Authored-By: GBerfield <89108862+Gberfield@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@Gberfield

Copy link
Copy Markdown
Author

The unique additions are now preserved in the older PRs selected during review:

Closing this PR as superseded, retaining the branch and evidence. No separate OCR PR is needed. #16095 and draft #16182 remain separate; this closure claims neither bar-reveal nor Escape timing is fixed.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants