Commit Graph

184 Commits

Author SHA1 Message Date
Michael Chihlas
ef829f06a4 Major UI overhaul plans; Other random docs 2026-02-15 00:43:41 -05:00
Michael Chihlas
1b86f66954 feat: add --api-url flag to procedural flows seed script
Allows running against remote environments like Railway.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 23:48:55 -05:00
Michael Chihlas
771889ab4f feat: add reusable PasswordInput with show/hide toggle
Replaces all type="password" inputs site-wide with a PasswordInput
component that includes an eye icon toggle for visibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 23:22:19 -05:00
Michael Chihlas
e7d6f992c6 docs: update CLAUDE.md and CURRENT-STATE.md with latest features
Reflects session sharing, procedural editor UX improvements,
type-aware routing, and updated in-progress/next items.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 23:11:28 -05:00
chihlasm
57f429f33b feat: session sharing frontend (#76)
* feat: add session sharing types, API client, and utilities

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add SessionTimeline and ActionMenu reusable components

SessionTimeline extracts timeline/checklist rendering from SessionDetailPage
into a reusable component for both authenticated and public session views.
ActionMenu provides a dropdown action menu with keyboard/click-outside dismiss.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add ShareSessionModal and integrate into SessionDetailPage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add Share Progress popover to TreeNavigationPage

Replace the single "Copy for Ticket" button with a "Share Progress"
popover that offers three actions: Copy Progress Summary (existing PSA
export flow), Copy Share Link (auto-creates account-only share if
needed), and Manage Share Links (opens ShareSessionModal).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add public SharedSessionPage with tree preview

Add the public-facing shared session page at /share/:shareToken that
renders shared sessions without authentication. Includes error handling
for 401 (redirect to login), 403 (access denied), 404 (not found),
and 410 (expired). The page features a minimal header, session metadata,
SessionTimeline component, and a new SharedSessionTreePreview component
that renders the decision tree structure with the path taken highlighted.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add My Shares management page with nav link

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: address code review issues in session sharing

- Add useCallback for loadShares in ShareSessionModal (React hook deps)
- Use TreeStructure type instead of Record<string, unknown> for type safety
- Fix login redirect format to match LoginPage's expected state shape

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test: add focused tests for session sharing utilities and API

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: resolve tree_structure type compatibility for shared session views

- Use TreeStructure & Record<string, unknown> intersection for JSONB flexibility
- Add explicit cast in SharedSessionTreePreview for recursive node rendering

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: add session sharing learnings to CLAUDE.md

Add gotchas #12 (TreeStructure vs Tree types) and #13 (login redirect
state format), note about npm run build strictness, and public route
pattern to Common Tasks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: procedural editor UX improvements

Add URL intake field type, fix variable name editing collapsing fields
(index-based keys/updates), auto-generate variable names by field type,
add section header as first-class step type, and simplify step editor
with "More Options" collapsible for advanced fields.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: allow section_header step type in validation, improve tag input

- Add 'section_header' to VALID_STEP_TYPES in backend validation so
  procedural flows with section headers can be published
- Replace procedural editor's inline tag input with TagInput component
  (supports autocomplete, Tab, comma, semicolon, and paste splitting)
- Add semicolon delimiter support to TagInput component

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: add type-aware routing for procedural flows

Centralizes tree navigation routing via getTreeNavigatePath helper.
Fixes all pages to route procedural sessions to /flows/:id/navigate
instead of /trees/:id/navigate. Adds safety redirect in troubleshooting
navigator and resume support in procedural navigator.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: remove unused index prop from IntakeFieldEditor

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 23:08:17 -05:00
chihlasm
6b4304ab92 fix: resolve eslint immutability error in StepChecklist
Pre-compute section header visibility before render instead of mutating
a variable during .map() callback, which violates react-hooks/immutability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 04:43:13 -05:00
chihlasm
350c977eda feat: add procedural flows with intake forms, navigation, and seed templates
Adds a new "procedural" tree type for linear step-by-step project workflows
(domain controller setup, M365 onboarding, VPN config, etc). Includes intake
form builder, two-panel step navigation, variable resolution, procedural
exports, 3 seed templates, and UI rename from "Trees" to "Flows".

Also archives 19 implemented plan docs and creates deferred features backlog.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 04:13:52 -05:00
chihlasm
303570ca2c feat: add sensitive data redaction to export (Phase C)
Server-side regex redaction masks IPs, emails, bearer/API tokens, and
UNC paths in exported session content. Redaction runs post-generation
and post-variable-resolution with fail-closed error handling. Frontend
gets a "Mask Sensitive Data" toggle in the export preview modal with
a summary of what was redacted. 24 unit tests passing, frontend build clean.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 00:11:20 -05:00
Michael Chihlas
1172c5394f docs: save Phase C redaction planning state
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 20:49:58 -05:00
chihlasm
938420a679 Merge pull request #75 from patherly/feat/export-phase-a
feat: export improvements — Phase A + Phase B
2026-02-13 18:30:31 -05:00
Michael Chihlas
f1577758f9 test: add Phase B tests for custom markers, detail levels, and summary block
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:12:52 -05:00
Michael Chihlas
11e426eeb1 feat(frontend): add detail level dropdown and summary toggle to export controls
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:01:41 -05:00
Michael Chihlas
808c8d49d1 feat(frontend): convert ExportPreviewModal to editable textarea with reset
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 12:59:44 -05:00
Michael Chihlas
0a67a846de feat: add summary block generation to all 4 export generators
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 12:57:55 -05:00
Michael Chihlas
c8f9cc1c4b feat: add format-aware command output truncation for standard detail level
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 12:56:16 -05:00
Michael Chihlas
28c969f06e feat: add [CUSTOM] markers to custom steps in all 4 export generators
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 12:54:45 -05:00
Michael Chihlas
f19e534ff4 feat(frontend): add include_summary and detail_level to SessionExport type
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 12:53:52 -05:00
Michael Chihlas
ea0f79fac0 feat: add include_summary and detail_level to SessionExport schema
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 12:53:19 -05:00
Michael Chihlas
c5adab1685 docs: update Phase B plan — fix test refs, placeholders, truncation formats
Addresses review feedback:
- Fix test file references (test_psa_export.py, not test_export.py)
- Use _make_session helper instead of nonexistent fixtures
- Format-aware truncation markers (markdown/html/text/psa)
- No placeholder leak: empty fields stay blank, not [Edit in preview]
- Markdown table escaping for pipe/newline chars
- Summary toggle error handling with checkbox revert
- Phase A prerequisite called out explicitly
- Document edit-reset behavior on summary toggle

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 12:22:41 -05:00
Michael Chihlas
4e9d269b53 docs: add Phase B export improvements implementation plan
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 11:39:21 -05:00
Michael Chihlas
bce741bb0c docs: Phase B export improvements design
Covers B1 (summary block), B2 (custom step markers), B3 (detail levels),
B4 (editable preview). No migration needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 11:36:01 -05:00
Michael Chihlas
f8a14d8b4c fix: skip RESOLUTION section in PSA export for incomplete sessions
Mid-session "Copy for Ticket" no longer shows a misleading Resolution
section that echoed the last step's answer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 10:50:55 -05:00
Michael Chihlas
1869da4fcb feat(frontend): add mid-session Copy for Ticket to navigation page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 09:39:38 -05:00
Michael Chihlas
441ff2ae40 feat(frontend): add step cutoff control to export options
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 09:39:20 -05:00
Michael Chihlas
7dab7d7782 feat(frontend): add next_steps to types, completion modal, and detail page
- Add next_steps to Session, SessionUpdate, SessionComplete, SessionExport types
- Add Next Steps textarea to SessionOutcomeModal
- Update TreeNavigationPage consumer callback for next_steps
- Display next_steps with whitespace-pre-wrap on SessionDetailPage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 09:38:04 -05:00
Michael Chihlas
8797ae0261 feat: add step cutoff and mid-session export support
- max_step_index slices decisions in all 4 export formats
- Only set exported=True when session is completed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 08:58:03 -05:00
Michael Chihlas
69c95065b6 feat: add Resolution and Next Steps sections to all export formats
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 08:54:50 -05:00
Michael Chihlas
ae701ef066 feat: save next_steps on session completion and update
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 08:42:19 -05:00
Michael Chihlas
ec5c91c8e4 feat: add next_steps column and update session schemas
- Add next_steps TEXT column to sessions table via migration 034
- Add include_outcome_notes, include_next_steps, max_step_index to SessionExport
- Add next_steps to SessionUpdate, SessionResponse, SessionComplete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 08:32:20 -05:00
chihlasm
2fc4e69c38 feat: UX improvements — copy buttons, shortcuts modal, breadcrumb rewind, create tree CTA
- Add copy-to-clipboard buttons on command blocks (action + custom step nodes)
- Add keyboard shortcuts modal (?) with option loading spinners and [Esc] hint
- Restyle session timer as a pill badge for better visibility
- Add prominent "Create Tree" CTA to MyTreesPage header and empty state
- Make breadcrumb items clickable to rewind navigation to any previous step

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 02:19:24 -05:00
chihlasm
ad59446332 feat: user management — admin create, password reset, archive/delete, quick invite
Phase 1: must_change_password enforcement + change password endpoint/page
Phase 2: Admin user creation (M365-style) with temp password
Phase 3: Password reset (self-service forgot + admin-triggered)
Phase 4: User archive (soft delete) + hard delete with precheck
Phase 5: Quick invite from admin Users page

Also fixes:
- Auto-create subscription for accounts missing one
- Hard delete precheck ignores sole-member personal accounts
- Seed script patches tree nodes for validation compliance

Migrations: 031 (must_change_password), 032 (password_reset_tokens), 033 (user soft delete)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 01:42:51 -05:00
Michael Chihlas
b8f25f19eb Add M365 and additional networking seed trees 2026-02-12 16:13:18 -05:00
chihlasm
77d6621e75 Merge pull request #74 from patherly/feat/command-output-capture
feat: command output capture for troubleshooting sessions
2026-02-12 01:04:15 -05:00
chihlasm
577a2fbf2a feat: add command output capture to troubleshooting sessions (#57)
Engineers can now paste command output during action steps. Output is
stored in the session decisions JSONB, displayed in session review,
included in all 4 export formats with command context, and preserved
in session-to-tree conversions.

- Collapsible "Paste Output" textarea on action nodes with commands
- 10,000 character limit with live character count
- Works on both built-in and custom action steps
- Preloads output when revisiting a step via Go Back
- All exports show commands run alongside captured output

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 00:57:33 -05:00
chihlasm
9dbb8b8406 Merge pull request #73 from patherly/feat/admin-invite-user-management
feat: admin invite codes with plan assignment + user detail page
2026-02-11 23:52:18 -05:00
chihlasm
3c47292eaf feat: add resend capability for platform and account invite codes
Revoke-and-recreate flow for both invite systems with email delivery
via Resend API. Includes account invite email template and audit logging.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 23:45:23 -05:00
Michael Chihlas
a1f5127e98 docs: update CLAUDE.md with invite API path and deps signature
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 21:52:13 -05:00
Michael Chihlas
50cb0fc7f0 feat: admin invite codes with plan assignment + user detail page
- Migration 030: add email, assigned_plan, trial_duration_days, email_sent_at
  to invite_codes with CHECK constraints
- Resend email integration (graceful degradation when API key not set)
- Invite codes now support plan assignment (free/pro/team) and trial duration (1-90 days)
- Registration applies invite code plan/trial to new subscription
- Auto-downgrade expired trials on authenticated access
- Enriched GET /admin/users/{id} with account, subscription, sessions, audit logs
- New endpoints: PUT /admin/users/{id}/subscription/plan and extend-trial
- Frontend: enhanced invite codes page with email, plan, trial fields
- Frontend: new user detail page at /admin/users/:userId
- Fixed API path drift: /invite-codes -> /invites
- 11 new backend tests, 416 total passing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 21:42:58 -05:00
Michael Chihlas
a466400c5b fix(frontend): resolve session outcome modal ts build error 2026-02-11 19:25:37 -05:00
Michael Chihlas
06c66f5595 fix(frontend): resolve set-state-in-effect lint errors 2026-02-11 19:09:29 -05:00
Michael Chihlas
ca4ce7cad6 Implement session outcomes, step timing, and live timer fixes 2026-02-11 17:52:12 -05:00
Michael Chihlas
2a1ed4d250 docs: update CLAUDE.md with session quick wins (#51-#55)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 19:44:10 -05:00
chihlasm
402cdea063 feat: session quick wins (#51-#55) (#72)
* feat: add session quick wins (#51-#55)

- Session timer showing elapsed time in header (#51)
- Tab keyboard shortcut to focus notes textarea (#52)
- Repeat Last Session button on tree library page (#53)
- Auto-recovery banner for incomplete sessions (#54)
- Copy individual step to clipboard on session detail (#55)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: add missing delete button to table and list tree views

The onDeleteTree prop was accepted but never used in TreeTableView and
TreeListView. Now both views show a trash icon (permission-gated) matching
the existing grid view behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 19:40:45 -05:00
Michael Chihlas
84fa554a7a chore: add workspace file, update gitignore, and sync package deps
Add monaco-editor to frontend deps, gitignore temp files (test_results.txt,
stats.html, .agents/), and add VS Code workspace config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:57:41 -05:00
Michael Chihlas
0e0e3572f4 refactor: replace barrel imports with direct module imports for tree-shaking
Replace all `from '@/api'` barrel imports with direct imports from
specific module files (e.g. `from '@/api/trees'`) across 20 files.
This enables better tree-shaking so each page only bundles the API
modules it actually uses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:52:14 -05:00
Michael Chihlas
d155c83ef0 fix: split category fetch, safe localStorage, aria-labels on icon buttons
- TreeLibraryPage: split categories into a mount-only fetch so filter
  changes only re-fetch trees (not categories every time)
- Add safeGetItem/safeSetItem/safeRemoveItem helpers in utils.ts to
  prevent crashes in private browsing or when storage is unavailable
- Replace raw localStorage calls in ScratchpadSidebar, TreeNavigationPage,
  TreeEditorPage, and treeEditorStore with safe wrappers
- Add aria-label to 20 icon-only buttons across 8 component files
  for screen reader accessibility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:41:46 -05:00
Michael Chihlas
0c9fbdc90b fix: replace N+1 API calls in MyTreesPage with 2 parallel requests
The page was making 1 API call per tree to fetch session stats, but the
backend sessions endpoint doesn't support tree_id filtering — so every
call returned identical data. Now fetches trees and sessions in parallel
(2 calls total), builds a lastUsed map client-side, and uses the existing
usage_count field from the tree list response for session counts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 17:53:42 -05:00
Michael Chihlas
e5e5922097 refactor: clean up dead files, restructure nav, align QuickStartPage to monochrome
- Delete 6 unused files: ThemeToggle, themeStore, AppLayout-original,
  QuickStartPage-Enhanced, UpgradePrompt, SettingsPage
- Restructure Account/Settings navigation: merge Settings into Account page,
  make AccountSettingsPage the /account index, remove orphaned /account-settings route
- Remove "Settings" nav item (consolidated under Account)
- Add export preferences and team categories link to AccountSettingsPage
- Align QuickStartPage to monochrome design system: replace cyan/blue/violet
  accent colors with white opacity variants
- Replace non-functional search button with search spinner indicator

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 17:46:35 -05:00
Michael Chihlas
89d343d49a chore: archive 11 completed plan documents
Move completed design/implementation docs from docs/plans/ to docs/archive/
to keep the plans folder focused on active and future work.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 10:51:21 -05:00
chihlasm
01ecba13a2 chore: clean up untracked files and gitignore .claude/ directory
- Add make_superadmin utility scripts (list users, promote to super admin)
- Gitignore entire .claude/ directory (agents, settings, plans)
- Delete leftover tailwind-config-snippet.js and dual-mode plan doc

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 10:00:52 -05:00