Skip to content

feat(apps): open app dialogs with the app already running - #641

Merged
RentnerKev merged 9 commits into
mainfrom
rentner/feat/instant-app-dialogs
Nov 30, 2026
Merged

RentnerKev merged 9 commits into
mainfrom
rentner/feat/instant-app-dialogs

Conversation

@RentnerKev

@RentnerKev RentnerKev commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

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:

  • a frame grant round trip;
  • the document and scripts (no-store);
  • the bridge handshake;
  • then the app's first operations.

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-state of kind loading. The words stay as screen-reader text in a busy output. 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.

  • Prewarm: opening a host's row menu, resting the pointer on an app column for 150 ms, or focusing it, opens that host's frame. 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.
  • Limits: 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 a frame, its toasts are dropped, without using the bridge's toast budget (new mayToast callback), and its confirmations are declined.
  • Fresh per open: a shown frame closes with its view, so each opened dialog starts the app fresh: no stale tab or draft from the last open.
  • Keys: frames are keyed by session, app generation, slot, host and the route they start on; another key never takes a frame, so a frame opened for one action never shows in the dialog of another.
  • Fallback: an app that draws its own document cannot be shown from the pool and falls back to a frame of its own, as before. The pool remembers such an app generation, which then skips warm-ups and opens with its own frame right away. The dev preview and native apps are unchanged.
  • Transport: the pool takes its transport (frame grant, operation gateway) as props, like AppFrameView. The frame source keeps the same origin and path checks as before.

ActionMenu gains an optional onOpenChange.

Security notes

  • No new grant or token type. A frame opened ahead uses the same openAppUiHandler grant and the same operation gateway with its frame token as a frame opened by a dialog.
  • An app opened ahead may run its read operations before the click, under the user's permissions. It cannot reach the user with toasts or confirmations until a view shows it.
  • A frame of another session, app generation, host or route is never shown, because all of them are part of the key.
  • When the app UI turns off while the provider stays mounted, for example during maintenance, all pooled frames close.

Tests

  • New app-frame-pool.test.tsx:
    • pool lifecycle: adoption, React's development remount, expiry, the limit of waiting frames, replacing ended frames;
    • a frame opened ahead is drawn without a second document or a skeleton, stays silent until shown, and closes with its view;
    • the frame rendering fallback;
    • the column's 150 ms hover intent and focus.
  • remote-app-view.test.tsx: ui-state loading draws the skeleton with its words kept for screen readers.
  • Chromium fixture (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.
  • Ran locally:
    • bun run typecheck;
    • oxlint, both configs, on the changed files;
    • bun test --isolate for AppUi, ActionMenu, ProxyHostManagement and architecture: 291 pass.
  • Not run locally: the Chromium fixture, because Playwright's Chromium is not installed here. It runs in CI.

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

RentnerKev and others added 3 commits November 30, 2026 20:41
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]>
@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 3a5f57e and 3136381.

Files selected for processing: 27

  • web/src/features/Admin/ProxyHostManagement/Components/ProxyHostsTable/Components/ProxyHostAppExtensionCell.tsx
  • web/src/features/Admin/ProxyHostManagement/Components/ProxyHostsTable/Components/ProxyHostTableActions.tsx
  • web/src/features/AppUi/AppUiFrame.tsx
  • web/src/features/AppUi/AppUiProvider.tsx
  • web/src/features/AppUi/Components/AppContentSkeleton.tsx
  • web/src/features/AppUi/Components/AppFramePoolHost.tsx
  • web/src/features/AppUi/Components/AppFrameView.tsx
  • web/src/features/AppUi/Components/AppHostTableCell.tsx
  • web/src/features/AppUi/Components/PooledAppFrameView.tsx
  • web/src/features/AppUi/Components/RemoteAppView/Components/RemoteContentElements.tsx
  • web/src/features/AppUi/Components/RemoteAppView/index.tsx
  • web/src/features/AppUi/Hooks/useOpenIntent.ts
  • web/src/features/AppUi/Hooks/usePrewarmAppHostAction.ts
  • web/src/features/AppUi/NativeAppUi.tsx
  • web/src/features/AppUi/Types/app-host-table.types.ts
  • web/src/features/AppUi/appFramePool.ts
  • web/src/features/AppUi/appUiToast.ts
  • web/src/lib/AppUi/session.ts
  • web/src/shared/ActionMenu/Hooks/useActionMenuLogic.ts
  • web/src/shared/ActionMenu/Types/action-menu.types.ts
  • web/src/shared/ActionMenu/index.tsx
  • web/src/tests/features/AppUi/app-frame-pool.test.tsx
  • web/src/tests/features/AppUi/remote-app-view.test.tsx
  • web/src/tests/fixtures/remote-ui-browser/browser.mts
  • web/src/tests/fixtures/remote-ui-host/host.tsx
  • web/src/tests/layouts/AuthenticatedLayout/Components/ApplicationShell/application-shell.test.tsx
  • web/src/tests/lib/AppUi/bridge.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

rentnerproxy-pr-automation Bot and others added 6 commits November 30, 2026 19:55
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]>
@RentnerKev
RentnerKev merged commit fc3dead into main Nov 30, 2026
11 checks passed
@RentnerKev
RentnerKev deleted the rentner/feat/instant-app-dialogs branch November 30, 2026 20:16
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