Repository navigation
feat(apps): open app dialogs with the app already running - #641
Merged
Merged
Conversation
Opening an app showed "Loading app…", then the app's own waiting text, then its loading text, before the content replaced them. Each step was one line of text in a box, so the dialog visibly loaded in stages. The platform's wait for the frame, the wait for the handshake, an app page without a drawn tree and the UI kit's `ui-state` of kind loading now draw the same content skeleton: pulsing placeholders shaped like facts, a chart and a list. The words stay as screen-reader text in an `output` that is busy. The other state kinds keep their box. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every time the user chose an app's row action, the dialog opened a new frame: a server round trip for the frame grant, the document and its scripts, the bridge handshake and then the app's first operations. On a fast network that took about 0.4 s of loading states before the content; the app felt loaded on demand, unlike the platform's dialogs. Apps that render remotely are now shown from a frame pool in the app UI provider. Their documents stay hidden in the pool, and the view that shows a frame only draws its remote tree, so a frame can start before its view exists: - Opening a host's row menu, or resting the pointer on an app column for 150 ms or focusing it, opens that host's frame ahead. By the time the user picks the action, the app is connected and has asked for its data, and the dialog draws it at once. - A frame opened ahead waits 20 s for its view; at most three wait at once, and the oldest gives way. Until a view shows it, the app's toasts are dropped and its confirmations are declined. - A shown frame closes with its view, so each opened dialog starts the app fresh. A frame keeps its key of session, app generation, slot and host; a different one never adopts it. - An app that draws its own document cannot be shown from the pool and falls back to a frame of its own, as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…sport The pool host now takes how it opens documents and runs operations as props, like the frame view, so the platform, the browser fixture and the tests pass their own. The platform passes its frame grant and operation gateway from the app UI provider. The remote UI browser fixture gains a pool page. Chromium checks that a frame opened ahead loads and connects while hidden, that showing it draws the app's tree without a skeleton in between, that a press reaches the app and its toast shows, that hiding the view closes the frame, and that showing it again without a frame ahead starts the app fresh. A view now takes its frame in a layout effect, before the first paint. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 24 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
An independent review of the frame pool found four defects: - A frame was keyed without its route. When a host had two app actions, or the user opened the app's tab in the host form after opening the row menu, the view took a frame started on another route and painted that route's tree first. The key now includes the route the frame starts on. - An app on bridge 1.3.0 that draws its own document opened a pooled frame it could never show on every open and every warm-up. The pool now remembers such app generations: they skip warm-ups and open with a frame of their own right away. - Toasts a hidden frame was not allowed to show still used the bridge's toast budget, so an app opened right after could lose its real toasts. The bridge now asks `mayToast` before it charges the budget. - When the app UI turned off while the provider stayed mounted, for example during maintenance, the documents went but their pool entries stayed and could be adopted with a stale tree. The pool now closes all frames when the app UI turns off. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The app UI provider now imports openAppUiHandler for its frame pool, and the shell test replaced the app UI middleware with a module that only had listAppUisHandler, so Bun failed to load the provider. The mock now also answers the frame grant; the shell opens no frames. Co-Authored-By: Claude Opus 5.5 <[email protected]>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On a test instance, opening Monitoring 1.1.0 from a host row took about 0.4 s on a fast network, measured in the browser. The user saw three loading texts in turn, the platform's "Loading app…", the app's "Waiting for the app…" and its "Loading…", before the content arrived. Each open did the same steps:
no-store);The app felt loaded on demand, unlike the platform's own dialogs. This PR makes an app's dialog open like a platform dialog.
1. One calm loading state
The waits now draw the same content skeleton instead of a line of text: pulsing placeholders shaped like facts, a chart and a list. That covers the wait for the frame grant, the wait for the handshake, an app page with no drawn tree, and the UI kit's
ui-stateof kindloading. The words stay as screen-reader text in a busyoutput. The other state kinds keep their box.2. Frames opened ahead of the click
Apps on UI bridge 1.3.0 and newer render remotely, so their frame document is hidden anyway. These apps now run in a frame pool in
AppUiProvider. The documents live hidden in the pool host (AppFramePoolHost); the view in the dialog (PooledAppFrameView) only draws the remote tree. A frame can therefore start before its view exists.mayToastcallback), and its confirmations are declined.AppFrameView. The frame source keeps the same origin and path checks as before.ActionMenugains an optionalonOpenChange.Security notes
openAppUiHandlergrant and the same operation gateway with its frame token as a frame opened by a dialog.Tests
app-frame-pool.test.tsx:framerendering fallback;remote-app-view.test.tsx:ui-stateloading draws the skeleton with its words kept for screen readers.remote-ui-browser), run by the App Runtime Reference job: a pool page where a frame opened ahead connects while hidden and is shown without a skeleton; a press round trip and toast; hiding closes the frame; showing again starts fresh.bun run typecheck;oxlint, both configs, on the changed files;bun test --isolatefor AppUi, ActionMenu, ProxyHostManagement and architecture: 291 pass.Review
CodeRabbit was rate-limited, so an independent review covered the pool. Its four findings are fixed in the last commit, each with a test: route in the key, remembering apps that draw their own document, the toast budget of hidden frames, and closing frames when the app UI turns off.
Not verified yet
Not yet checked on a real instance with an installed app. That needs a dev image and the test instance.
🤖 Generated with Claude Code