SIGN IN SIGN UP

feat(vscode): add loading skeletons for Agent Manager sessions and worktrees (#518)

* feat: add loading skeletons for agent manager sessions and worktrees

Add skeleton loading states to the Agent Manager sidebar so users see
pulsing placeholders while worktrees and sessions load from the backend.

- Track worktreesLoaded/sessionsLoaded signals in the webview
- Add agentManager.requestState message so the webview can pull state
  on mount (fixes race where initial pushState fires before mount)
- Await stateReady in the extension before responding to requestState
  (ensures JSON is loaded from disk before sending data)
- Mark sessions loaded from both agentManager.state and sessionsLoaded
  message paths for consistent behavior
- Add skeleton CSS with staggered pulse animations

* fix: gate worktree list on sessionsLoaded to prevent branch name flash

The worktreeLabel() function falls back to wt.branch (e.g. kilo-...)
when session data hasn't arrived yet. Gate the worktree list render
on both worktreesLoaded and sessionsLoaded so the skeleton stays
visible until session titles are available.

- Listen for sessionsLoaded message directly instead of watching
  session.sessions() length (handles empty session lists too)
- Remove premature sessionsLoaded=true from agentManager.state handler
  since that message only carries IDs, not session titles

* fix: make skeleton shapes match actual worktree/session item layout

Worktree skeleton: single row with branch icon placeholder + text bar,
matching the .am-worktree-item padding (10px) and gap (8px).

Session skeleton: title bar + timestamp bar on the right, matching
the .am-item layout with justify-content: space-between, padding
(6px 10px), and smaller font size for the time placeholder.

* fix: add .catch() to requestState handler to prevent unhandled rejection

If initializeState() rejects, pushState() still fires with whatever
state is available (empty arrays), so skeletons resolve to the empty
state instead of loading forever.

* fix: log error in requestState catch handler per style guide
M
Marius committed
2d2699f0727c9fe2cb0a67ad678bedf512b54754
Parent: cb18296
Committed by GitHub <noreply@github.com> on 2/20/2026, 12:39:21 PM