Commit Graph

236 Commits

Author SHA1 Message Date
Michael Chihlas
e4ef904707 refactor: migrate page components to Design System v4
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 02:04:16 -04:00
Michael Chihlas
fd28921373 fix: remove unused BookOpen/MessageSquare imports from Sidebar
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 02:01:06 -04:00
Michael Chihlas
96a4130c0e refactor: migrate dashboard components to Design System v4
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 02:00:35 -04:00
Michael Chihlas
56ff792f8e refactor: migrate FlowPilot components to Design System v4
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 01:56:27 -04:00
Michael Chihlas
97a20a4225 fix: drawer uses fixed positioning to overlay main content
Grid cell was clipping the drawer at 72px. Now uses position: fixed
with left: 72px so it overlays the main content area and links
are clickable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 01:42:32 -04:00
Michael Chihlas
585149fa94 fix: drawer stays open when moving mouse from rail to drawer
Remove onMouseLeave from individual rail items — only the outer
wrapper handles close. Items only handle onMouseEnter to switch
which drawer is shown. Prevents premature drawer dismissal.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 01:40:57 -04:00
Michael Chihlas
6fb0d9bf81 fix: increase drawer close delay to 400ms for usability
120ms was too fast — mouse couldn't traverse the gap between
rail icon and drawer panel without triggering close.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 01:39:14 -04:00
Michael Chihlas
812a22b2b1 refactor: replace flyout popups with full-height resizable drawer
Sentry-style drawer slides out from rail edge, fills viewport height.
Drag handle on right edge to resize (180-400px range).
No more tooltip-style popups that cause layout jitter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 01:26:25 -04:00
Michael Chihlas
00ab9f1832 fix: sidebar fills full grid cell height
Sidebar wrapper uses flex + h-full, .sidebar gets height: 100%,
removed min-height: 100vh (grid cell handles sizing).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 01:21:11 -04:00
Michael Chihlas
ce76e146fd fix: ensure Unpin button visible in pinned sidebar footer
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 01:13:48 -04:00
Michael Chihlas
9fcc564333 fix: flyout positioning, sidebar full height, pin icon padding
- Flyout uses absolute positioning relative to parent item (not fixed)
- Both rail and pinned sidebar stretch to full viewport height
- Pin icon has proper bottom padding to avoid cutoff

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 01:11:16 -04:00
Michael Chihlas
bef649bb9a fix: restructure icon rail to 5 grouped items (Sentry-style)
Home, Work, Knowledge, Insights, Help — each with hover flyout
showing sub-items. Sidebar now stretches to full viewport height.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 01:05:41 -04:00
Michael Chihlas
8efc443949 refactor: implement icon rail sidebar for Design System v4
72px icon rail with hover flyouts, pin-to-expand toggle (260px),
keyboard accessible, mobile hamburger overlay. Flat TopBar styling
(no blur/glass). New BrandLogo mark (gradient square + lightning bolt).
BrandWordmark uses solid text color instead of gradient.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 00:26:19 -04:00
Michael Chihlas
0499284679 refactor: rewrite CSS foundation for Design System v4
New flat dark color tokens, remove glass/gradient utilities,
add compatibility shims for phased migration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 00:19:21 -04:00
Michael Chihlas
b801f6cac5 refactor: normalize script_builder_messages into separate table
Extract JSONB messages array from script_builder_sessions into a proper
script_builder_messages table with individual columns for role, content,
script, tokens, etc. Migration handles data migration from JSONB to rows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 21:06:58 -04:00
Michael Chihlas
5000e49cea refactor: add typed content helpers for FlowPilot step card actions
Replace unsafe `as string` casts with type guard functions
(isScriptGenerationAction, isScriptBuilderAction, getActionType)
for compile-time safety on step content parsing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 21:02:12 -04:00
Michael Chihlas
3d584902ef fix(sessions): date filter end date includes full day
Date range filters were sending midnight (start of day) for the end
date, excluding sessions created later that day. Now sends 23:59:59.999
for both flow sessions and AI sessions date filters.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 18:59:04 -04:00
Michael Chihlas
9b87e4dcc8 fix: add missing useNavigate import for abandon redirect
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 18:45:21 -04:00
Michael Chihlas
fb32f817fa refactor(sessions): merge Flow and AI sessions into unified view
Remove the Flow/AI session type toggle tabs. Both session types now
display on a single page — FlowPilot sessions at top, flow sessions
below, each with their own filters.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 18:42:16 -04:00
Michael Chihlas
229ecd4985 fix(flowpilot): redirect to Active Sessions after closing session
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 18:33:58 -04:00
Michael Chihlas
6ecb5a9bbd fix(flowpilot): widen message bar, add close/abandon session support
- Message bar now fixed-positioned above action bar with full-width
  layout (respects both app sidebar and session sidebar)
- Added abandon_session endpoint (POST /ai-sessions/{id}/abandon)
- Added "Close" button to FlowPilot action bar with confirmation dialog
- Session can now be closed without resolving or escalating

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 18:20:34 -04:00
Michael Chihlas
74bc5a532d fix(flowpilot): fix message bar hidden behind fixed action bar
The message bar was in normal document flow but the action bar uses
position:fixed at bottom:0, covering it. Now the message bar is also
fixed-positioned at bottom:60px (above the action bar), matching the
same left offset pattern. Added extra bottom padding to the
conversation column for clearance.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 17:49:49 -04:00
Michael Chihlas
535284c4ce feat: add My Scripts/Team Scripts tabs and Build button to Script Library
- Add language field to ScriptTemplateListItem frontend type
- Add mine/shared params to scriptsApi.getTemplates
- Update scriptGeneratorStore.loadTemplates to accept filter params
- Reorganize ScriptLibraryPage with tab bar (My Scripts / Team Scripts)
- Add "Build a New Script" button linking to /script-builder

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 17:17:47 -04:00
Michael Chihlas
25d7191575 feat: connect FlowPilot to Script Builder with handoff action
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 17:15:15 -04:00
Michael Chihlas
689776afd9 feat: add Script Builder page with chat UI, code blocks, preview modal, and save dialog
- ScriptCodeBlock: collapsed code preview with syntax highlighting (first 5 lines)
- ScriptBuilderInput: auto-resize chat input with Enter-to-send
- ScriptBuilderChat: message list with markdown rendering and code blocks
- ScriptPreviewModal: fullscreen script viewer with line numbers
- SaveToLibraryDialog: save script with name, description, category, team sharing
- ScriptBuilderPage: language selector, session management, FlowPilot handoff
- Added route, sidebar nav item (fuchsia), and mobile nav entry

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 17:11:32 -04:00
Michael Chihlas
ec245c9fef feat: add Script Builder frontend types and API client
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 17:00:41 -04:00
Michael Chihlas
ec7df50064 feat(flowpilot): add always-visible message bar, remove hidden free text escape hatch
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 16:52:17 -04:00
chihlasm
0c51198556 fix(landing): design audit fixes — hamburger menu, dead links, branding, spacing (#117)
* fix(landing): design audit fixes — hamburger menu, dead links, branding, spacing

- Add mobile hamburger menu with animated open/close and click-outside dismiss
- Create Privacy and Terms pages (footer links were dead # anchors)
- Change "Decision Tree Platform" to "AI-Powered Troubleshooting for MSPs" on login, register, and HTML title
- Fix register page icon color (was red/coral via CSS invert, now uses BrandLogo directly)
- Replace "0 Ticket Notes Written by Hand" stat with "100% Auto-Generated Documentation"
- Increase nav link touch targets to 44px minimum
- Fix heading hierarchy: section titles are now <h2>, standardize H3 to 1.25rem
- Tighten section spacing (6rem → 4rem padding, remove extra 5rem spacer)
- Add color-scheme: dark to HTML element
- Replace all transition: all with specific properties (10 occurrences)
- Fix loading ellipsis (... → …)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(mobile): responsive modals + landing preview overflow

- PrepareSessionModal: bottom-sheet on mobile, centered on desktop
- IntakeFormModal: bottom-sheet on mobile, responsive padding
- ShareTreeModal: bottom-sheet on mobile, full-width on small screens
- Landing preview: hide URL bar and window controls on mobile (<900px)
  to prevent 189px horizontal overflow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(mobile): collapse search bar to icon on mobile

On mobile (<640px), the full search bar with placeholder text and ⌘K
badge was taking too much space in the topbar. Now shows just a
magnifying glass icon that opens the same command palette on tap.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: chihlasm <michael@resolutionflow.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 09:55:37 -04:00
cf23107735 fix(escalations): add sidebar badge count + show all team escalations
- Add escalation_count to sidebar stats (team-wide requesting_escalation)
- Show badge on Escalations nav item in sidebar
- Remove user_id filter from escalation queue — show all team escalations
  including your own (needed for solo users and visibility)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 04:41:27 +00:00
7c3be84b52 feat(flowpilot): add navigation guard for active sessions
Shows a confirmation modal when user tries to navigate away during an
active troubleshooting session. Options: "Stay in Session" or "Pause &
Leave" which auto-pauses the session before navigating.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 00:44:48 +00:00
60b380ae1e fix(dashboard): auto-submit FlowPilot session when prefill from dashboard
When user types a problem on the dashboard and hits Enter, skip the
intake form and start the session immediately — no double-enter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 00:18:43 +00:00
3d911d2dc9 feat(dashboard): FlowPilot cockpit dashboard + sidebar redesign
- Replace QuickStartPage with FlowPilot-centric dashboard
- Add StartSessionInput with Guided/Chat mode toggle
- Add PendingEscalations, ActiveFlowPilotSessions, PerformanceCards
- Add KnowledgeBaseCards, TeamSummary, RecentFlowPilotSessions
- Every number/card is a portal to its detail page
- Restructure sidebar: Resolve/Knowledge/Insights sections
- Remove redundant nav items (FlowPilot, Flow Editor, Flow Assist, etc.)
- Wire prefill from dashboard input to FlowPilot intake
- Update mobile nav to match new sidebar structure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 14:22:50 +00:00
9d202c67f2 fix(flowpilot): make action bar fixed to viewport bottom
Previous approach tried to fix the flex height chain, but it proved fragile
across grid → main → outlet → page transitions. New approach: action bar is
position:fixed at the bottom of the viewport, offset by sidebar width via
CSS variable --sidebar-w. Conversation area has pb-20 for clearance.

This works regardless of the height chain, email verification banner,
or any other variable-height elements above the session.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 06:00:11 +00:00
09a42a943a fix(flowpilot): use calc(100vh-56px) for session page height — matches tree editor pattern
The flex height chain through grid → main → outlet → page doesn't reliably
constrain height, causing the action bar to overflow below viewport. The tree
editor already solves this with h-[calc(100vh-56px)] (subtracting the topbar).
Apply the same proven pattern to FlowPilotSessionPage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 05:50:49 +00:00
d3211c3d24 fix(layout): add min-h-0 to main-content — prevents grid overflow
Root cause found via DOM inspection: main-content (a CSS grid item) had
default min-height:auto, which prevented the grid from constraining it
below its content height. Content grew to 994px in a 975px viewport,
pushing the FlowPilot action bar (Resolve/Escalate/Pause) 75px below
the visible area. overflow:hidden on the grid clipped it invisibly.

Fix: min-h-0 on main-content allows the grid to shrink it to fit,
completing the height chain all the way down to the action bar.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 05:37:16 +00:00
5fa9c57c17 fix(layout): add flex flex-col to ViewTransitionOutlet — fixes action bar visibility
Root cause: ViewTransitionOutlet wrapping <Outlet> had flex-1 min-h-0 but
display:block (no flex flex-col). Child pages using h-full flex-col couldn't
resolve height against a block parent, so content overflowed and the
FlowPilot action bar (Resolve/Escalate/Pause) rendered below the viewport.

Fix: Add flex flex-col to the outlet wrapper so the full flex height chain
works: app-shell grid → main flex-col → outlet flex-col → page flex-col.

Also removed the h-0 workaround from FlowPilotSessionPage since this
addresses the actual root cause.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 05:29:33 +00:00
0d1d8218b9 fix(flowpilot): render markdown in context messages + fix action bar height chain
Two issues:
1. AI context messages (teal bubble) rendered raw markdown (**bold** etc.)
   instead of parsed markdown — switched from <p> to <MarkdownContent>
2. Action bar still hidden — added h-0 to flex-1 wrapper to force explicit
   height allocation so h-full on FlowPilotSession resolves correctly

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 05:05:53 +00:00
5bd018ed5c fix(flowpilot): fix broken height chain hiding action bar (Resolve/Escalate/Pause)
The FlowPilotSession component uses h-full flex-col to position the action
bar at the bottom, but its parent div in FlowPilotSessionPage only had
flex-1 min-h-0 without flex flex-col. This broke the height chain, causing
the action bar to render below the visible area.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 04:55:33 +00:00
2ed8a2af15 fix: 6 integration audit fixes — ticket filter, admin nav, FK scope, debounce, error messages
- Fix AISession.ticket_id → psa_ticket_id in list_sessions filter query
- Add Gallery nav item (LayoutGrid icon) to AdminSidebar navItems array
- Remove ForeignKey from FileUpload.session_id (Python model) + migration b8d2f4a6c091 to drop DB constraint, allowing column to reference either session type
- Add 400ms debounce on AI session search input in SessionHistoryPage (aiSearchInput state + useRef timeout pattern)
- Show friendly 503 error message in RichTextInput upload error handler (both initial upload and retry paths)
- Add overflow-x-auto to FlowPilotAnalyticsPage tab bar container

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 04:06:41 +00:00
5e009fd752 feat(search): add similar sessions UI in FlowPilot sidebar
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 03:52:19 +00:00
ce68fa84ca feat(search): add PostgreSQL FTS on AI sessions with Command Palette integration
- Migration: add generated tsvector column + GIN index on ai_sessions (problem_summary, resolution_summary, escalation_reason, problem_domain)
- Backend: wire FTS into list_sessions q param; add GET /ai-sessions/search endpoint returning AISessionSearchResult (registered before /{session_id} to avoid UUID routing conflict)
- Frontend: add AISessionSearchResult type, aiSessionsApi.search() method, and Command Palette group "FlowPilot Sessions" using Zap icon navigating to /pilot/:id

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 03:42:01 +00:00
c3afc7a059 feat(search): add structured filters to AI session list endpoint and frontend
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 03:34:54 +00:00
1d5454c31b feat(evidence): add RichTextInput with clipboard paste and wire into FlowPilot
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 03:31:03 +00:00
f87f3d47de feat(evidence): add upload types and API client for frontend
- FileUploadResponse and PendingUpload types in types/upload.ts
- uploadsApi with upload(), getUrl(), list(), remove() methods
- Exported from types/index.ts and api/index.ts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 03:22:57 +00:00
7bbcf0face fix(analytics): 4 UX polish fixes — resolution time column, empty states, type badges, select styling
- CoverageHeatmap: add Avg Resolution column with inverse color thresholds (green <10 min, amber 10–20 min, red >20 min); updated colSpan to 7
- FlowPilotAnalyticsPage: show positive empty state when knowledge gaps list is empty instead of rendering nothing
- FlowQualityTable: add tree_type badge next to flow name (Troubleshooting/Project/Maintenance with distinct colors)
- FlowPilotAnalyticsPage: add [&>option] Tailwind classes to period select for improved dark-theme contrast in Chrome/Firefox

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 01:07:40 +00:00
9a1dba0e5f fix(analytics): fix 8 frontend UX issues — routing, accessibility, error states, sort indicators
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 00:39:44 +00:00
c2ff88a417 feat(analytics): add flow quality table and PSA metrics panel
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 00:21:46 +00:00
647ad0e2d5 feat(analytics): add tabbed layout with coverage heatmap
Add Phase 5 types (CoverageResponse, FlowQualityResponse, EnhancedPsaMetrics)
and API methods. Refactor FlowPilotAnalyticsPage with tab bar (Overview,
Coverage, Flow Quality, PSA) with lazy data loading. Create CoverageHeatmap
component with color-coded resolution/escalation/guided rate cells.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 00:16:09 +00:00
21d6d09c05 feat(enterprise): add multi-PSA adapter stubs for Autotask and Halo PSA
- Create AutotaskProvider stub with all abstract methods raising NotImplementedError
- Create HaloPSAProvider stub with all abstract methods raising NotImplementedError
- Add PSA provider grid in IntegrationsPage showing ConnectWise (active),
  Autotask (Coming Soon), and Halo PSA (Coming Soon) with appropriate badges

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 20:35:39 +00:00
2f56327f81 feat(enterprise): add custom branding system — logo, accent color, company name
- Add branding_logo_url, branding_primary_color, branding_company_name columns to Account model
- Add Alembic migration (58e3f27f3e8f) for branding and SSO columns
- Add GET/PATCH /accounts/me/branding endpoints (owner-only for PATCH)
- Add BrandingSettingsPage with logo URL input, color picker, preview section
- Add /account/branding route (ProtectedRoute owner) in router.tsx
- Add Branding link card in AccountSettingsPage

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