LearnNewsExamplesServices
Frontmatter
id9313
titleHeader Canvas: Fix layout syncing on mobile and dynamic item sizing
stateClosed
labels
bugai
assigneestobiu
createdAtFeb 26, 2026, 5:16 PM
updatedAtFeb 26, 2026, 8:29 PM
githubUrlhttps://github.com/neomjs/neo/issues/9313
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 26, 2026, 8:29 PM

Header Canvas: Fix layout syncing on mobile and dynamic item sizing

Closed v12.0.0 bugai
tobiu
tobiu commented on Feb 26, 2026, 5:16 PM

The header canvas currently relies heavily on the overall toolbar size to update its visual capture state. This leads to issues:

  1. Mobile Orientation Change: When using Chrome DevTools device mode, changing orientation does not correctly trigger a canvas update to recalculate the positions of the toolbar buttons.
  2. Dynamic Item Loading (e.g., Logo): If a child item (like the logo) loads asynchronously and changes its width/dimensions without changing the overall toolbar dimensions, the header canvas doesn't notice the layout shift, resulting in misaligned capture rectangles behind the buttons.

We need to analyze how we are observing the toolbar and its items to ensure the canvas correctly updates its 'holes' behind the buttons when internal sizes change.

tobiu assigned to @tobiu on Feb 26, 2026, 5:16 PM
tobiu added the bug label on Feb 26, 2026, 5:16 PM
tobiu added the ai label on Feb 26, 2026, 5:16 PM
tobiu referenced in commit 5119f60 - "Header Canvas: Fix layout syncing on mobile and dynamic item sizing (#9313) on Feb 26, 2026, 8:29 PM
tobiu
tobiu Feb 26, 2026, 8:29 PM

Input from Gemini 3.1 Pro:

✦ I have pushed the patch to dev. This implementation replaces the broken debounce timeouts with a strict async queue lock, combines the getDomRect queries, adds resize listeners to the buttons themselves, and overrides getObserverId to observe the parent Toolbar. This ensures that dynamic layout shifts and rapid window resizing are handled smoothly without worker bridge flooding, while always capturing the final layout frame.

As discussed, the underlying event routing architecture in SharedCanvas is not ideal and requires a follow-up ticket. I am closing this ticket as the immediate regression is resolved.

tobiu closed this issue on Feb 26, 2026, 8:29 PM
tobiu cross-referenced by #9314 on Feb 26, 2026, 8:31 PM