Skip to content

Fix native Controls interactions and idle layout work - #2

Merged
dogukani merged 1 commit into
mainfrom
fix/controls-click-ancestors
Sep 23, 2026
Merged

dogukani merged 1 commit into
mainfrom
fix/controls-click-ancestors

Conversation

@dogukani

@dogukani dogukani commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem

In the Windows notes-windows example, child widgets could absorb clicks intended for their row, edit notifications could miss reparented controls, and newly attached views could remain hidden. The native Controls tree was also laid out on every frame while idle.

Changes

  • Dispatch clicks to the nearest widget with a registered handler.
  • Forward edit notifications to a reparented control's current widget parent and ignore unchanged text notifications.
  • Show widgets attached to the installed view tree.
  • Run Controls layout when state, bounds, or scale changes, and avoid repeating unchanged visibility transitions.

Verification

  • Built notes-windows, notes-jsx, weather, and bubble-grid-jsx for Windows; all launched. notes-jsx passed the native verify hook.
  • Baseline and patched notes-jsx screenshots matched exactly for initial state, a folder click, and synthetic text input.
  • Manual notes-windows checks covered sidebar toggle, rapid folder and note selection, title/body editing, and New Note; content remained correct and responsiveness was acceptable.
  • After warmup, two 5-second idle samples used 4171.9–4390.6 ms CPU before the change and 0–15.6 ms after it. Folder-transition timing varied between runs, so this patch does not claim a consistent interaction-latency gain.

The SDK tests passed 5/5 after generation. The unregenerated Windows checkout has an existing CRLF/LF mismatch in the generated-content test; no generated files are part of this patch.

Summary by CodeRabbit

  • Bug Fixes
    • Newly attached views beneath the root now appear as expected.
    • Clicks on nested controls can reach the first available click handler in their parent chain.
    • Click behavior now stays in sync with whether a handler is set, including for labels.
    • Text-change callbacks no longer run when the control’s text has not changed.
    • Notifications from reparented controls are forwarded to their widget parent when applicable.
    • Layout work is skipped when the layout is clean and the frame area and scale are unchanged.

@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 53f07fa3-b13e-4f6b-a0d5-63ab817b3b80

📥 Commits

Reviewing files that changed from the base of the PR and between e0e332b and 419060d.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: b2829ce5-4c6d-4523-ae46-6fc440fc35b1

📥 Commits

Reviewing files that changed from the base of the PR and between e06836c and e0e332b.

📒 Files selected for processing (3)
  • packages/geastack-windows/targets/win32/main/native/controls.cpp
  • packages/geastack-windows/targets/win32/main/win32_main.cpp
  • packages/geastack-windows/targets/win32/main/win32_widgets.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The Windows target updates view layout and visibility handling, synchronizes widget click callbacks, forwards selected command notifications to parent widgets, skips text-change processing when text is unchanged, and dispatches clicks to the nearest ancestor with a callback.

Changes

Windows Controls

Layer / File(s) Summary
View layout, attachment, and visibility
packages/geastack-windows/targets/win32/main/native/controls.cpp
Layout runs when dirty or when the frame area or scale changes. Newly attached subtrees are shown according to each node’s hidden state. Hidden-state updates synchronize the stored value, widget style, and window visibility.
Widget event routing and click callbacks
packages/geastack-windows/targets/win32/main/native/controls.cpp, packages/geastack-windows/targets/win32/main/win32_main.cpp, packages/geastack-windows/targets/win32/main/win32_widgets.cpp
Click handlers are synchronized with widget callbacks, and label click transparency reflects whether a handler is set. Selected WM_COMMAND notifications are forwarded to parent widgets. Unchanged text notifications are skipped, and clicks invoke the first callback found while walking up the widget parent chain.

Priority: ➖ Normal

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

Change: Bug fix

Suggested reviewers: dashersw

Merge Risk: ⚪ Minimal · up to e0e33

The Windows Controls changes are mergeable after normal checks; no actionable failure was established.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 3 files. 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 clearly summarizes the two main changes: fixes to native Controls interactions and reduced idle layout work.
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.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

@dashersw
dashersw force-pushed the fix/controls-click-ancestors branch from e0e332b to 419060d Compare September 23, 2026 23:49
@dogukani
dogukani merged commit 397cd73 into main Sep 23, 2026
3 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 23, 2026
@dogukani
dogukani deleted the fix/controls-click-ancestors branch September 24, 2026 01:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant