Skip to content

feat(web): persist collapsed workspace groups to localStorage - #1045

Merged
wbxl2000 merged 1 commit into
mainfrom
feat/web-persist-workspace-collapse
Jun 23, 2026
Merged

feat(web): persist collapsed workspace groups to localStorage#1045
wbxl2000 merged 1 commit into
mainfrom
feat/web-persist-workspace-collapse

Conversation

@wbxl2000

Copy link
Copy Markdown
Collaborator

Related Issue

No related issue — this is a small UX polish for the web sidebar.

Problem

When the web page is reloaded, every workspace group in the sidebar expands back to its default state. Users who keep several workspaces collapsed have to re-fold them on each visit.

What changed

The collapsed set of workspace ids is now persisted to localStorage (key kimi-web.collapsed-workspaces) and restored on mount. The fold/unfold toggle writes the updated set back, so the sidebar looks the same after a refresh. This is UI-only state with no server-side source of truth, so localStorage is the right place — consistent with how the sidebar already persists its own width/collapsed state, hidden workspaces, and unread dots.

  • src/lib/storage.ts: new loadCollapsedWorkspaces / saveCollapsedWorkspaces helpers with array/shape validation.
  • src/components/Sidebar.vue: initialize the collapsed set from storage and save on every toggle.
  • test/storage-logic.test.ts: covers missing key, round-trip, iterable input, and malformed/non-string values.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update. (No user-facing docs to update for this behavior.)

@pkg-pr-new

pkg-pr-new Bot commented Jun 23, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@5d54ebd
npx https://pkg.pr.new/@moonshot-ai/kimi-code@5d54ebd

commit: 5d54ebd

@wbxl2000
wbxl2000 merged commit ac1882f into main Jun 23, 2026
9 checks passed
@wbxl2000
wbxl2000 deleted the feat/web-persist-workspace-collapse branch June 23, 2026 14:45
@github-actions github-actions Bot mentioned this pull request Jun 23, 2026
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.

1 participant