Skip to content

fix: worktree UX redesign + session expired loop fix#8

Merged
dimakis merged 1 commit into
mainfrom
fix/worktree-ux
Apr 1, 2026
Merged

fix: worktree UX redesign + session expired loop fix#8
dimakis merged 1 commit into
mainfrom
fix/worktree-ux

Conversation

@dimakis
Copy link
Copy Markdown
Owner

@dimakis dimakis commented Apr 1, 2026

Summary

Bug fix: session expired loop

  • After a server restart, resuming a stale session caused infinite "Session expired" messages
  • Root cause: sessionStorage and URL param re-seeded the stale session ID after clearing
  • Fix: clear sessionStorage entry, navigate away from stale URL, guard done handler

Worktree UX redesign

  • Worktrees now default to OFF (was on-by-default)
  • New "WT" sandbox toggle in chat header — opt-in worktree creation
  • Toggle disabled after first message (cannot switch mid-session)
  • Server sends session_info message with branch name, cwd, and worktree flag
  • Branch pill in header shows current git branch (monospace, always visible)
  • Worktree sessions get accent-colored branch pill for visual distinction

Test plan

  • 81 tests passing
  • tsc --noEmit clean
  • ESLint --quiet clean
  • Manual: open old session — should show "Session expired" once, not loop
  • Manual: new chat — should show branch pill with "main", no worktree
  • Manual: toggle WT on, send message — should show worktree branch

Made with Cursor

Session expired fix:
- Clear sessionStorage cache when resume fails ("No conversation found")
- Navigate from /chat/:staleId to /chat to prevent URL re-seeding
- Guard setCurrentSessionId on done to prevent race with error handler

Worktree UX:
- Default worktrees to OFF (require explicit opt-in via worktree: true)
- Add session_info WS message: sends branch name, cwd, worktree flag
- Branch pill in chat header shows current git branch (always visible)
- Sandbox (WT) toggle in header: opt-in worktree creation, disabled after
  first message sent, accent-highlighted when active
- Worktree sessions get accent-colored branch pill for visual distinction

Made-with: Cursor
@dimakis dimakis merged commit b03143e into main Apr 1, 2026
1 check passed
dimakis added a commit that referenced this pull request Apr 10, 2026
- Add script existence check before exec (was #1 critical)
- Add Zod CalendarResponse schema for stdout validation (#2)
- Check r.ok before parsing fetch response in hook (#3)
- Compute today fresh in handleToday to avoid stale date (#6)
- Extract EventCard + SprintBar to separate component files (#7)
- Extract calendar CSS to dedicated calendar.css (#8)
- Add tests: Day/Week toggle, Today button, EventCard expand,
  milestone expand, non-ok HTTP response handling (#4, #5)

832 tests passing (5 new).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dimakis added a commit that referenced this pull request Apr 10, 2026
- Add script existence check before exec (was #1 critical)
- Add Zod CalendarResponse schema for stdout validation (#2)
- Check r.ok before parsing fetch response in hook (#3)
- Compute today fresh in handleToday to avoid stale date (#6)
- Extract EventCard + SprintBar to separate component files (#7)
- Extract calendar CSS to dedicated calendar.css (#8)
- Add tests: Day/Week toggle, Today button, EventCard expand,
  milestone expand, non-ok HTTP response handling (#4, #5)

832 tests passing (5 new).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dimakis added a commit that referenced this pull request Apr 10, 2026
…sprints (#164)

* feat(calendar): add calendar view with meetings, milestones, and sprints

Unified calendar page that merges Google Calendar events, release
milestones, and sprint boundaries via the mgmt calendar_api.py backend.
Mobile-first day/week view with responsive desktop grid layout.

- GET /api/calendar endpoint shells out to calendar_api.py
- useCalendarData hook with date navigation
- CalendarView page with EventCard expand/collapse
- Sprint bars, milestone badges, attendee chips
- Day/Week toggle, prev/next/today navigation
- 17 tests (5 server + 5 hook + 7 page)
- Quick action added to .mitzo.json
- Route at /calendar behind ProtectedRoute

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(calendar): address all Centaur review findings

- Add script existence check before exec (was #1 critical)
- Add Zod CalendarResponse schema for stdout validation (#2)
- Check r.ok before parsing fetch response in hook (#3)
- Compute today fresh in handleToday to avoid stale date (#6)
- Extract EventCard + SprintBar to separate component files (#7)
- Extract calendar CSS to dedicated calendar.css (#8)
- Add tests: Day/Week toggle, Today button, EventCard expand,
  milestone expand, non-ok HTTP response handling (#4, #5)

832 tests passing (5 new).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(calendar): resolve lint errors and review findings

- Remove unused imports (beforeEach, writeFileSync, result)
- Fix toLocalDate to use local timezone instead of UTC
- Remove dead 'sprint' variant from CalendarEvent.type union

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* style: format global.css with prettier

Also add .claude/worktrees/ to .prettierignore to prevent
worktree artifacts from failing format checks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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