Commit graph

127 commits

Author SHA1 Message Date
Brad Groux
58bfae2c25 RF-22: Add ESLint with TypeScript and React plugins
- Added ESLint flat config (eslint.config.js)
- Added @typescript-eslint/parser and plugin
- Added eslint-plugin-react and react-hooks
- Fixed ActivityItem naming collision in ActivitySidebar.tsx
- 0 errors, 141 warnings (existing code issues to fix over time)
- Rules: no-explicit-any (warn), no-non-null-assertion (warn), react-hooks/rules-of-hooks (error)
2026-01-28 06:31:53 -06:00
Brad Groux
f598ec186b RF-25: Code cleanup - remove dead code, add hooks barrel export
- Removed dead agent-service.ts (replaced by clawdbot-agent-service.ts)
- Moved AgentOutput type to clawdbot-agent-service.ts
- Added web/src/hooks/index.ts barrel export for cleaner imports
- Noted: useToast is correct shadcn pattern, not a reimplementation
- Noted: UI components are shadcn standard, no docs needed
- Noted: Monorepo scripts already complete
2026-01-28 06:29:20 -06:00
Brad Groux
75cee87a3d fix: browser compatibility for shared api-client
- Add typeof check for process.env to avoid ReferenceError in browser
- process.env only exists in Node.js, not browser environments
- Fixes white screen issue when loading web frontend
2026-01-28 06:22:29 -06:00
Brad Groux
39eccf3556 feat: Sprint US-1200 Refactoring batch — 13 tasks complete
Completed refactors:
- RF-02: Fix dependency vulnerabilities (xlsx → exceljs, Hono updates)
- RF-05: Add React error boundaries (FeatureErrorBoundary wrapper)
- RF-06: Server error handling middleware (AppError classes, asyncHandler)
- RF-10: Split shared types.ts into domain modules (6 files)
- RF-11: Consolidate frontend API layer (hooks now use api.ts)
- RF-13: TaskConfigContext — eliminate prop drilling
- RF-14: Split god components (GitSection, TaskDetailPanel, CreateTaskDialog, DiffViewer)
- RF-16: Frontend accessibility (ARIA labels, sr-only text)
- RF-17: Modularize CLI (899 → commands/ structure)
- RF-18: Modularize MCP (843 → tools/ structure)
- RF-19: Create shared API client library
- RF-21: Server performance (batch loading, memory limits, timeouts, graceful shutdown)
- RF-23: Extract shared utilities (path, format, constants)

Stats: ~59 files changed, significant code reduction through modularization
2026-01-28 06:08:59 -06:00
Brad Groux
01e0e29eb9 docs: Sprint 1150 Settings Hardening documentation update
- Created comprehensive settings-architecture.md covering:
  - Component hierarchy and responsibilities
  - Data flow and state management
  - Security measures (XSS, path traversal, prototype pollution)
  - Accessibility features (WCAG 2.1 AA compliance)
  - Error handling strategy with boundaries
  - Performance optimizations (lazy loading, memoization)
  - Code organization patterns

- Updated CHANGELOG.md with Sprint 1150 entry (v0.9.0)
  - All 8 user stories documented
  - Security, accessibility, and performance highlights

- Updated README.md with Settings & Customization section

Sprint 1150 Code Quality Assessment:
✅ TypeScript: 0 compilation errors
✅ Architecture: Clean component extraction, no circular deps
✅ Security: Strict validation, sanitization, rate limiting
✅ Accessibility: WCAG 2.1 AA compliant
✅ Performance: Lazy loading, memoization, debouncing
✅ Error Handling: Isolated error boundaries per tab
⚠️  Tests: 161 failures in worktree directories (unrelated to Sprint 1150)
2026-01-28 04:24:23 -06:00
Brad Groux
c0b852cc6b feat(settings): Add WCAG 2.1 AA accessibility improvements (US-1156)
- Add aria-live regions to SaveIndicator for screen reader announcements
- Add Move Up/Down buttons to ManagedListManager for keyboard navigation
- Implement focus management: focus first tab on dialog open, focus content on tab switch
- Add comprehensive ARIA labels to all interactive elements (switches, buttons)
- Add aria-hidden to decorative icons
- Improve Switch accessibility with proper labels and aria-label attributes
- Add role=tabpanel and aria-controls for proper tab/tabpanel relationships
- Radix Dialog provides built-in focus trap functionality
2026-01-28 04:08:51 -06:00
Brad Groux
0f43e4e750 feat(settings): Replace alert() calls with toast notifications (US-1158)
- Add duration support to toast system
- Replace all 5 alert() calls in SettingsDialog with toasts
- Success toasts auto-dismiss after 3s
- Error/warning toasts persist until manually dismissed
- Consistent with ManageTab toast patterns
2026-01-28 04:05:05 -06:00
Brad Groux
0025dc5f47 chore: remove build artifacts from template-schema 2026-01-28 03:10:25 -06:00
Brad Groux
fa33c43368 US-1155: Settings performance — memoization & lazy loading 2026-01-28 03:09:02 -06:00
Brad Groux
38252d8860 US-1154: Add test coverage for settings features
- Fixed vitest config to exclude worktree directories
- Fixed existing test directory cleanup issues
- Added settings service tests
- Added template validation tests
- All tests passing
2026-01-28 03:05:52 -06:00
Brad Groux
030b501d2c US-1153: Harden template import validation & security
- Added Zod schema for full template structure validation
- Prototype pollution protection (reject __proto__, constructor, prototype keys)
- Size limits enforced (name 100 chars, description 500, subtasks 50, blueprint 20)
- Blueprint dependency validation (refIds must exist)
- Replaced alert() with toast notifications
2026-01-28 03:00:04 -06:00
Brad Groux
a4a8d1d765 US-1152: Add error boundaries to Settings dialog tabs
- Created SettingsErrorBoundary with friendly fallback + retry
- Each tab wrapped individually — one crash doesn't affect others
- Error details logged with tab context
2026-01-28 02:58:58 -06:00
Brad Groux
7afcb97c3c US-1151: Extract Settings tab components from monolith
- Extracted 7 tab components to components/settings/tabs/
- Extracted 5 shared components to components/settings/shared/
- SettingsDialog.tsx reduced from 1,481 to 279 lines
- Barrel exports via index.ts
- No functional changes
2026-01-28 02:56:39 -06:00
Brad Groux
32ba617731 feat(US-1110): Settings import/export & reset all
- Export Settings button: downloads feature settings as JSON with date filename
- Import Settings: file picker with validation, section-level filtering
- Reset All: double-confirmation dialog to restore defaults
- Per-section reset already available from US-1109
- Import validates top-level sections, warns about unknown keys
- All actions in settings sidebar footer
2026-01-28 02:36:11 -06:00
Brad Groux
fd30fac03f feat(US-1105..1108): Server-side settings sync for telemetry, attachments, agents
- Add syncSettingsToServices() to propagate feature settings to services
- Telemetry service reads enabled/retention/traces from feature settings
- Attachment service reads dynamic limits from task behavior settings
- Sync on startup from config file and on every PATCH /api/settings/features
- Add setLimits() to AttachmentService for runtime limit updates
2026-01-28 02:35:07 -06:00
Brad Groux
4681aad9d7 feat(US-1103, US-1104): Sprint badges on task cards + task behavior settings wiring
- Add sprint badge rendering to TaskCard (indigo/zap icon)
- Wire sprints data: KanbanBoard → KanbanColumn → TaskCard
- Respect boardSettings.showSprintBadges toggle
- Wire task behavior settings in TaskDetailPanel:
  - Dependencies section hidden when enableDependencies=false
  - Time tracking hidden when enableTimeTracking=false
  - Comments hidden when enableComments=false
  - Attachments tab hidden when enableAttachments=false
  - Preview button hidden when enablePreview=false
2026-01-28 02:32:40 -06:00
Brad Groux
55b72a2c75 feat(US-1109): tabbed settings panel redesign
- Vertical sidebar navigation with 7 tabs: General, Board, Tasks, Agents, Data, Notifications, Manage
- Toggle rows with Switch components + descriptive labels
- Number inputs with min/max validation and unit labels
- Auto-save with debounced 500ms updates + save indicator
- Reset to Defaults button per section with confirmation
- Mobile: tabs collapse to dropdown selector
- Keyboard navigation between tabs (arrow keys)
- Existing managed lists (task types, projects, sprints, templates) moved to Manage tab
2026-01-28 02:19:45 -06:00
Brad Groux
f0c72717d3 feat(US-1101, US-1102): settings infrastructure + feature toggle hooks
- Added FeatureSettings types (Board, Tasks, Agents, Telemetry, Notifications, Archive)
- AppConfig.features field with backward-compatible defaults
- ConfigService auto-merges defaults for missing keys on load
- Deep merge utility for partial config updates
- GET/PATCH /api/settings/features endpoints
- useFeatureSettings, useFeatureSetting, useUpdateFeatureSettings hooks
- Debounced update helper for rapid toggle changes
- Optimistic updates with rollback on error
2026-01-28 02:16:23 -06:00
Brad Groux
0c12bacbf2 docs: Sprint 12-14 planning — LAN access, status indicator, metrics refactoring
Sprint US-1200 (6 stories): LAN access — Vite/Express binding, CORS,
  firewall, auto-detect URL, responsive audit
Sprint US-1300 (6 stories): Working indicator — status API, animated
  component, real-time hook, Veritas integration, history, header layout
Sprint US-1400 (7 stories): Metrics refactoring — telemetry ingestion,
  reporter, service refactor, task metrics, dashboard refresh, run badges,
  cost tracking

All three feature requests investigated, documented, tasks created with
subtasks, sprint docs written.
2026-01-28 02:06:58 -06:00
Brad Groux
785d60cbcd feat: real-time board updates via WebSocket broadcast + polling
- Add broadcast-service.ts that sends task:changed events to all
  connected WebSocket clients on any task mutation
- Wire broadcasts into task routes (create, update, delete, archive,
  restore, reorder)
- Add useTaskSync hook — connects to WS, listens for task:changed,
  invalidates React Query cache for instant board updates
- Add polling fallback: refetchInterval=10s, staleTime=5s on useTasks
- Auto-reconnect WebSocket with 3s backoff on disconnect

Board now updates within seconds of any external change (API calls
from Clawdbot agents, CLI, etc.) without manual page refresh.

Fixes: task_20260128_Zk4oV0
2026-01-28 01:20:56 -06:00
Brad Groux
f7f1487b12 feat: archived task read-only view, restore, and pagination
- Add readOnly prop to TaskDetailPanel — shows archived badge,
  displays all fields as non-editable text, hides delete/template buttons,
  shows 'Restore to Board' button instead
- Wire up task click in ArchiveSidebar to open read-only detail panel
- Add pagination to archive list (25 per page with 'Load More' button)
- Show results count when filters reduce the list
- ArchiveSidebar now manages its own detail panel internally

Fixes: task_20260128_tDh8SO
2026-01-28 01:15:40 -06:00
Brad Groux
ce5eda58b1 feat: add drag-and-drop task reordering within columns
- Add position field to Task type (shared/types.ts)
- Add POST /api/tasks/reorder endpoint to persist ordering
- Update task-service with reorderTasks() method
- Switch TaskCard from useDraggable to useSortable (@dnd-kit/sortable)
- Wrap KanbanColumn tasks in SortableContext with verticalListSortingStrategy
- Update KanbanBoard DnD handlers to support both within-column reorder
  and cross-column status changes
- Sort tasks by position in useTasksByStatus hook
- Use closestCorners collision detection for better sortable support

Fixes: task_20260128_4qCzGr
2026-01-28 01:08:21 -06:00
Brad Groux
8f8f4a9031 fix: stopTimer YAML crash — strip undefined values from timeTracking
- stopTimer() set activeEntryId: undefined which js-yaml cannot serialize
- Changed to omit activeEntryId when clearing (conditional spread)
- Same fix in deleteTimeEntry() for active entry deletion
- Added deepCleanUndefined() to taskToMarkdown() as defense-in-depth
- Imported TimeTracking type for explicit typing

Fixes: task_20260128_RrQUWH
2026-01-28 01:00:56 -06:00
Brad Groux
4a1b92b46c fix: remove duplicate ProjectConfig import in SettingsDialog 2026-01-28 00:37:38 -06:00
Brad Groux
2b5d07c1f1 Convert hardcoded sprints to managed list
- Added SprintConfig interface extending ManagedListItem in shared types
- Created SprintService with seed migration from existing tasks
- Added /api/sprints endpoints using managed list router pattern
- Implemented useSprints and useSprintsManager hooks
- Updated TaskDetailPanel and CreateTaskDialog to use dynamic sprint list
- Added sprint management UI to SettingsDialog
- Sprint IDs match existing task.sprint values for backward compatibility
- Reference counter prevents deletion of sprints with tasks
2026-01-28 00:29:16 -06:00
Brad Groux
a8ec6f1406 milestone: Sprint US-900 complete — all 20 stories archived
Sprint 9 (US-900): 20 stories delivered
- US-901–US-910: Enhanced task template system
- US-911–US-916: Entity management (comments, attachments, types, projects, tags→removed)
- US-917: Sprint assignment field
- US-918: Subtask progress on Kanban cards
- US-919: Task type display on Kanban cards
- US-920: Auto-archive by sprint
- Fixed US-800 archived tasks project assignment (Sprint 8 → veritas-kanban)
2026-01-28 00:07:16 -06:00
Brad Groux
027bc22eb3 feat(US-920): Auto-archive by sprint instead of project
- Server: getArchiveSuggestions groups by sprint instead of project
- Server: archiveSprint replaces archiveProject
- Server: bulk-archive endpoint takes sprint instead of project
- Server: added 'sprint_archived' activity type
- Frontend: ArchiveSuggestionBanner shows sprint completion banners
- Frontend: SprintArchiveSuggestion replaces ProjectArchiveSuggestion
- Frontend: API layer + hooks updated (archiveSprint, bulkArchive)
- Removed dead ProjectArchiveSuggestion.tsx
2026-01-27 23:59:42 -06:00
Brad Groux
b353ec1b53 fix: add US-100 sprint to sprint picker 2026-01-27 23:47:28 -06:00
Brad Groux
4406aa8efd chore: assign sprints to all tasks (active + archived)
- US-700 series (archive): US-701 through US-711
- US-800 series (archive): US-801 through US-808
- US-900 series (active): US-901 through US-919
- Created US-917 (sprint assignment), US-918 (subtask count), US-919 (task type on cards)
- All three marked done with closing comments
- Fixed path traversal in attachment filename sanitization
2026-01-27 23:38:39 -06:00
Brad Groux
331fd966a8 refactor: remove tags feature entirely, fix TS errors and path traversal sanitization
- Removed tag-service, TagPicker, useTags hook, tags routes, tags.json
- Stripped tag references from TaskCard, TaskDetailPanel, CreateTaskDialog,
  ApplyTemplateDialog, SettingsDialog, ArchiveSidebar, KanbanBoard/Column
- Removed tags from shared Task type and template types
- Fixed ManagedListManager prop types (Promise<void> → Promise<any>)
- Fixed unused imports in FilterBar, CreateTaskDialog, TaskDetailPanel
- Fixed unused generic param in UseManagedListOptions
- Fixed path traversal in attachment filename sanitization (collapse ..)
- All tests passing (62/62), full build clean
2026-01-27 23:33:15 -06:00
Brad Groux
e21dc2ec77 fix: black screen on task click + updated color palette
- Fixed Radix Select crash: empty string value ('') not supported
  Changed 'No project' SelectItem from value='' to value='__none__'
  in both TaskDetailPanel and CreateTaskDialog
- Updated task type colors: removed Rose, added bright Pink (fuchsia),
  darkened Blue (700), darkened Green (700), added Yellow, added Brown
2026-01-27 22:49:44 -06:00
Brad Groux
e6ac8cfe6a fix: remove hide/show feature, allow deleting any managed list item
- Removed isDefault protection from delete (any item can be deleted)
- Removed hide/show toggle button from ManagedListManager
- Delete still blocked if item has task references (with clear message)
- Cleaned up isHidden flags from task-types.json
- Simplified delete dialog messaging
2026-01-27 22:35:06 -06:00
Brad Groux
d28cf29598 fix: infinite recursion in project/tag service init, ID mismatch in seed migration
- ProjectService.init() had infinite recursion: list() → init() → seed → list() → init()...
- TagService seed checked file existence (always true after super.init creates it)
- Seed migrations now use seedItem() with raw project/tag strings as IDs
  so they match existing task.project and task.tags values
- Added seedItem() to ManagedListService base for custom-ID seeding
- Cleaned up task-types.json (removed duplicate, restored Research)
2026-01-27 22:30:53 -06:00
Brad Groux
93345980d6 fix(US-916): Use useTags hook for items in SettingsDialog
The useTagsManager hook only provides CRUD operations, not items. Need to call useTags() separately to get the items list.
2026-01-27 22:20:44 -06:00
Brad Groux
77910fdf06 fix: US-916 tag integration + US-911 review feedback
- Wire tags through KanbanBoard → KanbanColumn → TaskCard
- Render colored tag badges on cards (first 2 + overflow count)
- Tags settings section in SettingsDialog
2026-01-27 22:19:35 -06:00
Brad Groux
fc087bba50 feat: US-914 Project management with dropdown selection 2026-01-27 22:16:41 -06:00
Brad Groux
157630cb8b feat: US-915 ManagedListService + US-913 Custom task types
PHASE 1: US-915 ManagedListService Foundation
- Added ManagedListItem and ManagedListServiceOptions types to shared/src/types.ts
- Created ManagedListService<T> base class with full CRUD, reorder, and reference checking
- Created createManagedListRouter factory for generic Express routes
- Created useManagedList hook for React with TanStack Query integration
- Added managedList API helpers to web/src/lib/api.ts
- Created ManagedListManager React component with drag-to-reorder using @dnd-kit

PHASE 2: US-913 Custom Task Types
- Changed TaskType from union to string in shared types
- Added TaskTypeConfig interface extending ManagedListItem with icon and color
- Created TaskTypeService using ManagedListService with 4 built-in default types
- Registered task-types routes at /api/task-types
- Updated server validation in tasks.ts and templates.ts to accept dynamic types
- Created useTaskTypes hook with helper functions (getTypeIcon, getTypeLabel, etc.)
- Updated FilterBar to use dynamic task types
- Updated TaskCard to accept and use dynamic task types
- Updated KanbanBoard and KanbanColumn to fetch and pass task types
- Updated TaskDetailPanel to use dynamic task types
- Updated CreateTaskDialog to use dynamic task types
- Updated SettingsDialog template form to use dynamic task types
- Added Task Types management section to Settings with full CRUD and customization
- Added taskTypes API namespace to web/src/lib/api.ts

All UI components now render task types dynamically from .veritas-kanban/task-types.json
Icon and color customization available in Settings with 20+ Lucide icons and 10 colors
2026-01-27 22:09:21 -06:00
Brad Groux
76f71d2e0d feat(US-912): Implement task attachments with text extraction pipeline
Backend:
- Add Attachment types, limits config, and MIME type allowlist to shared types
- Create AttachmentService for file storage, upload/delete, archive lifecycle
- Create TextExtractionService supporting PDF, DOCX, XLSX, HTML, JSON, plain text
- Add attachment routes with multer upload middleware
- Add /api/tasks/:id/context endpoint for agent consumption
- Update task-service to handle attachments in frontmatter and lifecycle
- Install dependencies: multer, unpdf, mammoth, xlsx, mime-types

Frontend:
- Build AttachmentsSection component with drag-drop upload zone
- Add inline image thumbnails and expandable text previews
- Implement token cost warning banner (amber alert when ≥2 attachments)
- Add Attachments tab to TaskDetailPanel
- Add paperclip badge with count to TaskCard
- Create React hooks: useUploadAttachment, useDeleteAttachment, useTaskContext

Tests:
- Comprehensive test suites for attachment-service and text-extraction-service
- Cover upload, delete, archive, extraction for all file types

All 13 subtasks completed. Project compiles cleanly.
2026-01-27 21:49:00 -06:00
Brad Groux
f1c01eae72 feat(US-911): add task comments system for agent activity logs 2026-01-27 21:05:16 -06:00
Brad Groux
9f65175768 fix: match ApplyTemplateDialog help formatting to Template Guide style 2026-01-27 20:57:10 -06:00
Brad Groux
019d2613f5 feat: add help context to ApplyTemplateDialog with usage guide 2026-01-27 20:54:26 -06:00
Brad Groux
b243728f08 feat(US-910): Help context windows + keyboard shortcut fix 2026-01-27 20:50:26 -06:00
Brad Groux
f87fe0f8af feat(US-907): Apply template to existing task 2026-01-27 20:41:20 -06:00
Brad Groux
a81dfecadf docs: expand Sprint 10 with agent comparison, failure alerts, daily digest, budget tracking, velocity 2026-01-27 20:34:42 -06:00
Brad Groux
9c883d0f10 docs: Update sprint-9 status to Complete (8/9 stories)
US-907 (Apply template to existing task) deferred - requires significant TaskDetailPanel changes. All other stories completed successfully.
2026-01-27 20:33:48 -06:00
Brad Groux
a8d8457331 feat(US-907): Apply template to existing task (TODO)
Deferred: Requires significant TaskDetailPanel changes

Implementation plan:
- Add 'Apply Template' button in TaskDetailPanel header
- Create ApplyTemplateDialog component
- Merge strategy: only fill empty fields (non-destructive)
- Option to force-overwrite with confirmation
- Subtasks appended (not replaced)
- Activity log records template application

Technical requirements:
- New API endpoint or client-side merge logic
- Template application with variable interpolation
- Conflict resolution UI for non-empty fields
- Undo/revert capability
2026-01-27 20:33:05 -06:00
Brad Groux
d1fbd39dcb feat(US-909): Enhanced template UI (integrated)
Enhanced template UI features implemented across previous stories:
- Category tabs in CreateTaskDialog template picker (US-904)
- Template cards with category badges and icons (US-904)
- Variable input form with custom variable prompts (US-903)
- Blueprint preview showing task list and dependencies (US-905)
- Responsive template selector with filtering

Future enhancements for dedicated editor:
- Full-page template editor (currently inline in Settings)
- Drag-and-drop subtask builder
- Visual blueprint dependency wiring
- Template preview panel
2026-01-27 20:32:50 -06:00
Brad Groux
42effb04ba feat(US-908): Template import/export
- Export all templates as JSON file
- Import templates from JSON file with duplicate detection
- template-io utility for file handling and validation
- Import/Export buttons in SettingsDialog templates section
- Duplicates skipped during import with notification
2026-01-27 20:32:24 -06:00
Brad Groux
f4bb9ef22a docs: add Sprint 10 plan - Metrics & Observability Expansion 2026-01-27 20:31:22 -06:00
Brad Groux
219cf1a5bc feat(US-906): Agent & dependency defaults
- Add agent field to template editor (preferred agent for code tasks)
- Agent selector in AddTemplateForm with all available agents
- Agent displayed in template list alongside other defaults
- Templates can specify preferred agent (claude-code, amp, copilot, gemini, veritas)
2026-01-27 20:30:08 -06:00