diff --git a/ui/src/ui/app-render.ts b/ui/src/ui/app-render.ts index 46f4b3a375e3..ac1cefacbc36 100644 --- a/ui/src/ui/app-render.ts +++ b/ui/src/ui/app-render.ts @@ -217,6 +217,75 @@ function runUiTask( }; } +const SKILL_WORKSHOP_MODE_KEY = "openclaw:control-ui:skill-workshop-mode:v1"; + +export function loadSkillWorkshopMode(): "board" | "today" { + try { + const raw = getSafeLocalStorage()?.getItem(SKILL_WORKSHOP_MODE_KEY); + return raw === "board" ? "board" : "today"; + } catch { + return "today"; + } +} + +function setSkillWorkshopMode(state: AppViewState, mode: "board" | "today"): void { + if (state.skillWorkshopMode === mode) { + return; + } + state.skillWorkshopMode = mode; + try { + getSafeLocalStorage()?.setItem(SKILL_WORKSHOP_MODE_KEY, mode); + } catch { + // Mode persistence is a convenience; the in-memory switch still works. + } +} + +function renderSkillWorkshopHeaderControls(state: AppViewState) { + return html` +
+
+ + + +
+
+ `; +} + function renderSettingsSectionNav(state: AppViewState) { if (!isSettingsTab(state.tab)) { return nothing; @@ -2246,6 +2315,9 @@ export function renderApp(state: AppViewState) {
${subtitleForTab(state.tab)}
+ ${state.tab === "skillWorkshop" + ? renderSkillWorkshopHeaderControls(state) + : nothing} ${state.tab === "dreams" ? html`
@@ -3150,7 +3222,7 @@ export function renderApp(state: AppViewState) { }, onFilePreviewQueryChange: (query) => (state.skillWorkshopFilePreviewQuery = query), onQueueWidthChange: (width) => (state.skillWorkshopQueueWidth = width), - onModeChange: (mode) => (state.skillWorkshopMode = mode), + onModeChange: (mode) => setSkillWorkshopMode(state, mode), onSelect: (key) => { state.skillWorkshopFilePreviewKey = null; selectSkillWorkshopProposal(state, key); diff --git a/ui/src/ui/app.ts b/ui/src/ui/app.ts index a5dd25eeaca8..0419d8213f60 100644 --- a/ui/src/ui/app.ts +++ b/ui/src/ui/app.ts @@ -42,7 +42,7 @@ import { } from "./app-lifecycle.ts"; import { initNativeBridge } from "./app-native-bridge.ts"; import { createChatSession as createChatSessionInternal } from "./app-render.helpers.ts"; -import { renderApp } from "./app-render.ts"; +import { loadSkillWorkshopMode, renderApp } from "./app-render.ts"; import { exportLogs as exportLogsInternal, handleActivityScroll as handleActivityScrollInternal, @@ -643,7 +643,7 @@ export class OpenClawApp extends LitElement { @state() skillWorkshopFilePreviewKey: string | null = null; @state() skillWorkshopFilePreviewQuery = ""; @state() skillWorkshopQueueWidth = 360; - @state() skillWorkshopMode: SkillWorkshopState["skillWorkshopMode"] = "today"; + @state() skillWorkshopMode: SkillWorkshopState["skillWorkshopMode"] = loadSkillWorkshopMode(); @state() healthLoading = false; @state() healthResult: HealthSummary | null = null;