Commit Graph

626 Commits

Author SHA1 Message Date
chihlasm
dbe66a0568 feat: bold dashboard redesign with inline stats, section labels, and chip icons
Restructure QuickStartPage for a more professional, informative layout:
- Left-aligned hero greeting (text-4xl) with date context and inline stat strip
- GreetingStatStrip shows resolved/active/MTTR at a glance
- Remove collapsible toggle — dashboard stats always visible
- Section labels with trailing border lines for visual hierarchy
- Suggestion chips with category icons, card-style hover, press feedback
- Fix cyan focus ring and icon color to ember orange design system
- Session cards: line-clamp-2 descriptions, font-medium text, problem_domain metadata
- Widen container max-w-3xl → max-w-4xl for breathing room
- Add .impeccable.md and .github/copilot-instructions.md design context
- CLAUDE.md audit: fix stale references, remove duplication, update counts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 05:04:20 +00:00
chihlasm
3c0a29115c feat: AI marker system prompt fixes, TaskLane activation, and FlowPilot updates
- Fix system prompt to ensure [QUESTIONS]/[ACTIONS] markers in AI responses
- Add format reminder injection to user messages for marker compliance
- Wire TaskLane activation in prefill and resume paths
- Add ActionCardGroup component for structured question/action rendering
- Update FlowPilot session and step card components
- Update ai-session schemas and types for marker data

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 19:57:39 +00:00
chihlasm
37d217b12a docs: TaskLane improvements design spec and implementation plan
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 19:53:23 +00:00
chihlasm
ca60b77d9a feat: collapsible chat sidebar with top bar mode
Sidebar collapses to a horizontal top bar with "New" and "History"
buttons plus active chat title. Persists to localStorage. Fixes
layout nesting so TaskLane renders correctly when sidebar is collapsed.
Also removes chat input separator line.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 19:53:18 +00:00
chihlasm
56aaa276ee fix: remove unused imports for clean production build
Remove unused Wrench import from TaskLane, unused BranchMap import
and handleBranchSwitch from AssistantChatPage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 17:09:14 +00:00
chihlasm
0983c1ac9e feat: TaskLane partial submit, edit done cards, preview, and resize
- Enable submit when at least 1 item is answered (not all required)
- Dynamic label: "Send 2 of 6 Responses" vs "Send All Responses"
- Done cards are clickable to reopen for editing
- Collapsible preview shows formatted message before sending
- Resizable via left-edge grip handle, width persists to localStorage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 17:05:36 +00:00
chihlasm
d8e62a7108 fix: clear TaskLane on chat switch and remove double border
- Reset TaskLane state in handleNewChat and selectChat
- Conditionally remove chat input top border when TaskLane is open

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 17:02:26 +00:00
chihlasm
db43dfa08e fix: make branch hover scrim non-interactive so cards remain clickable
Scrim now uses pointer-events-none — it dims visually but clicks pass
through to the cards beneath. Dismissal relies on onMouseLeave on the
wrapper div, which fires when the mouse leaves the card area.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 23:35:02 +00:00
chihlasm
b96f4a42bb fix: dismiss branch hover card when mouse leaves to scrim
The fixed scrim was catching the mouse, keeping the hover alive
indefinitely. Now the scrim has onMouseEnter={() => setIsHovered(false)}
so moving the mouse anywhere off the expanded card dismisses it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 23:30:32 +00:00
chihlasm
5eb99e35c1 feat: branch hover card pops out in front with backdrop dim
On hover, the card:
- Grows slightly wider and floats directly over the base card
- Shows detail content (tried, result, reason, steps)
- Dims everything behind it with a fixed black/30 scrim
- Heavy drop shadow for depth (0 8px 32px rgba(0,0,0,0.5))
- Status-colored border maintained

Active branch still shows detail inline (no hover needed).
Cards below don't shift — the expanded version is position: absolute.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 23:26:20 +00:00
chihlasm
8180aa69b0 feat: branch hover detail as floating popover instead of inline expand
- Active branch: detail shows inline below the card header (no push)
- Hovered non-active: detail appears as a floating popover to the
  RIGHT of the card (position: absolute, z-50, left-full)
- Popover has shadow, status-colored border, fade+zoom entrance
- Cards no longer shift or push siblings on hover
- Extracted BranchDetail component shared by both inline and popover

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 23:20:38 +00:00
chihlasm
0f70cca905 feat: restyle branch sidebar — real cards, scale animation, visible labels
BranchMap header:
- GitBranch icon: text-muted → text-accent-text
- "Branch Map" label: text-muted → text-muted-foreground
- Count: text-muted → text-muted-foreground with font-medium

BranchNode cards:
- Now proper cards: bg-card/60 with 1px border-default, rounded-lg, p-2.5
- Active card: accent-tinted border, subtle glow
- Hover animation: scale(1.02) + shadow — card lifts toward the user
  instead of expanding downward
- Detail section: uses scale-y transform from origin-top, feels like
  the card is growing rather than content sliding down
- Status-aware border colors (accent/success/danger/warning)
- Detail labels ("Tried:", "Result:") now text-foreground font-medium
  instead of invisible text-muted
- Depth indentation via marginLeft instead of paddingLeft

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 23:09:59 +00:00
chihlasm
55d24118e0 feat: resizable sidebar, branch hover preview, Fork Point label fix
- Sidebar: click-and-drag resize handle (200-500px range), accent
  highlight on drag, cursor changes to col-resize
- BranchNode: hover/active expands to show context_summary (tried,
  result), status_reason, and step count with smooth animation
- ForkCard: "Fork Point" label changed from text-muted to
  text-accent-text for visibility against bg-card

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 22:55:11 +00:00
chihlasm
01836d6a2d fix: replace text-secondary with text-muted-foreground in branching components
In Tailwind v4, text-secondary resolves to --color-secondary (#2e3140),
a dark surface color — NOT --color-text-secondary (#848b9b). This made
all secondary text invisible on dark backgrounds.

The correct class is text-muted-foreground which maps to #848b9b.
This matches the pattern used by existing FlowPilot components.

Also reverts the unnecessary index.css variable bump from prior commit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 22:36:01 +00:00
chihlasm
4c42522925 fix: bump text-secondary from #848b9b to #a0a7b8 for better contrast
Old value had ~4.2:1 contrast on bg-page (#1a1c23), borderline for
readability. New value gives ~5.5:1 — noticeably more readable while
still clearly subordinate to text-primary (#e2e5eb).

Also updates muted-foreground Tailwind semantic alias to match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 22:29:13 +00:00
chihlasm
20302900b8 fix: improve text contrast on DevBranchingPage
- Page subtitle: text-secondary → text-primary
- Helper text: text-muted → text-secondary
- Section labels: text-muted → text-secondary
- Detail card labels: text-muted → text-secondary
- Detail card values: text-primary → text-heading
- Detail card body: text-secondary → text-primary

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 21:51:24 +00:00
chihlasm
0bd1090a5b fix: improve text contrast in ForkCard and BranchRevivalCard
- ForkCard: fork reason → text-heading, option labels → text-heading,
  descriptions → text-primary, unselected options get bg-elevated/50
- BranchRevivalCard: evidence description → text-primary

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 21:21:13 +00:00
chihlasm
029d31ba0b fix: replace hardcoded colors with CSS variables in branching components
All semantic colors now use design system tokens:
- #34d399 → text-success / bg-success-dim
- #f87171 → text-danger / bg-danger-dim
- #eab308 → text-warning / bg-warning-dim
- yellow-400 → text-warning / bg-warning-dim / border-warning
- #ea580c → hover:bg-accent-hover
- red-400 → text-danger / bg-danger-dim

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 21:05:02 +00:00
chihlasm
bdbc2d9bf5 fix: add font-heading to branching component headings
Match production design system — Bricolage Grotesque on h1/h2 elements.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 21:00:38 +00:00
chihlasm
f564832cc4 feat: add /dev/branching test page for branching components
Standalone page with mock data showing BranchMap, ForkCard,
BranchTransitionBar, BranchRevivalCard, HandoffModal, and
ResolutionOutputPanel — no API calls needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:22:11 +00:00
chihlasm
cb758ad4fd fix: add explicit foreign_keys to all branching model relationships
SQLAlchemy can't resolve ambiguous FK paths when tables have
multiple cross-references. All relationships now specify foreign_keys.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 15:20:46 +00:00
chihlasm
9813c96ca2 fix: rename branching migration to 067 to avoid duplicate revision ID
030 was already taken by 030_enhance_invite_codes.py.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:45:54 +00:00
chihlasm
19283fdeb6 fix: add missing branching files and TypeScript fix
- Add BranchRevivalCard, BranchTransitionBar, useHandoff, useResolutionOutputs, SessionQueuePage
- Fix useFlowPilotSession: add is_branching/active_branch_id defaults

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 13:40:13 +00:00
chihlasm
c8778bb4e7 fix: align frontend API paths with backend endpoints
- handoffs: /handoffs/queue → /ai-sessions/queue, claim needs sessionId
- resolutions: /resolution-outputs → /outputs
- branches: /status suffix removed from PATCH path
- Add SessionQueuePage route at /queue

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 13:36:05 +00:00
chihlasm
e0d4148702 feat: generate resolution outputs on session resolve
Integrates ResolutionOutputGenerator into the resolve endpoint so that
structured outputs (ticket note, KB article, etc.) are auto-generated
after every successful session resolution. Non-blocking — resolve still
succeeds if output generation fails.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 11:04:38 +00:00
chihlasm
dfe19f88e3 feat: add ResolutionOutputPanel with three-tab view, edit, and push
Three tabs: PSA Notes (FileText), KB Article (BookOpen), Client Summary
(MessageSquare). Content area shows generated or edited text in monospace.
Edit mode swaps in a textarea. Action bar: Edit, Copy to clipboard (with
checkmark feedback), Push to PSA (disabled when already pushed).
Uses resolutionsApi directly without a custom hook.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 10:22:53 +00:00
chihlasm
1707f8f3d4 feat: add HandoffModal for unified park/escalate
Fixed overlay with park/escalate intent toggle (accent-dim when active),
notes textarea, elevated priority checkbox (escalate only), and Cancel/Submit
buttons. Mobile responsive: items-end on mobile, items-center on sm+.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 10:12:13 +00:00
chihlasm
b08e28030b feat: add ForkCard component for in-chat fork decision points
Renders fork reason text and a list of option buttons. Selected option
gets an accent border and accent-dim background. Unselected options use
border-default. GitFork icon in header.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 10:01:45 +00:00
chihlasm
c0dfa7c230 feat: add BranchMap sidebar with BranchNode tree visualization
BranchNode renders a branch button with depth-based indent, status icon,
and status badge using the design system color palette. BranchMap builds
a tree from the flat branch list via buildTree/flattenTree and renders
all nodes with a GitBranch header.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 09:51:30 +00:00
chihlasm
f5056d2e84 feat: add useBranching hook for branch state management
Manages branch list and active branch ID with useState. Exposes loadBranches,
createFork, switchBranch, updateStatus, reviveBranch, and sendMessage actions
via useCallback. Errors surface via toast notifications.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 09:30:58 +00:00
chihlasm
30d7d6e5a3 feat: add frontend API clients for branches, handoffs, and resolutions
Adds branchesApi (getBranches, createFork, updateBranchStatus, switchBranch,
reviveBranch, sendBranchMessage), handoffsApi (createHandoff, listHandoffs,
claimHandoff, getQueue), and resolutionsApi (getOutputs, editOutput, pushOutput).
All exported from api/index.ts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 09:20:36 +00:00
chihlasm
fc8b73f765 feat: add TypeScript types for branching, handoffs, and resolution outputs
Adds BranchResponse, ForkPointResponse, BranchSwitchResponse, HandoffResponse,
QueueItemResponse, ResolutionOutputResponse and related request/response types.
Extends AISessionDetail with is_branching and active_branch_id fields.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:50:02 +00:00
chihlasm
5481815173 feat: add async AI description generation on file upload
Adds _generate_ai_description background task that fires after a
successful upload: images get a one-sentence vision description via
Claude, text/log/config files get extracted_content + AI summary when
>2000 chars. Runs as asyncio.create_task so it never blocks the upload
response. Errors are logged and swallowed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:47:48 +00:00
chihlasm
a928901a2f feat: add resolution output API endpoints
Adds GET /outputs, PATCH /outputs/{id}, and POST /outputs/{id}/push
endpoints under /ai-sessions/{session_id}/, plus integration tests.
Router registered before ai_sessions to avoid path conflict.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:47:09 +00:00
chihlasm
5f3169bad4 feat: add ResolutionOutputGenerator with three-output generation
Adds ResolutionOutputGenerator service that generates PSA ticket notes,
knowledge base article draft, and client summary on session resolve, plus
integration tests for generate_all and edit_output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:46:29 +00:00
chihlasm
9d2a8332aa feat: add handoff API endpoints with queue and integration tests
Four endpoints: create handoff (park/escalate), list handoff history,
claim session, and team queue. Two routers: session-scoped router with
prefix /ai-sessions/{session_id} and queue_router with prefix /ai-sessions.
queue_router registered before ai_sessions.router to avoid /{session_id}
path conflict on GET /ai-sessions/queue.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:43:32 +00:00
chihlasm
f84b868d13 feat: add HandoffManager service with dual-write and integration tests
Unified park/escalate handoff management with snapshot generation,
AI diagnostic assessment for escalations (via _call_ai), claim workflow
that reactivates sessions, PSA push via existing psa_documentation_service,
and team queue query. Dual-writes to ai_sessions.escalation_package for
backward compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:42:21 +00:00
chihlasm
7b4060a4d1 feat: integrate branching into chat service and step creation
Add is_branching guard to unified_chat_service.send_chat_message() that
routes messages through BranchAwarePromptBuilder when a session has active
branching. Add branch_id to all AISessionStep constructor calls in
flowpilot_engine.py via optional branch_id param on _create_step_from_parsed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:41:22 +00:00
chihlasm
395f157578 feat: add branch API endpoints with integration tests
Six REST endpoints for branch lifecycle management (list, fork, update
status, switch, revive, branch-message) with BranchManager + BranchAwarePromptBuilder
integration. Registered session_branches router in api/router.py.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:41:17 +00:00
chihlasm
d8312c24a5 feat: add BranchAwarePromptBuilder with unit tests
Pure function that assembles system prompt, cross-branch context,
history, and images for _call_ai — no DB access, no LLM calls.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:36:13 +00:00
chihlasm
cc77f2858d feat: add BranchManager service with integration tests
Implements branch lifecycle management for conversational branching:
create_root_branch, create_fork, switch_branch, mark_branch_status,
revive_branch, get_branch_tree, and build_cross_branch_context.
Five integration tests cover the full lifecycle from root creation
through forking, switching, dead-end marking, and tree retrieval.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:34:49 +00:00
chihlasm
52fa1153c4 feat: add Pydantic schemas for branching, handoffs, and resolution outputs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:30:18 +00:00
chihlasm
f884f6af92 feat: add conversational branching migration — 4 tables, 13 columns
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:29:32 +00:00
chihlasm
6f56a639ee feat: register branching models in alembic env
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:27:27 +00:00
chihlasm
e96c94efbd feat: add branching columns to ai_sessions, ai_session_steps, file_uploads
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:27:17 +00:00
chihlasm
c9798514a9 feat: add SessionResolutionOutput model and register all 4 branching models
Introduces the session_resolution_outputs table for the three resolve
deliverables (psa_ticket_notes, knowledge_base, client_summary) with
UNIQUE(session_id, output_type) for safe upsert on regeneration.
Also registers SessionBranch, ForkPoint, SessionHandoff, and
SessionResolutionOutput in models/__init__.py so Alembic and the app
pick them up automatically.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:23:48 +00:00
chihlasm
c72bf99dbd feat: add SessionHandoff model for conversational branching
Introduces the session_handoffs table as a unified park/escalate event
log with intent, snapshot, AI assessment, artifacts, and PSA push
tracking — replacing ad-hoc escalation_package writes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:23:42 +00:00
chihlasm
df8e589992 feat: add ForkPoint model for conversational branching
Introduces the fork_points table to capture decision points where a
FlowPilot session diverges into multiple diagnostic branches, storing
the trigger step, fork reason, and available options as JSONB.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:23:38 +00:00
chihlasm
9d037dc2c2 feat: add SessionBranch model for conversational branching
Introduces the session_branches table to represent diagnostic hypothesis
paths within a FlowPilot session, supporting parent/child branch
relationships, status lifecycle, and per-branch conversation history.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:23:34 +00:00
chihlasm
58c2a80d8a docs: add Conversational Branching implementation plan
27-task plan covering 6 phases: data foundation (4 models, migration),
branch engine (BranchManager, prompt builder, API), handoff system
(park/escalate with dual-write), resolution outputs (3-output generator),
AI description pipeline, and frontend (BranchMap, ForkCard, HandoffModal,
ResolutionOutputPanel, SessionQueuePage).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:15:19 +00:00