Commit Graph

389 Commits

Author SHA1 Message Date
chihlasm
361ffabe57 fix: attach anchor to document before click for Firefox download compatibility
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 02:39:57 -04:00
chihlasm
8cadc5b1b3 feat: add ScriptGeneratorPanel with permission gating
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 02:37:15 -04:00
chihlasm
2548a81549 fix: replace non-standard Tailwind opacity /12 with rgba in ScriptFilterBar
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 02:35:48 -04:00
chihlasm
4269aea015 fix: loadCategories error handling and invalid Tailwind opacity fractions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 02:34:03 -04:00
chihlasm
69404e0e12 fix: help_text ordering and Input component usage in scripts components
- ScriptParameterField: extract error <p> from select/boolean input blocks and remove error prop from Input/Textarea components so all types render help_text before error via unified bottom rendering
- ScriptFilterBar: replace native <input> with shared <Input> component from @/components/ui/Input, preserving search icon via absolute positioning wrapper

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 02:18:13 -04:00
chihlasm
43bccf9af1 feat: add ScriptFilterBar with category tabs and debounced search
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 02:11:11 -04:00
chihlasm
dd36f335de feat: add ScriptTemplateList with skeleton and empty states
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 02:10:46 -04:00
chihlasm
19fde445fe feat: add TemplateCard component
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 02:10:25 -04:00
chihlasm
20fabe48a5 feat: add ScriptParameterForm with parameter grouping
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 02:09:59 -04:00
chihlasm
cb51940cdb feat: add ScriptParameterField — all 7 field types
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 02:09:35 -04:00
chihlasm
86a9d3b977 feat: add ScriptPreview with live substitution and copy
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 02:09:15 -04:00
chihlasm
a88b9c5483 feat: add PowerShellHighlighter syntax highlighter
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 02:09:01 -04:00
chihlasm
054f3acd67 fix: reset loading flags on error in scriptGeneratorStore
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 02:06:06 -04:00
chihlasm
9d10aa90ad feat: add scriptGeneratorStore Zustand store
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 02:01:02 -04:00
chihlasm
b1c39f52be feat: add scriptsApi client
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 01:56:53 -04:00
chihlasm
9631f6f474 feat: add script generator TypeScript types
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 01:53:26 -04:00
chihlasm
4745f16481 docs: add script generator phase 2 implementation plan
14 tasks covering types, API client, Zustand store, 8 UI components,
page shell, routing, sidebar navigation, and smoke test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 01:51:29 -04:00
chihlasm
8bc28be537 docs: refine Phase 2 script generator spec (rounds 5-8 fixes)
- Fix canGenerate/disabled prop propagation: ScriptParameterForm passes
  disabled={!canGenerate} to ScriptParameterField (was inconsistent)
- Clarify validate() only checks required fields; client-side pattern/
  length/range validation deferred to backend
- Fix generate/download button disabled logic: OR of isGenerating and
  !canGenerate
- Clarify manual vs shared error rendering split for select/boolean
- Add disabled prop to select and checkbox element examples
- Add parameters_schema cast note in ScriptParameterForm description
- Add loadCategories() prerequisite note on loadTemplates()
- Add exactly four asterisks clarification for sensitive param masking
- Document default_values and validation_rules as unused Phase 2 fields

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 01:41:18 -04:00
chihlasm
93fb69d1de docs: final spec fixes — resolve inputValue ownership, spinner mode, clear-search wiring
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 01:30:43 -04:00
chihlasm
9a37caf596 docs: update Phase 2 spec after review loop — fix field names, permissions, search coordination
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 01:26:24 -04:00
chihlasm
e875d73c0b docs: add Script Generator Phase 2 frontend design spec
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 01:05:39 -04:00
chihlasm
7eae167597 feat(scripts): add Script Generator API endpoints and integration tests
Implements REST endpoints for script categories, templates, generation,
and generation history. Includes 12 integration tests covering auth,
CRUD, search/filter, parameter validation, and sensitive field redaction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 00:30:17 -04:00
chihlasm
7a3f3b186c feat(scripts): add migration 057 - script tables + AD User Management seed templates
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 00:26:03 -04:00
chihlasm
f1ed1fabbb feat(scripts): add ScriptTemplateEngine with substitution, filters, and sanitization
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 00:17:14 -04:00
chihlasm
dba0605cec feat(scripts): add Pydantic schemas for Script Generator
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 00:15:17 -04:00
chihlasm
7c9708fa6e feat(scripts): add ScriptCategory, ScriptTemplate, ScriptGeneration models
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 00:14:01 -04:00
chihlasm
83b13fcd26 polish: use 'step' instead of 'node' in procedural editor validation hints
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 23:32:52 -04:00
chihlasm
45fb468db3 feat: add validation summary and Fix with AI to procedural editor
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 23:32:52 -04:00
chihlasm
f9315d2f60 feat: add data-step-id anchor to StepList for validation scroll-to
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 23:32:52 -04:00
chihlasm
b89d0859d4 feat: add validation state and validate() to proceduralEditorStore
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 23:32:52 -04:00
chihlasm
b804c63754 fix: validation summary click-to-select now opens node editor panel
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 23:32:52 -04:00
chihlasm
d989fabd90 Merge feat/kb-accelerator into main 2026-03-12 17:29:07 -04:00
Michael Chihlas
cfe112ac43 docs: add landing page assets and polish landing CSS
Add landing page .docx export, HTML mockup, docx generator script,
and refine landing page CSS formatting/spacing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 17:28:49 -04:00
chihlasm
042a12b190 feat: add landing page with beta signup + raise KB node limit to 100
Landing page at /landing with full marketing content: hero, features,
pricing, testimonials, and beta email signup form. Beta signups email
beta@resolutionflow.com via new public endpoint. Unauthenticated users
redirect to landing instead of login. Also raises KB Accelerator node
limit from 50 to 100 to accommodate dense troubleshooting articles.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 00:23:29 -04:00
chihlasm
92c86cab80 fix: handle object-shaped validation errors in KB commit error toast
The commit endpoint returns {message, validation_errors} when
validation fails, but the error handler was passing the whole object
to toast.error(), crashing React with "Objects are not valid as a
React child".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 23:56:45 -04:00
chihlasm
458c2d9cab fix: prevent circular parent_node_id in KB troubleshooting import
AI-generated trees can have circular next_node_id references (e.g.,
node A → B → A). The parent mapping now checks for cycles before
assigning parent_node_id, preventing FK deadlocks during insert.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 23:46:49 -04:00
chihlasm
efafcff4b2 fix: topological insert for KB import nodes to satisfy parent FK
Nodes with parent_node_id references were inserted in a single batch,
causing FK violations when children were inserted before their parents.
Now inserts roots first, flushes, then children in subsequent passes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 23:41:25 -04:00
chihlasm
03390ed59f feat: enable Markdown (.md) file upload in KB Accelerator
Moved md from Phase 2 extensions to allowed formats, added extraction
handler (reuses txt handler), and updated plan_limits defaults to
include md for all plans.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 23:29:51 -04:00
chihlasm
fe3c651115 fix: remove "Let AI Decide" option from KB Accelerator upload
The uploader should know their content type — auto-detection adds
complexity and currently just defaults to troubleshooting anyway.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 22:56:40 -04:00
Michael Chihlas
963c0da10a docs: update CLAUDE.md with Railway and node field learnings
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 21:19:51 -04:00
Michael Chihlas
9495b09e72 fix: copilot node context — use title/question/description over legacy content field
_build_flow_context() was reading node.get('content') which was only
present on old KB-imported steps. Now falls back through title →
question → description → content → label so all node types (decision,
action, solution, procedural step) show correctly in the copilot context.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 17:55:26 -04:00
Michael Chihlas
53b6878742 fix: KB procedural import — map step content to description field
Steps built by _build_procedural_tree() were stored under the "content"
key but StepDetail.tsx reads "description". Renamed the key so step
text and commands display correctly during session execution.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 12:50:13 -04:00
Michael Chihlas
00e1e701ca fix: procedural KB import — add title field, correct step types, validation gate
- _build_procedural_tree now maps AI node types (step, action, warning) to
  valid procedural types (procedure_step, section_header, procedure_end)
- Generates 'title' field from content text — fixes "Unnamed step" in editor
- Auto-appends procedure_end step if AI didn't generate one
- Adds procedural validation gate at commit endpoint (same as troubleshooting)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 09:12:43 -04:00
Michael Chihlas
c920e825c6 fix: auto-reload on chunk load errors in ErrorBoundary
RouteError already handled stale chunk errors, but the Sentry ErrorBoundary
didn't — so errors from React lazy() imports hit the generic error UI.
Now auto-reloads with loop prevention (10s cooldown via sessionStorage).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 03:17:24 -04:00
Michael Chihlas
a976f16575 fix: session closure popover z-index — bypass stagger-item stacking context
The StaggerList wrapper creates per-item stacking contexts via CSS animation,
causing the absolute-positioned close popover to render behind sibling cards.
Replace StaggerList with inline stagger-item rendering so we can apply z-50
directly to the stagger-item wrapper when its popover is open.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 03:09:17 -04:00
Michael Chihlas
8c73233dd0 fix: KB conversion — increase max_tokens, add JSON repair, improve error handling
- Increase max_tokens from 8192 to 16384 to prevent truncation on long articles
- Add _try_repair_json() that fixes trailing commas and attempts to close
  unclosed brackets/braces from truncated AI responses
- Log full raw response (first 2000 chars) on parse failure for debugging
- Set status to 'failed' with user-friendly error message instead of leaving
  imports stuck in 'processing' state

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 02:57:27 -04:00
Michael Chihlas
8b3033ca9d fix: tree navigation root ID + session closure popover z-index
- TreeNavigationPage: initialize currentNodeId from tree_structure.id
  instead of hardcoded 'root' — fixes "Invalid tree structure" for trees
  with non-'root' root IDs (KB Accelerator, AI Flow Builder)
- SessionHistoryPage: add relative z-10 to session card when close
  popover is open so it renders above sibling cards

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 02:54:00 -04:00
Michael Chihlas
2f23141daf fix: KB tree builder — post-build repair, validation gate, and root ID handling
- Add _repair_tree() post-build pass that fixes structural issues caused by
  placed-set race conditions: demotes decisions with <2 children to actions,
  hoists orphaned children as siblings, converts dead-end actions to solutions
- Add validation gate at commit endpoint — rejects trees that fail validation
  with a 422 and descriptive error messages instead of saving invalid trees
- Update test fixtures to create valid multi-node tree structures
- Frontend: initialize currentNodeId from tree's actual root ID instead of
  hardcoded 'root', fixing "Invalid tree structure" for KB-generated trees

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 02:53:55 -04:00
Michael Chihlas
c1fb2f180c fix: KB tree builder demotes decisions with < 2 branches to actions
Decision nodes with fewer than 2 buildable child targets now get
demoted to action nodes instead of creating invalid tree structures.
Also adds id fields to option objects (required by tree editor).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 02:31:17 -04:00
Michael Chihlas
416bb230e3 feat: close sessions from history page with inline popover
Add ability to close active sessions directly from the Session History
page via an inline popover with outcome selection and optional notes.
Adds two new outcomes: cancelled and resolved_externally.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 01:59:12 -04:00