Skip to content

UI: Layout persistence (save/restore/reset workspace)#66

Merged
lebduska merged 5 commits into
mainfrom
copilot/persist-workspace-layout
Dec 21, 2025
Merged

UI: Layout persistence (save/restore/reset workspace)#66
lebduska merged 5 commits into
mainfrom
copilot/persist-workspace-layout

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 21, 2025

📝 Popis

Workspace layout (aktivní tab) se nyní persistuje přes localStorage s verzovaným schématem. App si pamatuje stav mezi relancemi.

Implementace

  • Service layer (layoutPersistence.ts): versioned schema (layoutVersion: 1), auto-save/restore, validation
  • App state: lazy init z localStorage, auto-save on change via useEffect
  • HUD: přidán "Reset" button pro návrat k defaultům
// Lazy initialization
const [activeTab, setActiveTab] = useState(() => {
  const restored = restoreLayout();
  return restored.activeTab;
});

// Auto-save
useEffect(() => {
  saveLayout({ activeTab });
}, [activeTab]);

Schema

{
  "layoutVersion": 1,
  "activeTab": "nodes" | "stats" | "chat"
}

Validace zahrnuje version check + tab value check s graceful fallback na defaults.

✅ Checklist

  • Kód odpovídá standardům projektu
  • Změny jsou zdokumentovány (pokud je to potřeba)
  • Manuální testování proběhlo úspěšně
  • Build v CI prošel (pokud je nastaven)

🧪 Jak otestovat

  1. Spusť npm run tauri dev v blendmate-app/
  2. Přepni na "Stats" nebo "Chat" tab
  3. Zavři a znovu otevři app → tab zůstane stejný
  4. Klikni "Reset" v HUD → vrátí se na "Nodes"
Original prompt

This section details on the original issue you should resolve

<issue_title>UI: Layout persistence (save/restore/reset workspace)</issue_title>
<issue_description>Fixes part of #52.

Persist workspace layout (which panels are open + their placement) so the lab feels like a stable desk, not a goldfish bowl.

Acceptance:

  • Store layout in localStorage (or Tauri store if already present)
  • On startup: restore layout
  • Add “Reset layout” action

Notes:

  • Keep schema versioned (e.g., layoutVersion: 1).</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits December 21, 2025 20:31
Co-authored-by: lebduska <11066249+lebduska@users.noreply.github.com>
Co-authored-by: lebduska <11066249+lebduska@users.noreply.github.com>
Co-authored-by: lebduska <11066249+lebduska@users.noreply.github.com>
Copilot AI changed the title [WIP] Persist workspace layout in localStorage UI: Layout persistence (save/restore/reset workspace) Dec 21, 2025
Copilot AI requested a review from lebduska December 21, 2025 20:39
@lebduska lebduska marked this pull request as ready for review December 21, 2025 21:26
@lebduska lebduska merged commit 7398b89 into main Dec 21, 2025
1 check passed
@lebduska lebduska deleted the copilot/persist-workspace-layout branch December 21, 2025 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI: Layout persistence (save/restore/reset workspace)

2 participants