Skip to content

fix(dashboard): fix buddy dev --dashboard white screen (sidebar ENOENT + Craft HTTPS cert)#2191

Merged
glennmichael123 merged 2 commits into
mainfrom
fix/dashboard-sidebar-white-screen
Jul 24, 2026
Merged

fix(dashboard): fix buddy dev --dashboard white screen (sidebar ENOENT + Craft HTTPS cert)#2191
glennmichael123 merged 2 commits into
mainfrom
fix/dashboard-sidebar-white-screen

Conversation

@glennmichael123

@glennmichael123 glennmichael123 commented Jul 24, 2026

Copy link
Copy Markdown
Member

./buddy dev --dashboard opened a white / "flash then goes away" Craft window. It was two independent bugs; both needed fixing.

Bug 1 - <Sidebar> ENOENT (content)

The global dashboard layout resolved <Sidebar> from @stacksjs/components, but 0.2.9x stopped shipping tag-resolvable .stx sources (only hashed dist/ output; its own stx-plugin.ts points at an unpublished ./src/ui). So <Sidebar> couldn't resolve, the stx plugin fell back to a filesystem search, and every dashboard page fatal-errored with ENOENT ... open 'sidebar' (#1989).

Fix: render the sidebar from the framework's own buildSidebarChunks() HTML inside a plain <aside data-stx-sidebar>, styled with plain CSS in the layout. No dependency on the external component - the dashboard renders regardless of which @stacksjs/components version is installed. Role gating, section collapse, SPA nav, and active-highlight are wired to the new markup.

Bug 2 - Craft's WKWebView rejects the HTTPS cert (the actual white screen)

The native window opened the HTTPS pretty URL (https://dashboard.stacks.localhost). Craft's WKWebView rejects the tlsx local-CA cert:

DID_FAIL_PROVISIONAL: The certificate for this server is invalid.

Craft installs no didReceiveAuthenticationChallenge handler, so it does not honor the local-CA trust (even though the CA is in the keychain). The provisional navigation fails and the window stays blank / flashes then clears.

Fix: point the native window at http://localhost:<port> (nativeWindowUrl in dev/dashboard.ts). Loopback HTTP needs no cert; the browser-facing "Local" URL stays HTTPS for anyone opening it in a real browser.

How it was verified

A standalone swift + WKWebView + takeSnapshot harness reproduces Craft's exact engine headlessly (headless Chromium does not catch WKWebView TLS/JS issues):

  • WKWebView over HTTPS -> certificate is invalid (reproduces the white screen).
  • WKWebView over HTTP -> renders the full dashboard, in both normal and the window's transparent titlebarHidden mode.
  • / and /commerce/products both render fully (sidebar + content); no Error loading component; lint clean.

Follow-up (Craft repo, optional)

Craft could add a didReceiveAuthenticationChallenge handler to trust the local dev CA, which would let the native window use HTTPS too. Not required for this fix.

Refs #1989

…creening

`buddy dev --dashboard` rendered a blank/white window because the global
dashboard layout resolved `<Sidebar>` from @stacksjs/components, and 0.2.9x
stopped shipping tag-resolvable .stx sources (only hashed dist/ output). The
component no longer resolved, the stx plugin fell back to a filesystem search,
and every dashboard page fatal-errored with "ENOENT ... open 'sidebar'"
(#1989). In the native Craft window that surfaced as a white screen.

Render the sidebar from the framework's own buildSidebarChunks() HTML inside a
plain <aside data-stx-sidebar>, styled with plain CSS in the layout's leading
<style> block (stx serves raw layout CSS verbatim but does not expand @apply
there). This drops the dependency on the external component for core nav
chrome, so the dashboard renders regardless of which @stacksjs/components
version is installed. Role gating still works via the data-required-roles the
markup emits; section collapse, SPA nav, and active highlight are wired against
the .sidebar-link markup.

Refs #1989
@github-actions github-actions Bot added the storage @stacksjs/storage label Jul 24, 2026
… pretty URL

Craft's WKWebView rejects the tlsx local-CA cert ("The certificate for this
server is invalid") because Craft installs no didReceiveAuthenticationChallenge
handler, so opening https://dashboard.stacks.localhost fails the provisional
navigation and the window stays blank / flashes then clears. Verified directly:
a WKWebView snapshot over the https URL fails with that error, while the same
webview renders the dashboard perfectly over http://localhost (both normal and
the window's transparent titlebarHidden mode).

Point the native window at the http localhost origin, which needs no cert. The
browser-facing "Local" URL stays https for anyone opening it in a real browser.

Refs #1989 #2191
@github-actions github-actions Bot added actions @stacksjs/actions core labels Jul 24, 2026
@glennmichael123 glennmichael123 changed the title fix(dashboard): own the sidebar chrome so dev dashboard stops white-screening fix(dashboard): fix buddy dev --dashboard white screen (sidebar ENOENT + Craft HTTPS cert) Jul 24, 2026
@glennmichael123
glennmichael123 merged commit 34d66f8 into main Jul 24, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

actions @stacksjs/actions core storage @stacksjs/storage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant