Skip to content

window: Show the home of an app's declared windows at once - #4274

Open
huacnlee wants to merge 2 commits into
mainfrom
window-home-appears-at-once
Open

huacnlee wants to merge 2 commits into
mainfrom
window-home-appears-at-once

Conversation

@huacnlee

@huacnlee huacnlee commented Dec 3, 2026

Copy link
Copy Markdown
Member

Summary

A TSX app root that declares <Window> scenes keeps the implicit first window's node as the home of those windows. The node stays in the app root and never opens. It is a modal node, and a dialog's default animation is slide, so at launch the macOS host presented it over the main window with a slide of about 300 ms. That main window never shows, yet its onShow arrived only after the slide. The test agent waits for the platform's animations to end, so it counted the slide as part of the launch.

The window the app declares already showed with its first frame, 22 ms after it opened (traced with host logs). Only the slide of the hidden home was delaying the launch.

forget_implicit now gives the home animation: "none". An error from setting the prop is returned to mount, the same way the other failures in that path are.

Performance

examples/bench/jank/jank.py --runs 3 on macOS arm64, release. Two alternating sets each of this change's binaries and of the same tree without the change. The first run of a set is a cold start.

Startup (ms) Scroll frame p95 (ms) Gap p95 (ms) Frames over budget
Before 690, 703 (runs 673–727) 1.43, 1.49 8.33 0%, 1%
After 412, 440 (runs 392–440) 1.28, 1.37 8.33 0%, 0%

Trace timeline after the change: Show on the home comes in the same millisecond as the declared window's first Window events (207 ms), not about 300 ms later.

nsh test --trace:

  • The jank app's first commit has one more op (463 → 464, the home's animation) and the same 431 mount items.
  • examples/counter is unchanged: 56 ops, 50 mount items.

Public API

None. The home node is internal. A root that returns views still opens the implicit main window with its default animation.

Testing

  • New window::tests::the_home_of_declared_windows_appears_at_once. It fails without the change.
  • cargo xtask compat: compatible with every recorded release.
  • cargo clippy --workspace --all-targets: clean.
  • cargo test --workspace: the only failures also fail on main: a_built_record_survives_a_moved_home_and_a_new_time and draw_on_show. dev_port and the TUI's escape_then_tab failed once each and passed on rerun.
  • macOS screenshots of the jank app before and after the change are the same.
  • Not checked: Windows and Linux. Their hosts present dialogs too, so they should see the same launch saving, but this was not measured.

🤖 Generated with Claude Code

huacnlee and others added 2 commits December 4, 2026 06:02
A TSX app root that declares `<Window>` scenes keeps the implicit first
window's node, unopened, as their home. It is a `modal` node with a
dialog's default `slide` animation, so the macOS host presented it with a
slide of about 300 ms at launch, though it never shows, and the test agent
waited for it. The home now appears at once (`animation: "none"`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@huacnlee

huacnlee commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

✅ LGTM: minimal perf/bug fix, no public API change; the home node no longer plays the ~300 ms launch slide (macOS startup 690–703 ms → 412–440 ms).

Reviewed head 2c18458 (diff read). No issues: the mount error path in dom.rs matches the existing failure paths; free(cx, none) is correct since set_prop_value borrows. Windows/Linux not measured, as the PR states. CI was still pending at review time.

🤖 Noop (reviewer) · AI agent acting for @huacnlee

This branch has not been deployed

No deployments
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.

1 participant