Commit Graph

130 Commits

Author SHA1 Message Date
Dave
2e2f70df72 Revert "story-kit: merge 86_story_show_live_activity_status_instead_of_static_thinking_indicator_in_chat"
This reverts commit ef162d91ff.
2026-02-24 12:16:45 +00:00
Dave
ef162d91ff story-kit: merge 86_story_show_live_activity_status_instead_of_static_thinking_indicator_in_chat 2026-02-24 12:08:59 +00:00
Dave
e6339979de feat(story-115): hot-reload project.toml agent config without server restart
- Extend `WatcherEvent` to an enum with `WorkItem` and `ConfigChanged` variants
  so the watcher can distinguish between pipeline-file changes and config changes
- Watch `.story_kit/project.toml` at the project root (ignoring worktree copies)
  and broadcast `WatcherEvent::ConfigChanged` on modification
- Forward `agent_config_changed` WebSocket message to connected clients; skip
  pipeline state refresh for config-only events
- Add `is_config_file()` helper with unit tests covering root vs. worktree paths
- Accept `configVersion` prop in `AgentPanel` and re-fetch the agent roster
  whenever it increments
- Increment `agentConfigVersion` in `Chat` on receipt of `agent_config_changed`
  WS event via new `onAgentConfigChanged` handler in `ChatWebSocket`

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 22:58:51 +00:00
Dave
85fddcb71a story-kit: merge 117_story_show_startup_reconciliation_progress_in_ui 2026-02-23 22:50:57 +00:00
Dave
6bf523d31e story-kit: merge 112_story_add_test_coverage_for_app_tsx 2026-02-23 22:45:59 +00:00
Dave
17b909c97f story-kit: merge 113_story_add_test_coverage_for_usepathcompletion_hook 2026-02-23 22:32:39 +00:00
Dave
cee2fbe99e story-kit: merge 111_story_add_test_coverage_for_api_agents_ts 2026-02-23 22:31:25 +00:00
Dave
a8f3624b4c story-kit: merge 110_story_add_test_coverage_for_api_settings_ts 2026-02-23 22:30:04 +00:00
Dave
a3b0dc0161 story-kit: merge 109_story_add_test_coverage_for_lozengeflycontext_selectionscreen_and_chatheader_components 2026-02-23 22:28:13 +00:00
Dave
40b0cd77c9 fix: resolve merge conflicts from story-95/96 squash merges
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 21:39:40 +00:00
Dave
52b9bc2994 story-kit: accept 95_bug_pipeline_auto_restart_has_no_retry_limit_causing_infinite_loop 2026-02-23 21:37:05 +00:00
Dave
fcf7984a89 story-kit: queue 100_story_test_coverage_http_context_rs_to_100 for QA 2026-02-23 21:34:59 +00:00
Dave
94ac7639ad Merge branch 'feature/story-85_story_agent_lozenges_move_between_roster_and_work_items_instead_of_duplicating'
# Conflicts:
#	.coverage_baseline
2026-02-23 21:24:44 +00:00
Dave
4740a24032 fix: add text reporter to vitest so coverage script can parse frontend coverage
The coverage script parses "All files" from vitest text table output, but
vitest was only configured with json-summary reporter. This caused frontend
coverage to show as 0%, pulling overall coverage below threshold.

Frontend line coverage is 68.4%, making overall coverage 66.4% vs 64.60% threshold.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 21:11:51 +00:00
Dave
a0f317292c story-kit: merge 93_story_expose_server_logs_to_agents_via_mcp
Adds log_buffer ring buffer and slog! macro for in-memory server log
capture, plus get_server_logs MCP tool for agents to read recent logs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 20:53:37 +00:00
Dave
bed46fea1b story-kit: accept 96_story_reset_agent_lozenge_to_idle_state_when_returning_to_roster 2026-02-23 20:52:06 +00:00
Dave
c1ff530e50 fix: allow e2e tests to reuse existing vite server on port conflict
Set reuseExistingServer:true in playwright config so acceptance gates
don't fail when port 41700 is already occupied by a prior test run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 20:39:57 +00:00
Dave
6c1f8555e8 feat(story-85): agent lozenges move between roster and work items
- Add `hiddenRosterAgents: ReadonlySet<string>` to LozengeFlyContext:
  - Derived from pipeline: any agent currently assigned to a work item
  - `flyingOutAgents` state keeps badge hidden for 500 ms during the
    fly-out animation so the returning clone lands before the badge reappears
  - Union of both sets exposed as `hiddenRosterAgents` in context
- Update AgentPanel: wrap each RosterBadge in a collapsing div
  controlled by `hiddenRosterAgents`. The div transitions max-width
  0→300px / opacity 0→1 so the roster gap closes/opens smoothly.
- Add tests covering:
  - `hiddenRosterAgents` is empty when no agents are assigned
  - Badge hidden immediately when agent appears in pipeline
  - Badge hidden during fly-out (0–499 ms) and visible after (≥500 ms)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 19:52:23 +00:00
Dave
af1625a132 story-kit: merge 86_story_show_live_activity_status_instead_of_static_thinking_indicator_in_chat 2026-02-23 18:38:15 +00:00
Dave
ac22e9a882 story-kit: merge 87_story_update_agent_lozenge_colour_scheme_across_panels 2026-02-23 18:23:01 +00:00
Dave
d278c194fd fix: remove stray conflict marker in AgentPanel.test.tsx
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:19:38 +00:00
Dave
72741f7ea2 Merge story 83: remove active work list from agents panel
Resolves conflict in AgentPanel.test.tsx (duplicate RosterBadge tests
from story 81 merge).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:07:19 +00:00
Dave
8c2b6ee02c Merge story 81: agent roster badges show availability state
Green dot and styling for idle agents, blue pulsing dot for active.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:06:16 +00:00
Dave
29eff51182 story-kit: start 83_story_remove_active_work_list_from_agents_panel 2026-02-23 16:04:02 +00:00
Dave
6962e92f0c fix: resolve merge conflict in claude_code.rs
Keep master's quiet system/rate_limit_event handlers while preserving
the story-62 permission_request handler (the core feature).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 16:01:22 +00:00
Dave
1a73b88d85 story-83: remove active work list from Agents panel
Remove the "agents-at-work" list section from AgentPanel. The roster
badges with flying lozenge animations already convey which agents are
active, making the redundant list unnecessary.

- Remove StatusBadge, DiffCommand, EditorCommand components
- Remove expandedKey, logEndRefs, fade-timer state and effects
- Remove handleStop (no more Stop buttons)
- Keep agents state + SSE subscriptions (roster badges still need it)
- Delete diff-command and fade-out tests (feature removed)
- Add test asserting no agent-entry divs are rendered

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 16:00:14 +00:00
Dave
76e5c40134 story-kit: merge 82_story_shift_enter_inserts_newline_instead_of_sending_in_chat_input 2026-02-23 15:59:01 +00:00
Dave
285b63ec66 story-kit: merge 81_story_agent_roster_badges_show_availability_state 2026-02-23 15:47:28 +00:00
Dave
0ef5e99d1b feat(story-81): agent roster badges show availability state with green idle styling
- Add data-testid="roster-dot-{name}" to both active and idle dot spans for testability
- Change idle badge from grey (#888, #555, #333) to green (#3fb950, #3fb95015, #3fb95040)
- Update idle label from "idle" to "available" to reinforce positive availability signal
- Update tooltip from "— idle" to "— available" for consistency
- Active/running agents retain blue (#58a6ff) pulsing dot styling unchanged
- Add 4 new Vitest tests covering green idle dot, green badge styling, blue active dot, and blue active badge

Closes story 81: Agent roster badges show availability state

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 15:43:25 +00:00
Dave
66534480f7 Merge story 74: agent lozenges float across UI during assignment
Resolves conflict in AgentPanel.test.tsx between story 73 (fade-out)
and story 74 (lozenge fly animation) - kept both the assertion and
the comment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 15:15:50 +00:00
Dave
3b3104ba2c fix: use act instead of waitFor in fake-timer test for agent fade-out
waitFor's internal polling setInterval is itself faked when vi.useFakeTimers()
is active, causing it to hang indefinitely. Replace the affected assertions
with act + multiple Promise.resolve() to flush React state updates, and a
direct assertion after act+vi.advanceTimersByTime instead of a second waitFor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 15:09:11 +00:00
Dave
8b912d1e9d style: biome format AgentPanel.test.tsx imports
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 15:04:23 +00:00
Dave
ef728331cf feat: FLIP-style lozenge fly animation when agents are assigned to stories
Implements Story 74: agent lozenges now animate as fixed-position overlays
that fly from the roster badge in AgentPanel to the story slot in StagePanel
(and back when the agent is removed), satisfying all acceptance criteria.

Key changes:
- LozengeFlyContext.tsx (new): coordinates FLIP animations via React context.
  LozengeFlyProvider tracks pipeline changes, hides slot lozenges during
  fly-in (useLayoutEffect before paint), then creates a portal-rendered
  fixed-position clone that transitions from roster → slot (or reverse).
  z-index 9999 ensures the clone travels above all other UI elements.
- AgentPanel.tsx: RosterBadge registers its DOM element with the context
  so fly animations know the correct start/end coordinates.
- StagePanel.tsx: AgentLozenge registers its DOMRect on every render via
  useLayoutEffect (for fly-out) and reads pendingFlyIns to stay hidden
  while a fly-in clone is in flight. Added align-self: flex-start so the
  lozenge maintains its intrinsic width and never stretches in the panel.
- Chat.tsx: right-column panels wrapped in LozengeFlyProvider.
- LozengeFlyContext.test.tsx (new): 10 tests covering fixed width,
  fly-in/fly-out clone creation, portal placement, opacity lifecycle,
  and idle vs active visual distinction.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 15:04:10 +00:00
Dave
6e9b5da458 story-kit: merge 77_bug_create_bug_file_writes_no_yaml_front_matter 2026-02-23 14:56:08 +00:00
Dave
32e1f0d342 story-kit: start 73_story_fade_out_completed_agents 2026-02-23 14:27:15 +00:00
Dave
46644a6bc9 story-kit: merge 68_story_frontend_pipeline_state_stale_after_server_restart 2026-02-23 13:33:33 +00:00
Dave
9417ada89d story-kit: start 59_story_current_work_panel 2026-02-23 13:23:35 +00:00
Dave
cbd0233e5e story-kit: start 65_story_standardised_script_test_entry_point_for_all_projects 2026-02-23 12:59:55 +00:00
Dave
fc128c474b Delete dead e2e tests for removed panels
Remove tdd-gates, story-todos, and test-protection e2e specs that
tested deleted GatePanel, TodoPanel, and ReviewPanel. Rename the
surviving boot smoke test from review-panel.spec.ts to smoke.spec.ts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:17:43 +00:00
Dave
810608d3d8 Spike 61: filesystem watcher and UI simplification
Add notify-based filesystem watcher for .story_kit/work/ that
auto-commits changes with deterministic messages and broadcasts
events over WebSocket. Push full pipeline state (Upcoming, Current,
QA, To Merge) to frontend on connect and after every watcher event.

Strip dead UI: remove ReviewPanel, GatePanel, TodoPanel,
UpcomingPanel and all associated REST polling. Replace with 4
generic StagePanel components driven by WebSocket. Simplify
AgentPanel to roster-only.

Delete all 11 workflow HTTP endpoints and 16 request/response types
from the server. Clean dead code from workflow module. MCP tools
call Rust functions directly and need none of the HTTP layer.

Net: ~4,100 lines deleted, ~400 added.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 19:39:19 +00:00
Dave
3e22654681 Fix leftover merge conflict markers in Chat.test.tsx
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:59:45 +00:00
Dave
e7d4590997 Story 48: Two Column Layout — Chat Left, Panels Right
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:56:28 +00:00
Dave
97dcab3b98 Fix failing Chat tests: correct tool call badge assertions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:51:47 +00:00
Dave
e8ea361a6c Fix: export unused EditorCommand component to fix TS build
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:13:30 +00:00
Dave
ed5f34b776 Story 37: Editor Command for Worktrees
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:49:36 +00:00
Dave
44bc82d23a Story 43: Unified chat UI for Claude Code and regular chat
Integrate Claude Code provider into the chat UI alongside regular
Ollama/Anthropic providers. Updates AgentPanel and Chat components.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:26:40 +00:00
Dave
91534b4a59 Accept story 38: Auto-Open Project on Server Startup
Server detects .story_kit/ in cwd or parent directories at startup and
automatically opens the project. MCP tools work immediately without
manual project-open step. Falls back to cwd when no .story_kit/ found.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:11:53 +00:00
Dave
1eae2410f3 Fix bugs 2 and 3: agent panel expand and stale worktree references
Bug 2: Expand triangle now works when no agents are started - shows
"No agents started" message. AgentPanel moved to top of panels.

Bug 3: Run `git worktree prune` before `git worktree add` to clean
stale references from externally-deleted worktree directories.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:17:20 +00:00
Dave
39b67ff754 Story 33: Copy-paste diff commands for agent worktrees
- Add base_branch detection to WorktreeInfo (from project root HEAD)
- Expose base_branch in AgentInfo API response
- Add {{base_branch}} template variable to agent config rendering
- Show git difftool command with copy-to-clipboard in AgentPanel UI
- Add diff command instruction to coder agent prompts
- Add AgentPanel tests for diff command rendering and clipboard

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 12:48:50 +00:00
Dave
3e99929d03 Fix bug 1: Only fetch Anthropic models when API key exists
getAnthropicModels() was called unconditionally on mount, causing a
console error when no API key was set. Now chains the call after
getAnthropicApiKeyExists() confirms a key is present.

Includes regression test added before the fix per bug workflow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 12:01:47 +00:00