feat: frictionless incident capture #13

Merged
pyr0ball merged 11 commits from feat/frictionless-capture into main 2026-05-11 09:53:25 -07:00
Owner

Summary

  • NL time extraction: dateparser parses time phrases from freeform queries (e.g. "disk errors around 3pm"), building a ±30-min window; falls back to last-60-min when no phrase is detected
  • Diagnose service: app/services/diagnose.pyparse_time_window() + diagnose() merging FTS keyword hits with plain-SQL window scan, deduplicated and capped at 200 results
  • New API endpoints: POST /api/diagnose (freeform capture), GET /api/settings, PATCH /api/settings (entry point style persistence via preferences.json)
  • QuickCapture tab: one-field input → live results → save flow; URL-driven (/diagnose?q=...&tab=quick)
  • Structured tab: IncidentForm extracted from IncidentsView into DiagnoseView's second tab; IncidentsView is now list-only
  • QuickCaptureBar: persistent topbar entry point that navigates to the diagnose view with the query pre-filled
  • QuickCaptureFab: fixed FAB () with Teleport overlay, auto-focus, Esc/backdrop close
  • SettingsView (/settings): toggle between topbar and FAB entry point styles, persisted via the settings API
  • App.vue wiring: fetches settings on mount, renders bar or FAB conditionally, adds gear icon nav link

Test Plan

  • conda run -n cf pytest tests/ -v — 64 tests pass
  • Start API (uvicorn app.rest:app) and Vue dev server; navigate to /diagnose
  • Type a query with a time phrase (e.g. "high memory usage around 2pm") — confirm ±30-min window in results header
  • Type a query with no time phrase — confirm 60-min fallback window shown
  • Switch tabs: Quick → Structured; confirm IncidentForm renders and submission redirects to incidents list
  • Settings page: toggle FAB, confirm bar disappears and FAB appears; toggle back
  • QuickCaptureFab: open overlay, type query, submit; confirm navigation to /diagnose?q=...&tab=quick
  • QuickCaptureBar: same flow via topbar input
  • Save a quick-captured incident ("Save" button); confirm it appears in /incidents
  • Save with details ("Save with details" link); confirm pre-populated form in Structured tab
## Summary - **NL time extraction**: `dateparser` parses time phrases from freeform queries (e.g. "disk errors around 3pm"), building a ±30-min window; falls back to last-60-min when no phrase is detected - **Diagnose service**: `app/services/diagnose.py` — `parse_time_window()` + `diagnose()` merging FTS keyword hits with plain-SQL window scan, deduplicated and capped at 200 results - **New API endpoints**: `POST /api/diagnose` (freeform capture), `GET /api/settings`, `PATCH /api/settings` (entry point style persistence via `preferences.json`) - **QuickCapture tab**: one-field input → live results → save flow; URL-driven (`/diagnose?q=...&tab=quick`) - **Structured tab**: IncidentForm extracted from IncidentsView into DiagnoseView's second tab; IncidentsView is now list-only - **QuickCaptureBar**: persistent topbar entry point that navigates to the diagnose view with the query pre-filled - **QuickCaptureFab**: fixed FAB (⚡) with Teleport overlay, auto-focus, Esc/backdrop close - **SettingsView** (`/settings`): toggle between topbar and FAB entry point styles, persisted via the settings API - **App.vue wiring**: fetches settings on mount, renders bar or FAB conditionally, adds gear icon nav link ## Test Plan - [ ] `conda run -n cf pytest tests/ -v` — 64 tests pass - [ ] Start API (`uvicorn app.rest:app`) and Vue dev server; navigate to `/diagnose` - [ ] Type a query with a time phrase (e.g. "high memory usage around 2pm") — confirm ±30-min window in results header - [ ] Type a query with no time phrase — confirm 60-min fallback window shown - [ ] Switch tabs: Quick → Structured; confirm IncidentForm renders and submission redirects to incidents list - [ ] Settings page: toggle FAB, confirm bar disappears and FAB appears; toggle back - [ ] QuickCaptureFab: open overlay, type query, submit; confirm navigation to `/diagnose?q=...&tab=quick` - [ ] QuickCaptureBar: same flow via topbar input - [ ] Save a quick-captured incident ("Save" button); confirm it appears in `/incidents` - [ ] Save with details ("Save with details" link); confirm pre-populated form in Structured tab
pyr0ball added 11 commits 2026-05-11 09:49:10 -07:00
pyr0ball merged commit fc5029c24e into main 2026-05-11 09:53:25 -07:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Circuit-Forge/turnstone#13
No description provided.