Skip to content

test(e2e): convert view bounds to screen coordinates - #320

Merged
ErikBjare merged 1 commit into
ActivityWatch:masterfrom
TimeToBuildBob:fix/e2e-screen-coordinates
Oct 6, 2026
Merged

ErikBjare merged 1 commit into
ActivityWatch:masterfrom
TimeToBuildBob:fix/e2e-screen-coordinates

Conversation

@TimeToBuildBob

Copy link
Copy Markdown
Contributor

Problem

Master CI run 37450774307 failed in NativeWindowInsetsTest.syncToggleReceivesRealTap: all three injected taps landed at (281, 53), but the switch preference never changed. The run had no ANR and the activity was resumed and displayed, so this is the recurrent no-ANR input miss rather than a product regression from the README-only master commit.

tapViewCenter passes getGlobalVisibleRect() coordinates directly to UiDevice.click(). Those coordinates are relative to the root view, while UiDevice.click() expects physical screen coordinates. Because native windows are padded below the status bar, the tap was injected one status-bar height too high. The CI coordinates prove it: the switch's root-relative center was y=53, inside the physical status-bar band.

Fix

Translate the visible rect by the decor view's physical-screen location before injecting the tap. This keeps the test as a real input-pipeline regression test rather than replacing it with performClick().

Verification

  • git diff --check passes.
  • The local host lacks Java/Android SDK, so the instrumentation compile could not run locally; CI is the authoritative check.
  • Source commit: 529f085.

Fixes master CI run https://github.com/ActivityWatch/aw-android/actions/runs/37450774307.

Git-Session-Id: 3a67ecec-28dc-57d8-b918-bdc6f9f45f68
@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low risk] Test helper adjusts coordinate conversion for UI automation.

This PR appears safe to merge.

Summary

Updates tapViewCenter to add the decor view’s screen position to the visible bounds before calling UiDevice.click().

  • Keeps taps on the real input path.
  • No actionable issues found.
  • Android instrumentation tests were not run during this review.

Reviews (1) · Last reviewed commit: "test(e2e): convert view bounds to screen..."

@TimeToBuildBob

TimeToBuildBob commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 AI code review

The PR changes tapViewCenter in NativeWindowInsetsTest.kt to allocate rootLocation and read the decor view's location on screen. It offsets the rectangle returned by getGlobalVisibleRect() by that location before passing its center to UiDevice.click().

Safe to merge — no P0/P1 findings

Confidence 5/5

✅ No findings. The diff looks correct to me on this pass.

Files changed (1) — the diff as I read it
  • mobile/src/androidTest/java/net/activitywatch/android/NativeWindowInsetsTest.kt — Adds decor-view screen-location lookup and offsets the visible bounds in tapViewCenter before injecting the tap.

Reviewed 529f08556474 · panel: codex:gpt-6.1-sol · subscription engine · 13s · about this reviewer

Maintainer commands

@TimeToBuildBob review (own line) — fresh review · @TimeToBuildBob fix — a worker acts on the findings. Once per comment; 👀 = received.

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

Fixed master run 37450774307 in #320. The failing test was injecting all three taps at root-relative (281, 53) directly into the physical screen, i.e. one status-bar offset too high. The helper now translates the view rect by the decor view's screen location before UiDevice.click().

Verification on the exact fix head (529f085): full CI is green, including Test E2E (29); Greptile and Bob review are both 5/5 with no findings. Ready for merge.

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

CI-green and mergeable (Greptile 5/5) — waiting only on a maintainer click.

This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted.

@ErikBjare
ErikBjare merged commit a921dbe into ActivityWatch:master Oct 6, 2026
8 checks passed
ErikBjare added a commit that referenced this pull request Oct 7, 2026
* fix(sync): use case-insensitive filter for 'zero peers' warning

aw-server-rust emits 'Zero peers in a configured sync dir…' (capital Z)
but the push-only filter checked 'zero peers' (lowercase), so the warning
was never suppressed. Use it.lowercase() to make the match case-insensitive.

Fixes: #321
Git-Session-Id: f63a

* test(sync): use capital-Z warning in suppression tests to cover case fix

Both suppression tests used lowercase "zero peers" — they passed with the old
broken case-sensitive filter, so they provided no coverage for the actual bug.

aw-server-rust emits "Zero peers" (capital Z); update the primary suppression
test to use that form and add a lowercase variant to verify both cases are
handled by the case-insensitive filter.

Git-Session-Id: 10abe743-3a89-594d-98d8-b385b7ff3722

* docs(fastlane): add phone screenshots for F-Droid/store listings (#322)

Six light-mode screenshots of v0.14.2 with demo data (Pixel-class 1080x2400):
activity day, day categories, 30 days, week, category sunburst, timeline.

* test(e2e): convert view bounds to screen coordinates (#320)

Git-Session-Id: 3a67ecec-28dc-57d8-b918-bdc6f9f45f68

* fix(ui): let SyncSettingsActivity follow system dark mode (#326)

* fix(ui): let SyncSettingsActivity follow system dark mode

applySafeWindowInsets() always called applySystemBarAppearance(darkContent=false),
hardcoding white background for all native screens even in dark mode. This made
system bar icons and window background stay light regardless of the device theme,
causing white-on-white text in SyncSettingsActivity when dark mode is on.

Add a followNightMode parameter (default false — preserves existing behaviour for
MainActivity which drives appearance from the embedded web UI). SyncSettingsActivity
passes followNightMode=true so its DayNight theme attributes resolve to the correct
colours automatically.

Fixes item 5 in #321.

Git-Session-Id: 766d

* docs(colors): update night-mode guidance — SyncSettings now follows DayNight

Git-Session-Id: 766d

* fix(ui): walk WebView history on back before finishing MainActivity (#327)

With gesture navigation a back-swipe finished MainActivity even when the
embedded web UI had pages to go back to. Back now closes the drawer first,
then goes back in the WebView, and only finishes when there is no history
left.

Part of #321 (item 6).

Git-Session-Id: f4b5

---------

Co-authored-by: Erik Bjäreholt <erik@bjareho.lt>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants