qwen-code/packages/web-shell/client/e2e/utils
samuelhsin c8290f8e49
fix(web-shell): persist collapsed session group sections across reload (#6878)
* fix(web-shell): persist collapsed session group sections across reload

Store collapsed section ids in localStorage using the existing
qwen-code-web-shell-* key namespace, and skip the first catalog sync
auto-collapse so restored expand/collapse state survives remount.

Fixes QwenLM/qwen-code#6870

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs(web-shell): clarify collapsed-groups demo GIF storyboard

Crop to the sidebar, caption the four beats (expand → collapse →
reload → still collapsed), and keep Pinned out of the organized
session list mock so the Backend collapse is obvious.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(web-shell): address collapsed-groups CR feedback

Export the storage key for unit tests, use an explicit first-catalog
latch instead of size===0, and cover corrupt/disabled storage plus
mid-session auto-collapse of newly appeared sections.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(web-shell): harden collapsed-groups persistence for CR feedback

Wait for groups+sessions catalog settlement before the initial latch,
persist secondary-workspace collapse via shared namespaced localStorage,
and keep primary/workspace writers from clobbering each other.

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(web-shell): drop demo-capture tooling from collapsed-groups test

The committed GIF, capture script, and frame-assembly helper only served
the PR description's embedded image and were referenced by nothing else
in the repo; the CAPTURE_DEMO branches in the e2e spec were pure
screenshot staging with no assertions. The remaining spec still covers
every acceptance criterion of #6870 and keeps its @smoke tag.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014KuV2hx2ZqEqdRwsJz4KJH

* fix(web-shell): keep collapse latch armed until catalogs settle successfully

Two paths could consume the first-sync latch against a partial catalog
and then auto-collapse (and persist over) the user's restored expansions:
a failed initial sessions/groups request counted as settled, and a
mid-session organization_enabled flip let the auto-collapse effect run
one commit before the groups gate closed. Errors no longer settle either
readiness gate, and the gate now closes during the flip render itself.

Also drop the WorkspaceSection reload effect and exhaustive-deps
suppression that defended a workspace.id change which cannot happen (the
render site keys the component by workspace id), and import the storage
key in tests from collapsedSessionSections directly instead of
re-exporting it through WebShellSidebar.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014KuV2hx2ZqEqdRwsJz4KJH

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-07-15 00:25:54 +00:00
..
mockDaemon.ts fix(web-shell): persist collapsed session group sections across reload (#6878) 2026-07-15 00:25:54 +00:00
sseTransport.ts Add harness infrastructure for web-shell package (#6517) 2026-07-09 08:11:58 +00:00