Skip to content

Tests: the Notes-button test clicks where the button is laid out, so it passes without Inter - #1300

Merged
aiongg merged 1 commit into
storytold:mainfrom
dotCooCoo:fix/status-notes-button-click
Oct 25, 2026
Merged

aiongg merged 1 commit into
storytold:mainfrom
dotCooCoo:fix/status-notes-button-click

Conversation

@dotCooCoo

@dotCooCoo dotCooCoo commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

On Windows 11 on main at 38d2ade, status::tests::a_long_language_name_leaves_the_notes_button_clickable fails with "the click reached the Notes button" when CRAFT_FONTS_DIR points at a craft-fonts checkout of its main branch.

The test clicked x 150 for the gap before the status bar's controls and x 200 for the Notes button. Those positions hold for Inter. craft-fonts main has no fonts/latin-manifest.txt, so Inter is not embedded and theme::font_definitions sets the interface text in BIZ UDPGothic. Labels set in BIZ UDPGothic are wider than in Inter, so the Notes button is laid out farther left. Measured at 700 x 800 on Windows 11:

Fonts Language click area Notes button Test
craft-fonts main x 125..132 x 149..218 fails: x 150 opens the notes pane and x 200 closes it
Inter only (the files of craft-fonts 4391305, which CI uses) x 125..132 x 167..231 passes
no craft-fonts x 125..132 x 173..235 passes

The language name's click area ends at x 132 in all three cases, so the status bar is laid out correctly and the test's fixed positions are the fault.

What changes:

  • The status bar's Notes and Comments buttons now report widget info with their names and on/off state, as nav_item in backstage.rs does, so screen readers and tests can find them.
  • The test reads the Notes button's rect with get_by_label("Notes"), checks that it starts after x 132, clicks midway between x 132 and the button, and then clicks the button's center. It checks the same things as before, and also that the click in the gap leaves the notes pane closed.

Test: with the language name's clip widened to the bar's right edge, so that its click area covers the controls, the test fails with "the Language dialog stayed closed". With the change it passes with craft-fonts main, with Inter only and with no craft-fonts.

Checks: cargo fmt --all -- --check, cargo clippy -p deckcraft-ui-egui --all-targets -- -D warnings, cargo xtask assets and cargo xtask layers.

On Windows 11 (x86-64) with rustc 1.99.1, on top of main at 38d2ade, with #1292 merged in:

  • cargo xtask ci passes its 8 steps: 1,877 tests passed, 0 failed, 6 ignored.

git merge-tree reports no conflicts with main at 38d2ade.

Summary by CodeRabbit

  • Accessibility

    • Status-bar buttons now expose their labels and selected state to assistive technologies.
  • Bug Fixes

    • Clicking the gap beside the status-bar controls no longer opens the Language dialog or toggles the Notes pane; clicking Notes still toggles the pane.

…it passes without Inter

status::tests::a_long_language_name_leaves_the_notes_button_clickable
clicked x 150 for the gap before the status bar's controls and x 200 for
the Notes button. Those positions hold for Inter. With a craft-fonts
checkout that has no fonts/latin-manifest.txt, the interface text is set
in BIZ UDPGothic. Labels set in BIZ UDPGothic are wider than in Inter,
so the Notes button starts at x 149. The first click then toggled the
notes pane and the second toggled it back.

The status bar's Notes and Comments buttons now report widget info with
their names. The test reads the Notes button's rect, clicks midway
between x 132 and its left edge, and then clicks its center.
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 38d2ade and c207d6e.

Files selected for processing: 1
  • crates/ui-egui/src/status.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Walkthrough

The status bar now exposes label and selected-state metadata for labeled buttons. Its UI test uses the rendered Notes button bounds to check clicks in the gap and on the button.

Changes: Status bar click handling

Layer / File(s) Summary
Button metadata and click test
crates/ui-egui/src/status.rs
labeled reports the button label and selected state. The test queries the Notes button bounds and checks that a click in the gap does not open the Language dialog or toggle Notes, while a click on Notes toggles the pane.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

  • storytold/deckcraft#1260: Introduced the status-bar layout change and fixed-coordinate Notes click test that this PR updates.

Suggested reviewers: aiongg

Merge Risk: Minimal · up to c207d

No actionable merge-blocking risk remains.

Architecture risk: Low · up to c207d

The change affects 1 system.

Changed systems: crates

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in crates/ui-egui/src/status.rs: labeled now reports button widget information with its label and current selected state.
  • observed — Modified behavior in crates/ui-egui/src/status.rs: The test module now imports Queryable for querying rendered UI elements.
  • observed — Modified behavior in crates/ui-egui/src/status.rs: The test replaces hard-coded control positions with the computed right-controls boundary and the laid-out Notes button rectangle, and begins a click helper that accepts a position.
  • observed — Modified behavior in crates/ui-egui/src/status.rs: The test clicks the gap between the control boundary and Notes, asserting that neither the Language dialog nor Notes state changes, then clicks Notes by its rendered center. This replaces clicks at fixed x-coordinates.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed 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 names the test change: the Notes-button test now clicks where the button is laid out, so it passes without the Inter font. The changeset matches this. The status.rs test replaces fixed click…
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.
Full details: Title check

Explanation

The title names the test change: the Notes-button test now clicks where the button is laid out, so it passes without the Inter font. The changeset matches this. The status.rs test replaces fixed click coordinates with positions derived from the Notes button's reported widget rect, and the labeled widget metadata supports the lookup. The title is specific, but it is long at 92 characters and it omits the accessibility label change, so it is not a perfect summary. It is still related to the main change and is not misleading.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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