Skip to content

feat(hub-ui): add loading placeholder for iframes - #247

Merged
antfu merged 3 commits into
mainfrom
feat/hub-ui-iframe-loading-placeholder
Aug 17, 2026
Merged

feat(hub-ui): add loading placeholder for iframes#247
antfu merged 3 commits into
mainfrom
feat/hub-ui-iframe-loading-placeholder

Conversation

@antfubot

@antfubot antfubot commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

What

  • Adds a proper loading-state placeholder for iframe dock views in @devframes/hub-ui, with a Storybook story to preview it.
  • Fixes the hub-ui Storybook crash (Cannot read properties of undefined (reading 'configs')).

Iframe loading placeholder

The previous placeholder (Loading iframe..., z--1) sat behind the iframe-pane overlay, so it was never actually visible — a freshly-mounted iframe just paints white while its content loads. This gives dock iframes a real, visible loading state on first load and on hard navigation/refresh.

In ViewIframe.vue:

  • A freshly-created pane now marks isIframeLoading, so the placeholder covers the initial load, not just later navigations. Re-mounting an existing pane (tab switch / shared frameId handoff) leaves it off, so there's no flash on switches.
  • The pane show/hide effect now pane.hide()s while loading (in addition to the assets-error case), reusing the same layering trick as ViewAssetsError — the frame stays alive and keeps loading behind the placeholder.
  • The placeholder is extracted into a small ViewIframeLoading.vue (mirroring how ViewAssetsError is structured): a centered absolute inset-0 bg-base overlay using the shared design-system tokens — a duotone spinner (i-ph:circle-notch-duotone animate-spin, color-faint) and a color-muted "Loading…" label.

Storybook

  • New ViewIframeLoading.stories.ts (Views/IframeLoading) previews the placeholder in a stage that mirrors the iframe view frame — following the ViewAssetsError story pattern, so it renders deterministically without wiring up the iframe-pane machinery.
  • Fixed the pre-existing render crash: createDocksContext eagerly reads rpc.connectionMeta.configs?.ui?.dockPreferences?.categoryOrder, but the story-only MockRpcClient never provided connectionMeta. Added a minimal valid connectionMeta: { backend: 'static' } to the mock rpc — stories have no live server, and the context reads configs optionally, so an empty meta is enough.

This PR was created with the help of an agent.

@netlify

netlify Bot commented Aug 17, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit 9805355
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a82a2e344136000084d67c7
😎 Deploy Preview https://deploy-preview-247--devfra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@antfu
antfu merged commit c408e17 into main Aug 17, 2026
12 checks passed
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.

2 participants