@@ -17,9 +17,11 @@ import { isDesktopPanelAvailable } from "./app-shell-chrome.ts";
1717import { bootstrapApplication , type ApplicationRuntime } from "./bootstrap.ts" ;
1818import { resolveControlUiBasePath } from "./browser.ts" ;
1919import { applicationContext , type ApplicationContext } from "./context.ts" ;
20+ import { dashboardDocumentSession , isDashboardOnlyView } from "./dashboard-document-mode.ts" ;
2021import { desktopDocumentOptions , isDesktopOnlyView } from "./desktop-document-mode.ts" ;
2122import {
2223 APPROVAL_PAGE_ELEMENT ,
24+ DASHBOARD_DOCUMENT_ELEMENT ,
2325 DESKTOP_PANEL_ELEMENT ,
2426 isOptionalElementDefined ,
2527 preloadOptionalElement ,
@@ -86,6 +88,8 @@ export class OpenClawApp extends OpenClawLightDomElement {
8688 globalThis . location ,
8789 resolveControlUiBasePath ( globalThis . location ?. pathname ?? "/" ) ,
8890 ) ;
91+ private readonly dashboardOnly = isDashboardOnlyView ( globalThis . location ) ;
92+ private readonly dashboardSession = dashboardDocumentSession ( globalThis . location ) ;
8993 private readonly desktopOptions = desktopDocumentOptions ( globalThis . location ) ;
9094 private runtime : ApplicationRuntime | undefined ;
9195 private readonly contextProvider = new ContextProvider ( this , {
@@ -130,6 +134,9 @@ export class OpenClawApp extends OpenClawLightDomElement {
130134 if ( this . desktopOnly ) {
131135 preloadOptionalElement ( this , DESKTOP_PANEL_ELEMENT ) ;
132136 }
137+ if ( this . dashboardOnly ) {
138+ preloadOptionalElement ( this , DASHBOARD_DOCUMENT_ELEMENT ) ;
139+ }
133140 if ( this . runtime . documentMode ?. kind === "approval" ) {
134141 preloadOptionalElement ( this , APPROVAL_PAGE_ELEMENT ) ;
135142 }
@@ -201,6 +208,14 @@ export class OpenClawApp extends OpenClawLightDomElement {
201208 this . loginShowGatewayPassword = false ;
202209 }
203210
211+ private closeDocument ( basePath : string ) : void {
212+ if ( globalThis . history . length > 1 ) {
213+ globalThis . history . back ( ) ;
214+ } else {
215+ globalThis . location . assign ( basePath || "/" ) ;
216+ }
217+ }
218+
204219 override render ( ) {
205220 const context = this . context ;
206221 const runtime = this . runtime ;
@@ -271,13 +286,7 @@ export class OpenClawApp extends OpenClawLightDomElement {
271286 .documentSource=${ this . desktopOptions . source }
272287 .documentSession=${ this . desktopOptions . session }
273288 .documentControl=${ this . desktopOptions . control }
274- .onDocumentClose=${ ( ) => {
275- if ( globalThis . history . length > 1 ) {
276- globalThis . history . back ( ) ;
277- } else {
278- globalThis . location . assign ( context . basePath || "/" ) ;
279- }
280- } }
289+ .onDocumentClose=${ ( ) => this . closeDocument ( context . basePath ) }
281290 > </ openclaw-desktop-panel >
282291 ${ ! gatewayConnected && gatewaySnapshot . lastError === null
283292 ? renderConnectingSplash ( gatewayStartupStatus )
@@ -290,6 +299,23 @@ export class OpenClawApp extends OpenClawLightDomElement {
290299 : nothing }
291300 ` ;
292301 }
302+ // Dashboard documents reuse the live board provider and widget bridge while
303+ // keeping the application shell, transcript, and navigation chrome unmounted.
304+ if ( this . dashboardOnly ) {
305+ return html `
306+ < openclaw-board-document
307+ .gatewaySnapshot =${ gatewaySnapshot }
308+ .sessionKey =${ this . dashboardSession }
309+ .onDocumentClose=${ ( ) => this . closeDocument ( context . basePath ) }
310+ > </ openclaw-board-document >
311+ ${ ! gatewayConnected && gatewaySnapshot . lastError === null
312+ ? renderConnectingSplash ( gatewayStartupStatus )
313+ : nothing }
314+ ${ ! isOptionalElementDefined ( DASHBOARD_DOCUMENT_ELEMENT ) && gatewayConnected
315+ ? renderConnectingSplash ( gatewayStartupStatus )
316+ : nothing }
317+ ` ;
318+ }
293319 // In the normal Control UI document, the Gateway lifecycle owns unresolved
294320 // first-connect state across every auth mode. Failures publish lastError
295321 // before the gate returns; reconnects keep the shell mounted, and
0 commit comments