Repository navigation
gpui: Let embedded views mount JS roots inline - #2974
Conversation
Keep Window Model v2 as the default. Let embedders opt into an inline plain root without changing the order of load and own_window.
|
💡 Needs a maintainer call on the API shape: the fix is wanted, but it adds a parallel constructor plus a re-exported engine helper. What it fixes. Since #2307 a plain JS root in an embedded Public API added.
Concern. AppView::new(AppOptions { inline: true, ..Default::default() }, window, cx)keeping Reviewed 517404b by reading the diff; not built locally. |
|
❌ Needs an API change before merge: please make inline rendering an The fix itself is wanted (embedded plain-JS roots opening a separate window since #2307). The maintainers prefer extending the existing entry point over adding a parallel one:
Reviewed head 517404b (diff only, not built locally). |
|
Addressed in |
huacnlee
left a comment
There was a problem hiding this comment.
✅ LGTM: inline mounting is now the AppOptions::inline_root opt-in requested in the previous review.
Reviewed at 3aa8e45. AppView::new_inline is gone, with_inline_root stays internal, the field defaults to false, and open_app_window / run_app reset it so standalone launches keep the implicit window (covered by the new test case). Docs (en, zh-CN) and the embed-gpui example follow the new shape. I read the diff only; CI is still running on this head.
Description
After #2307, a plain JS root loaded by an embedded
AppViewopens an implicit desktop window instead of rendering in the host. That leaves the host without inline content for the height API from #2569 to measure.Embedders can now pass
AppOptions { inline_root: true, ..Default::default() }toAppView::newto keep a plain root in the host view. This is opt-in soloadandown_windowcan remain in either order without silently changing existing desktop behavior. The flag defaults tofalse, and standalone launchers ignore it. Explicit windows, window closing, and quit policy are unchanged.Public API
nsh-platform-gpui:AppOptions::inline_root: bool— opt into inline mounting for plain JS roots.Rust source compatibility
Exhaustive
AppOptionsliterals must addinline_rootor use..Default::default(). Existing default and struct-update callers need no changes.Verification
main.shotfeatures and minimaljsfeatures; targeted nightly formatting.