Skip to content

test(ui): add iced interaction harness - #219

Merged
thewrz merged 2 commits into
mainfrom
test/iced-test-harness
Jul 25, 2026
Merged

test(ui): add iced interaction harness#219
thewrz merged 2 commits into
mainfrom
test/iced-test-harness

Conversation

@thewrz

@thewrz thewrz commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Why

Important Iced interactions still depended on manual “launch and click” verification. That made the sort flow from #211 and staged settings search from #213 easy to regress without a compositor-free check in ordinary cargo test.

What

Adds a small iced_test Simulator harness around the real persistence-disabled HonkHonk state, view(), and update() boundaries. It drives visible-text and stable-ID selectors through real click/key/typewrite events and covers:

  • opening the sort chip, selecting Name, dismissing the menu, and persisting the per-view sort preference;
  • filtering settings categories, selecting a filtered category, exposing highlighted matching rows, interacting with a result, and scheduling row restoration when the query clears.

The Flatpak Cargo source manifest is regenerated for the new lockfile entries. No pixel snapshots or application runtime dependencies are added. Unit-test environments install DejaVu fonts so styled and monospace settings text shapes deterministically; Arch source packages declare this as a test-only checkdepends.

New dependency justification

iced_test = 0.14.0 is the official headless interaction crate shipped alongside Iced and matches HonkHonk’s Iced 0.14 line. Recreating its Simulator, widget traversal, focus, and synthetic event machinery would be brittle and would duplicate upstream. License: MIT. cargo deny check passes with advisories, licenses, bans, and sources green.

Known limits

Layer A validates update/view logic and widget-tree behavior only. It does not exercise winit, wgpu, the compositor, ksni tray integration, desktop portals, or PipeWire audio.

Testing

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test (703 library tests plus binary/integration/doc suites)
  • cargo deny check
  • Flatpak Cargo source regeneration is deterministic
  • CI green

🤖 Co-authored by Codex. Closes #215.

Summary by CodeRabbit

  • Bug Fixes

    • Improved settings search behavior, including highlighting matching rows and restoring the settings view when the search is cleared.
    • Ensured settings selections update and persist correctly.
  • Tests

    • Added automated interaction tests covering settings search, filtering, highlighting, and sorting preferences.
    • Improved test reliability for GUI interactions and text rendering.

Exercise the real HonkHonk view/update loop headlessly for sort persistence and staged settings search behavior.

Co-Authored-By: Codex <noreply@openai.com>
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

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 Plus

Run ID: 9dc472f7-9df0-410d-bc25-2549d9429a7a

📥 Commits

Reviewing files that changed from the base of the PR and between a7af221 and 695cfaa.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (14)
  • .github/workflows/rust.yml
  • Cargo.toml
  • packaging/aur/honkhonk-git/.SRCINFO
  • packaging/aur/honkhonk-git/PKGBUILD
  • packaging/aur/honkhonk/.SRCINFO
  • packaging/aur/honkhonk/PKGBUILD
  • packaging/flatpak/cargo-sources.json
  • src/app/settings.rs
  • src/app/settings/gui_tests.rs
  • src/app/settings/test_support.rs
  • src/ui/search_bar.rs
  • src/ui/settings/controls.rs
  • src/ui/settings/mod.rs
  • src/ui/settings/scroll.rs

📝 Walkthrough

Walkthrough

Adds an iced_test harness for compositor-free GUI interaction tests covering sorting and settings search. It also adds stable widget identities, test-only modules, vendored crates, CI font support, and AUR check dependencies.

Changes

Headless GUI test harness

Layer / File(s) Summary
Test dependencies and vendored sources
Cargo.toml, packaging/flatpak/cargo-sources.json, .github/workflows/rust.yml, packaging/aur/*
Adds pinned iced_test dependencies, vendored crate sources, DejaVu font availability in CI, and AUR test dependencies.
Stable settings widget identities
src/ui/search_bar.rs, src/ui/settings/scroll.rs, src/ui/settings/controls.rs, src/ui/settings/mod.rs
Adds stable settings input and highlighted-row IDs and uses highlighted state in rendered row tracking.
GUI harness and interaction tests
src/app/settings.rs, src/app/settings/test_support.rs, src/app/settings/gui_tests.rs
Adds a simulator-based GuiHarness and tests for sort selection, settings filtering, theme selection, and search restoration.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GuiTest
  participant GuiHarness
  participant iced_test_Simulator
  participant HonkHonk
  GuiTest->>GuiHarness: Simulate clicks, typing, and key presses
  GuiHarness->>iced_test_Simulator: Create simulator over app view
  iced_test_Simulator-->>GuiHarness: Emit Message values
  GuiHarness->>HonkHonk: Apply messages through update
  HonkHonk-->>GuiTest: Return updated widget tree and settings state
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and matches the main change: adding an iced interaction harness for UI tests.
Linked Issues check ✅ Passed The PR adds the iced_test harness, helpers, and GUI tests that cover sort selection and staged settings search.
Out of Scope Changes check ✅ Passed The added dependency, font packages, manifest regeneration, and test-support code all align with the stated harness and test goals.

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

@thewrz

thewrz commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator Author

New dependency justification: iced_test 0.14.0 is the official Simulator/selector harness released alongside Iced 0.14. It is pinned to the application’s Iced line, licensed MIT, introduces no system dependencies, and passes cargo deny check. Reimplementing its headless widget traversal and synthetic event machinery would duplicate upstream and be less reliable.

Install DejaVu fonts in the unit-test job and declare the Arch package as a source-package check dependency so iced_test can shape styled and monospace settings text in minimal environments.

Co-Authored-By: Codex <noreply@openai.com>
@thewrz
thewrz marked this pull request as ready for review July 25, 2026 22:41
@thewrz
thewrz merged commit d95a9c6 into main Jul 25, 2026
11 of 14 checks passed
@thewrz
thewrz deleted the test/iced-test-harness branch July 25, 2026 23:07
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.

test(ui): add iced_test interaction harness

1 participant