Files
Dashward/container/runtime/styles.css
hzhang 5ed4170e69 feat: P4 — DBus bridge + page round-trip + system theme tracking
Three new wires from page to shell and back, proving the bridge end to
end. The dashboard placeholder now follows the system color-scheme via
the full chain: page-side dashShell.call('getTheme') → WebKit script
message handler → DBus method on the shell-owned service → gsettings
read → return value back up. ThemeChanged proves the reverse direction:
the shell watches color-scheme and emits a DBus signal that the
container forwards to the page as a CustomEvent.

extension/src/dbus-service.ts
  Owns top.hangmanlab.Dashward.Shell on the session bus; exports
  GetTheme (reads org.gnome.desktop.interface::color-scheme, maps
  prefer-dark→dark / else→light); emits ThemeChanged on the gsettings
  changed signal. Bus acquisition is async, so the constructor takes an
  onReady callback that fires from the bus_acquired handler.

extension/src/extension.ts
  Sequencing: warden → guard → dbus, and only after dbus_acquired
  callback fires do we spawn ContainerSupervisor. Disable order is
  reversed (container first so its DBus proxy stops calling the service
  before we unown the bus name).

container/src/dbus-client.ts
  Thin GJS proxy wrapper around the Shell interface; exposes a typed
  getTheme() / onThemeChange(cb) API.

container/src/bridge.ts
  Registers a `shellCall` UCM script-message handler; parses
  {id, method, args} JSON from the page, dispatches to invoke(), and
  feeds the result back via evaluate_javascript. Shell signals are
  forwarded to the page via window.__dashShell__._onSignal.

container/runtime/runtime.ts
  Installs window.__dashShell__ at script start, calls getTheme() on
  load and applies the result to <html data-theme>, listens for the
  ThemeChanged CustomEvent.

container/runtime/dashboard.html + esbuild.config.js
  Switched the runtime bundle from `format: 'esm'` to IIFE so it loads
  as a classic <script> -- WebKitGTK silently refuses `<script
  type="module">` over file:// for ES module resolution. Added an
  inline error catcher that surfaces JS errors in the visible boot
  diagnostic div instead of failing silently.

container/src/main.ts
  Construct ShellClient + Bridge before load_uri so the very first
  page-side dashShell.call() has a handler waiting. Added load-changed
  / load-failed signal logging for future diagnosis.

Verified on ubuntu2504-test VM: enable produces clean log chain through
"container window arrived", page renders with "P4 — shell bridge
online" placeholder and the correct system theme on first paint, manual
`gsettings set ... color-scheme prefer-dark` flips the placeholder
background live.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 00:54:19 +01:00

77 lines
1.2 KiB
CSS

:root {
--bg: #f5f5f7;
--fg: #1c1c1e;
--fg-muted: rgba(28, 28, 30, 0.55);
--grid-gap: 16px;
}
[data-theme="dark"] {
--bg: #0f0f12;
--fg: #f0f0f5;
--fg-muted: rgba(240, 240, 245, 0.55);
}
html, body {
margin: 0;
padding: 0;
height: 100%;
background: var(--bg);
color: var(--fg);
}
body {
font-family: ui-sans-serif, system-ui, -apple-system, 'Inter', sans-serif;
-webkit-font-smoothing: antialiased;
}
#grid {
display: grid;
grid-template-columns: repeat(12, 1fr);
gap: var(--grid-gap);
padding: var(--grid-gap);
min-height: 100%;
box-sizing: border-box;
}
#boot {
position: fixed;
top: 16px;
left: 16px;
padding: 8px 12px;
background: rgba(255, 80, 80, 0.85);
color: white;
font-family: ui-monospace, monospace;
font-size: 12px;
border-radius: 6px;
z-index: 9999;
}
.placeholder {
grid-column: 1 / -1;
display: grid;
place-items: center;
align-content: center;
gap: 12px;
min-height: 80vh;
text-align: center;
}
.placeholder h1 {
font-size: clamp(3rem, 8vw, 6rem);
font-weight: 200;
letter-spacing: -0.02em;
margin: 0;
}
.placeholder .hint {
font-size: 1.25rem;
margin: 0;
opacity: 0.7;
}
.placeholder .meta {
font-size: 0.9rem;
margin: 0;
color: var(--fg-muted);
}