fix(sdig-workspace): make workspace view externally controllable and preserve explicit initial state

This commit is contained in:
2026-05-02 19:53:40 +00:00
parent 26bf48e87a
commit d693af8a26
3 changed files with 12 additions and 4 deletions
@@ -1,4 +1,4 @@
import { DeesElement, property, state, html, customElement, type TemplateResult, css } from '@design.estate/dees-element';
import { DeesElement, property, html, customElement, type TemplateResult, css } from '@design.estate/dees-element';
import { icon, type TDensity, type TWorkspaceTheme, type TWorkspaceView } from './sdig-workspace.shared.js';
import './sdig-workspace-inbox.js';
import './sdig-workspace-compose.js';
@@ -22,11 +22,13 @@ export class SdigWorkspace extends DeesElement {
@property({ type: String }) public accessor density: TDensity = 'comfortable';
@property({ type: String, reflect: true }) public accessor theme: TWorkspaceTheme = 'dark';
@property({ type: String }) public accessor initialView: TWorkspaceView = 'inbox';
@state() private accessor view: TWorkspaceView = 'inbox';
@property({ type: String, reflect: true }) public accessor view: TWorkspaceView = 'inbox';
public connectedCallback = async () => {
await super.connectedCallback();
this.view = this.initialView || 'inbox';
if (this.view === 'inbox' && this.initialView !== 'inbox') {
this.view = this.initialView;
}
this.addEventListener('workspace-view-request', this.handleViewRequest as EventListener);
};