Commit Graph

510 Commits

Author SHA1 Message Date
chihlasm
b75b4a3c10 fix: improve TaskLane section header readability
Change "Questions" and "Diagnostic Checks" headers from text-muted
(#4f5666, barely visible on sidebar) to text-muted-foreground (#848b9b).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 16:44:28 +00:00
chihlasm
99a1af3585 fix: update meta theme-color to new sidebar color (#0e1016)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 16:21:27 +00:00
chihlasm
1152b023bf feat: replace hardcoded orange hex values with blue equivalents
BrandLogo gradient, EmptyStateIllustrations SVGs, categoryColors,
landing page, brand SVG assets, and all remaining files.
Warning #eab308 → #fbbf24 (amber). categoryColors deduped.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 16:20:52 +00:00
chihlasm
61c410e366 feat: replace orange-* Tailwind classes with blue-* equivalents
orange-400→blue-400, orange-500→blue-500, orange-600→blue-600
across ~21 component files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 16:20:24 +00:00
chihlasm
5ff9a9d75e feat: replace all hardcoded orange rgba with blue rgba
Mechanical find-and-replace: rgba(249,115,22,...) → rgba(96,165,250,...)
across ~40 component and page files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 16:20:13 +00:00
chihlasm
3e52708253 feat: migrate index.css to design system v6 color tokens
Accent: orange (#f97316) → blue (#60a5fa)
Surfaces: deeper charcoal range (#16181f page, #1e2028 card)
Warning: yellow (#eab308) → amber (#fbbf24)
Info: new cyan (#67e8f9) token added
All Tailwind semantic mappings updated to match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 16:19:21 +00:00
chihlasm
d5122123c2 fix: preserve task lane answers across page reload and browser close
Two issues fixed:

1. TaskLane useEffect on [questions, actions] was resetting all tasks
   to pending with empty values, wiping restored user answers. Now
   checks sessionStorage for saved state before resetting.

2. selectChat was setting activeQuestions/activeActions before writing
   responses to sessionStorage, causing a race where TaskLane mounted
   with new props but empty sessionStorage. Now writes responses to
   sessionStorage first so TaskLane can restore them on prop change.

The backend saveTaskLane debounce (2s) persists responses to the DB,
and selectChat restores them via pending_task_lane.responses. This
chain now survives browser close.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 12:53:16 +00:00
chihlasm
bc6afbc90a fix: use status update API as fallback for resolve ticket notes
The non-streaming fallback used getDocumentation which relies on
session.steps — empty for chat sessions, producing only the bare
resolution_summary text. Switch fallback to generateStatusUpdate
which reads conversation_messages and generates proper context-aware
ticket notes for both chat and guided sessions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 07:32:14 +00:00
chihlasm
a705bd58f9 fix: clear stale task lane when starting session from dashboard prefill
The sendPrefill flow (dashboard handoff) did not clear activeQuestions/
activeActions before creating the new session. The task lane initializer
loaded stale data from sessionStorage keyed to the previous session ID,
showing old tasks while the new session was processing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 07:28:35 +00:00
chihlasm
d6877bb55e fix: correct streamDocumentation URL path to include /v1 prefix
The SSE stream URL was /api/ai-sessions/ but the backend mounts all
routes under /api/v1/. This caused a 404, falling through to a
non-streaming fallback that returned empty documentation for chat
sessions. This is why "Conclude → Resolved" never showed ticket notes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 07:21:44 +00:00
chihlasm
2c8aca3951 feat: add status update generation to assistant chat
Wire StatusUpdateModal into AssistantChatPage with "Update" button in
the chat toolbar. Enhance ConcludeSessionModal pause/escalate outcomes
to offer ticket notes, client update, or email draft generation instead
of static messages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 06:03:34 +00:00
chihlasm
0d89597fc0 chore: delete SaveToLibraryDialog, replaced by ParameterizeAndSavePanel
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 05:58:39 +00:00
chihlasm
00e4a16ab5 feat: add 'New from Script' button to ScriptLibraryPage
Opens the ParameterizeAndSavePanel in paste mode, letting users import
raw scripts with parameter detection and review before saving to library.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 05:54:48 +00:00
chihlasm
da71cd6ca4 feat: wire ParameterizeAndSavePanel into ScriptBuilderPage
Replace SaveToLibraryDialog with the new panel that includes parameter
detection, review, and template rewriting before saving to library.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 05:53:49 +00:00
chihlasm
e6edf34485 feat: add ParameterizeAndSavePanel component
Slide-in panel for saving scripts to library with parameter detection,
stepper review, template rewriting, and metadata collection. Supports
both script mode (from AI builder) and paste mode (raw script import).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 05:52:17 +00:00
chihlasm
503402386a feat: add script_body and parameters_schema to SaveToLibraryRequest type
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 05:49:32 +00:00
chihlasm
564d88e90f fix: update useFlowPilotSession return types for optional documentation
SessionCloseResponse.documentation is now nullable — update resolve/escalate
return types to match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:25:08 +00:00
chihlasm
8c7a863f5f chore: remove debug logging from AssistantChatPage
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:09:26 +00:00
chihlasm
5e04aad16f feat: two-phase resolve with streaming ticket notes generation
ConcludeSessionModal now resolves instantly (Phase 1) then streams
ticket notes via SSE (Phase 2), with skeleton loading and fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:08:25 +00:00
chihlasm
bcab8158ab feat: add streamDocumentation SSE client for ticket notes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:05:20 +00:00
chihlasm
7a5d56494b feat: make resolve endpoint non-blocking, documentation optional
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:04:38 +00:00
chihlasm
bb4743568b feat: add Tasks pill to reopen collapsed task lane
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:02:44 +00:00
chihlasm
ca686c0901 feat: task lane close preserves state instead of clearing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:02:20 +00:00
chihlasm
c47b8d26e5 feat: replace task lane X with PanelRightClose icon
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:02:14 +00:00
chihlasm
0483b6f0f5 fix: prevent Monaco onChange echo from dismissing parameter stepper
ScriptBodyEditor's onChange fired when the value prop changed externally
(from handleAcceptCandidate inserting placeholders), creating a feedback
loop that reset acceptingCandidateRef before the second useEffect cycle.
Guard onChange to only propagate when the value actually differs from the
current prop.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 22:18:17 +00:00
chihlasm
96602a6676 fix: return pending_task_lane in session detail API response + debug logging
_build_session_detail was omitting pending_task_lane, is_branching, and
active_branch_id from the GET /ai-sessions/{id} response. The fields
existed on the schema and model but were never passed in the manual
constructor, so task lane state could never be restored on navigation.

Also adds console logging to AssistantChatPage selectChat flow to
diagnose message restoration, and fixes ScriptTemplateEditor stepper
dismiss firing during programmatic script_body updates.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 21:44:04 +00:00
chihlasm
80af408f2d feat: persist task lane user responses to backend
Add PUT /ai-sessions/{id}/task-lane endpoint that saves the full task
lane state (AI questions/actions + user's in-progress responses) to
the pending_task_lane JSONB column. TaskLane debounce-saves to the
backend every 2s after changes. On session load, user responses are
restored from the backend into sessionStorage so TaskLane picks them
up on mount. Users can now close the browser, come back later, and
find their task lane exactly where they left it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 19:11:13 +00:00
chihlasm
977e5a8ddb fix: task lane restore checks activeChatId, not urlSessionId
The showTaskLane initializer was comparing the saved chatId against
urlSessionId (null on /assistant), so it never matched. Now compares
against activeChatId which is already restored from sessionStorage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 13:03:06 +00:00
chihlasm
1e78977e4f feat: restore active chat session on reload
Save activeChatId to sessionStorage so reloading /assistant restores
the last conversation. Messages load from backend conversation_messages,
task lane restores from sessionStorage (with partial answers intact).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 05:39:09 +00:00
chihlasm
e9f96474e0 feat: persist task lane state across reloads and session switches
TaskLane now saves user's in-progress answers (typed text, checked
items) to sessionStorage keyed by session ID. On reload or session
switch, the full task lane state restores — including partial work.

- TaskLane: saves tasks array to sessionStorage on every change,
  restores from sessionStorage on mount
- AssistantChatPage: saves task lane metadata (visibility, questions,
  actions, chatId) to sessionStorage, restores on mount
- Closing the task lane clears its sessionStorage entry

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 04:21:42 +00:00
chihlasm
6268aa3520 fix: task lane no longer self-hides on submit
TaskLane had `if (submitted) return null` which immediately hid the
component after submit, before the AI could respond. Now the parent
controls visibility: the lane stays visible during the AI call, then
either updates with new tasks or clears when the AI sends none.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 03:05:58 +00:00
chihlasm
ecd7393646 feat: persist task lane across submits and session reloads
Task lane questions/actions are now saved to a pending_task_lane JSONB
column on ai_sessions, restoring them on session switch or page reload.
Partial submit no longer force-clears the lane — the AI response
controls what stays. Also removes redundant "New Session" button from
the sidebar (dashboard already provides this).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 21:48:06 +00:00
chihlasm
c7abe905f7 fix: resolve strict mode violations and stale text in E2E tests
- public.spec.ts: add exact:true for 'Start Free' (matched 3 links)
- navigation/history: add exact:true for 'Sessions' heading (matched
  'AI Sessions' and 'Flow Sessions' subheadings too)
- command-palette: 'Ask FlowPilot AI' → 'Troubleshoot with FlowPilot'
- CLAUDE.md: add warning not to use gh run watch (burns tokens)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 17:16:38 +00:00
chihlasm
9061c91c89 fix: align CI tests with current UI text and database naming
Backend conftest.py was hardcoded to patherly_test but CI creates
resolutionflow_test — now reads DATABASE_URL env var first. E2E tests
had stale placeholder text, heading, and landing page assertions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 17:02:19 +00:00
chihlasm
9150972de9 fix: reuse frontend build artifact in e2e instead of rebuilding
The e2e job was running a full Vite build on the same runner as the
backend + Postgres, causing OOM. Now:
- Frontend job uploads dist/ as an artifact
- E2E job depends on frontend, downloads the artifact
- Playwright webServer skips build in CI, just runs preview
- Locally still builds as before

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 16:42:04 +00:00
chihlasm
ba6a8af251 fix: increase Node heap and timeout for Playwright webServer build
The e2e webServer builds the frontend via npm run build, which OOMs
on CI runners without --max-old-space-size=4096. Also increase timeout
from 120s to 180s to accommodate the larger heap build.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 16:36:11 +00:00
chihlasm
6917d46132 fix: move eslint-disable comments to directly before setState calls
eslint-disable-next-line only covers the next line, not lines further
down. Moved the comments from before useEffect() to before the actual
setState call inside the effect body.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 16:10:36 +00:00
chihlasm
4b8282ecec fix: suppress remaining lint errors in FlowPilotSession and AnalyticsPage
- eslint-disable for unused _ticket param (needed for onSelect type compat)
- eslint-disable for setState in lazy-load useEffect

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 16:05:08 +00:00
chihlasm
69edf5378b fix: resolve remaining CI failures — mapper FK mismatch and lint errors
Backend: Use string-form foreign_keys on SessionBranch.session to match
AISession.branches — mixed column-object vs string-expression caused
SQLAlchemy mapper initialization conflict.

Frontend lint fixes:
- Remove unused _escalateUploads, _intakeUploads destructured vars
- Remove unused _ticket, _chatId, _pinned parameters
- Replace empty interface with type alias (public-templates.ts)
- Suppress setState-in-effect in SimilarSessions, SidebarStatsBar,
  FlowPilotAnalyticsPage (intentional prop sync patterns)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 12:32:24 +00:00
chihlasm
05f81d04df fix: resolve CI failures — SQLAlchemy mapper conflict and lint errors
- Add back_populates to SessionBranch.session ↔ AISession.branches
  to fix SQLAlchemy InvalidRequestError that broke all backend tests
- Remove unused 'tree' variable in command-palette.spec.ts
- Suppress setState-in-effect lint rule in TaskLane (intentional sync)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 11:51:18 +00:00
chihlasm
1225b55786 fix: use opacity-only fade for page transitions instead of fade-in-up
ViewTransitionOutlet was using animate-fade-in-up (opacity + translateY)
on every route change, causing visible content shift on navigation.
Switch to animate-fade-in (opacity only) for a subtler transition.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 11:16:30 +00:00
chihlasm
8769b802c4 fix: eliminate page load blinking by adding animation-fill-mode: both
All CSS animations starting from opacity:0 were missing backwards
fill-mode, causing elements to render visible then snap to invisible
when the animation started (especially with delays). Changed forwards
to both on all opacity-based animation shorthands and utilities.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 11:08:48 +00:00
chihlasm
b7a126299a merge: integrate fix/color-audit-cleanup into dashboard redesign
Resolve focus ring conflict in StartSessionInput — keep explicit
rgba values over Tailwind primary/20 for consistency with design system.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 06:09:33 +00:00
chihlasm
34b0f2ade9 fix: eliminate deprecated cyan, glass-border, and off-palette colors site-wide
- Replace all rgba(6,182,212,...) cyan focus borders and accents with
  rgba(249,115,22,...) ember orange across 21+ component files
- Remove all var(--glass-border) references (undefined variable) with
  var(--color-border-default) across 24 files
- Remove deprecated blur orbs and glass-morphism effects from
  SurveyPage, SurveyThankYouPage, and LoginPage
- Migrate landing.css from hardcoded hex to CSS custom properties
  (~97 replacements for single-source theming)
- Fix off-palette grays in FlowPilotAnalyticsPage chart styling
  (#8891a0 → #848b9b, #18191f → var(--color-bg-card))
- Update stale comments: "cyan brand" → "accent brand" in GlowEdge,
  "gradient cyan square" → "gradient orange square" in BrandLogo
- Rename glow-cyan SVG filter ID to glow-accent
- Fix category color comment: "cyan" → "deep orange"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 05:42:08 +00:00
chihlasm
4be8388a44 refactor: remove Recent Sessions from dashboard, hide Active when empty
Active Sessions section now auto-hides when there are no active sessions
(same pattern as PendingEscalations). Recent Sessions removed from
dashboard entirely — users access history via the History page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 05:41:37 +00:00
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
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