Skip to content

ci(CUA-656): update nix-wayland comment — cursor-click-gif tests now GREEN - #2028

Merged
r33drichards merged 1 commit into
mainfrom
f/cua-656-fix-cursor-click-gif-flaky-tests-in-native-wayland-ci-suite
Jun 25, 2026
Merged

ci(CUA-656): update nix-wayland comment — cursor-click-gif tests now GREEN#2028
r33drichards merged 1 commit into
mainfrom
f/cua-656-fix-cursor-click-gif-flaky-tests-in-native-wayland-ci-suite

Conversation

@r33drichards

@r33drichards r33drichards commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Update the nix-wayland.yml workflow comment to reflect that the Wayland CI suite is now green (all cursor-click-gif tests pass), removing stale "TDD RED suite" / "X11-only today" / "EXPECTED TO FAIL" language.

Background

The 3 originally failing tests (kde / cursor-click-gif, xfce-labwc / cursor-click-gif, gnome / cursor-click-gif) were fixed when:

  1. Root cause: The test relied on host compositor focus routing for keyboard delivery after a virtual pointer click. In headless CI, labwc (without tiling config) opens floating windows at arbitrary positions — the click at (120, 120) may miss the target. xfce-sway worked because workspace_layout stacking fills the output.

  2. Fix in commit 6be1de83 (PR chore(deps): apply security dependency rollup #2000): Changed cursor-click-gif.nix to eis = true — the EIS-backed nested cua-compositor path. The click() call is retained to exercise the virtual pointer path, but type_text/press_key use the deterministic focus-free injection path.

  3. Confirmed green: All 4 cursor-click-gif combinations pass on main (run 28139436182).

Change

One comment block in .github/workflows/nix-wayland.yml — removes outdated "TDD RED suite" framing.

References

Summary by CodeRabbit

  • Documentation
    • Updated the workflow description to better explain the Native-Wayland test suite and its blocking status.
    • Clarified when the suite runs, aligning its trigger scope with related build workflows.

@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Jun 25, 2026 12:07pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b1ad512c-0940-4e98-a492-04d4952c3611

📥 Commits

Reviewing files that changed from the base of the PR and between e79a178 and aac6064.

📒 Files selected for processing (1)
  • .github/workflows/nix-wayland.yml
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/nix-wayland.yml

📝 Walkthrough

Walkthrough

The workflow comments for the Native-Wayland reproduction suite were rewritten to describe the EIS-backed compositor injection path, restate the trigger scope, and change the suite framing to blocking status.

Changes

Native-Wayland workflow comments

Layer / File(s) Summary
Header comment rewrite
.github/workflows/nix-wayland.yml
The workflow comments restate the suite scope, deterministic input path, trigger scope, and blocking status.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 I hop by the Wayland trail,
With EIS notes tucked in my mail.
Blocking signs now gleam so bright,
While triggers stay just right.
Hop hop—comments set the sail!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the workflow comment update and the newly green cursor-click-gif tests.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch f/cua-656-fix-cursor-click-gif-flaky-tests-in-native-wayland-ci-suite

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…acked fix

The cursor-click-gif tests (kde, xfce-labwc, gnome, xfce-sway) all pass
since the EIS-backed cua-compositor injection path landed in #2000.
Remove the stale 'TDD RED suite' / 'X11-only today' / 'EXPECTED TO FAIL'
language that no longer reflects reality.

Closes CUA-656.
@r33drichards
r33drichards force-pushed the f/cua-656-fix-cursor-click-gif-flaky-tests-in-native-wayland-ci-suite branch from e79a178 to aac6064 Compare June 25, 2026 12:07
@r33drichards r33drichards changed the title fix(CUA-656): stabilize cursor-click-gif tests via EIS-backed compositor (kde/xfce-labwc/gnome) ci(CUA-656): update nix-wayland comment — cursor-click-gif tests now GREEN Jun 25, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
libs/cua-driver/rust/crates/platform-linux/src/input/mod.rs (2)

1394-1423: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Serialize scratch-keycode remaps.

change_keyboard_mapping mutates process-external X server state, and every caller uses the same SCRATCH_KC. Concurrent Unicode type_text calls can overwrite each other’s mapping or capture a temporary mapping as original_scratch.

Consider guarding the remap/send/restore section with a process-wide mutex for Unicode paths.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@libs/cua-driver/rust/crates/platform-linux/src/input/mod.rs` around lines
1394 - 1423, The Unicode scratch-keycode path in type_text currently mutates
shared X server state via change_keyboard_mapping on the fixed SCRATCH_KC, so
concurrent calls can race and restore the wrong mapping. Add a process-wide
mutex around the remap/send/restore sequence in the type_text flow (including
the original_scratch capture, the temporary mapping, key sending, and
restoration) so only one Unicode remap using char_to_keycode_shift can run at a
time.

1416-1463: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Restore the scratch mapping even when event delivery fails.

After change_keyboard_mapping succeeds, any later ? on send_event/flush returns before Line 1460 restores keycode 8, leaving the X server keyboard map globally remapped.

Proposed structure
-        conn.send_event(false, window, EventMask::KEY_PRESS, &press)?;
-        sleep(Duration::from_millis(KEY_DELAY_MS));
-        conn.send_event(false, window, EventMask::KEY_RELEASE, &release)?;
-        conn.flush()?;
-
-        // Restore the scratch keycode mapping after a Unicode remap.
-        if keycode == 0 && !original_scratch.is_empty() {
-            conn.change_keyboard_mapping(1, SCRATCH_KC, original_scratch.len() as u8, &original_scratch)?;
-            conn.flush()?;
-        }
+        let send_result = (|| -> Result<()> {
+            conn.send_event(false, window, EventMask::KEY_PRESS, &press)?;
+            sleep(Duration::from_millis(KEY_DELAY_MS));
+            conn.send_event(false, window, EventMask::KEY_RELEASE, &release)?;
+            conn.flush()?;
+            Ok(())
+        })();
+
+        if keycode == 0 && !original_scratch.is_empty() {
+            let restore_result = (|| -> Result<()> {
+                conn.change_keyboard_mapping(
+                    1,
+                    SCRATCH_KC,
+                    original_scratch.len() as u8,
+                    &original_scratch,
+                )?;
+                conn.flush()?;
+                Ok(())
+            })();
+            send_result?;
+            restore_result?;
+        } else {
+            send_result?;
+        }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@libs/cua-driver/rust/crates/platform-linux/src/input/mod.rs` around lines
1416 - 1463, The Unicode scratch-key remap in the input path is only restored
after the event sends succeed, so an error from `send_event` or `flush` can
leave `SCRATCH_KC` globally remapped. Update the Unicode injection logic in the
function that builds `effective_kc` and emits the
`KeyPressEvent`/`KeyReleaseEvent` so the original mapping is always restored
even on failure, for example by wrapping the event delivery and restore in a
guard or cleanup path that runs before returning any error.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@nix/cua-driver/tests/electron-cjk-input.nix`:
- Around line 380-386: The CJK input assertion in the test is too permissive
because the success branch in the readback check uses containment instead of
exact equality, so extra or duplicated characters can still pass. Update the
validation in the CJK input flow around the readback handling (including the
later assertion path that depends on this result) to require `readback_value` to
exactly match `CJK_TEXT`, and keep the partial/empty failure messages unchanged
so the test enforces the contract it claims.

---

Outside diff comments:
In `@libs/cua-driver/rust/crates/platform-linux/src/input/mod.rs`:
- Around line 1394-1423: The Unicode scratch-keycode path in type_text currently
mutates shared X server state via change_keyboard_mapping on the fixed
SCRATCH_KC, so concurrent calls can race and restore the wrong mapping. Add a
process-wide mutex around the remap/send/restore sequence in the type_text flow
(including the original_scratch capture, the temporary mapping, key sending, and
restoration) so only one Unicode remap using char_to_keycode_shift can run at a
time.
- Around line 1416-1463: The Unicode scratch-key remap in the input path is only
restored after the event sends succeed, so an error from `send_event` or `flush`
can leave `SCRATCH_KC` globally remapped. Update the Unicode injection logic in
the function that builds `effective_kc` and emits the
`KeyPressEvent`/`KeyReleaseEvent` so the original mapping is always restored
even on failure, for example by wrapping the event delivery and restore in a
guard or cleanup path that runs before returning any error.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b7e43a6e-7ff0-48dc-8c54-a3b0c6259a8d

📥 Commits

Reviewing files that changed from the base of the PR and between 9e84c1d and e79a178.

📒 Files selected for processing (5)
  • .github/workflows/nix-build.yml
  • flake.nix
  • libs/cua-driver/rust/crates/platform-linux/src/input/mod.rs
  • nix/cua-driver/tests/electron-cjk-input.nix
  • nix/cua-driver/tests/wayland/cursor-click-gif.nix

Comment on lines +380 to +386
# Assertion: the CJK characters must be present in the input
if readback_value and CJK_TEXT in readback_value:
print("CJK_INPUT_OK: CJK text found in input field", flush=True)
elif readback_value and len(readback_value) > 0:
print(f"CJK_INPUT_PARTIAL: got {readback_value!r}, expected {CJK_TEXT!r}", flush=True)
else:
print(f"CJK_INPUT_FAIL: input empty, expected {CJK_TEXT!r}", flush=True)

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Enforce the exact CJK match the test claims.

Line 381 passes when the field merely contains CJK_TEXT, so duplicated or extra characters still produce CJK_INPUT_OK and satisfy Line 545. Use equality to match the stated exact-readback contract.

Proposed fix
-            if readback_value and CJK_TEXT in readback_value:
+            if readback_value == CJK_TEXT:
                 print("CJK_INPUT_OK: CJK text found in input field", flush=True)

Also applies to: 542-548

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@nix/cua-driver/tests/electron-cjk-input.nix` around lines 380 - 386, The CJK
input assertion in the test is too permissive because the success branch in the
readback check uses containment instead of exact equality, so extra or
duplicated characters can still pass. Update the validation in the CJK input
flow around the readback handling (including the later assertion path that
depends on this result) to require `readback_value` to exactly match `CJK_TEXT`,
and keep the partial/empty failure messages unchanged so the test enforces the
contract it claims.

@r33drichards

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

Copy link
Copy Markdown
Contributor

Linux visual regression artifacts

Matrix jobs now run independently. Download visual artifacts from this workflow run.
Each background-GUI job uploads a .gif of the interaction plus two annotated PNGs (<app>.png raw, <app>-atspi.png with AT-SPI element boxes); the cua-driver-linux-som-overlays artifact adds <app>-som.png cua Set-of-Marks overlays:

  • cua-driver-linux-cursor-click-gif
  • cua-driver-linux-background-terminal-gif
  • cua-driver-linux-parallel-drag-xserver
  • cua-driver-linux-background-gui-chromium
  • cua-driver-linux-background-gui-tk
  • cua-driver-linux-background-gui-gtk3-gedit
  • cua-driver-linux-background-gui-gtk3-mousepad
  • cua-driver-linux-background-gui-gtk3-scite
  • cua-driver-linux-background-gui-gtk4-characters
  • cua-driver-linux-background-gui-qt5-manuskript
  • cua-driver-linux-background-gui-qt5-klog
  • cua-driver-linux-background-gui-qt5-openambit
  • cua-driver-linux-background-gui-qt6-kate
  • cua-driver-linux-background-gui-qt6-kcalc
  • cua-driver-linux-background-gui-qt6-okular
  • cua-driver-linux-background-gui-qt6-qownnotes
  • cua-driver-linux-background-gui-electron-zettlr
  • cua-driver-linux-background-gui-electron-joplin
  • cua-driver-linux-background-gui-electron-logseq
  • cua-driver-linux-som-overlays

Open workflow run and download artifacts

@r33drichards
r33drichards merged commit 46efc5f into main Jun 25, 2026
37 checks passed
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