Commit graph

118 commits

Author SHA1 Message Date
Brad Groux
8be5ff6c3e 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
479e63ae5a 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
9e647e85f2 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
8b12a0cec5 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
5d4710f9e0 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
b09fd98794 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
3cfcb98018 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
2d613bf38b 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
6a1dae251b 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
ec88222953 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
Brad Groux
f99c3efde8 feat(US-905): Multi-task blueprints
- Blueprint templates create multiple linked tasks with dependencies
- CreateTaskDialog shows blueprint preview with task list
- Dependencies resolved via refId mapping (blockedByRefs -> actual task IDs)
- All blueprint tasks created sequentially, dependencies auto-wired
- Added blockedBy support to CreateTaskInput
- Blueprint UI shows task count, dependencies, and subtask count
2026-01-27 20:29:14 -06:00
Brad Groux
58427d6c66 feat(US-904): Template categories
- Add template-categories utility with built-in categories (bug, feature, sprint, content, research, automation, custom)
- Category selector in template creation form
- Category badges displayed in template list
- Category filter tabs in CreateTaskDialog template selector
- Templates without category default to 'custom'
2026-01-27 20:27:06 -06:00
Brad Groux
453f771794 feat(US-903): Variable interpolation
- Add template-variables utility with support for {{date}}, {{datetime}}, {{project}}, {{author}}, {{custom:label}}
- Extract custom variables from templates and prompt user for values
- Interpolate variables in description and subtask titles on task creation
- Display custom variable input form in CreateTaskDialog
- Variables resolved at creation time for dynamic content
2026-01-27 20:24:37 -06:00
Brad Groux
a452b6a279 feat(US-902): Subtask templates
- Add subtasks field to CreateTaskInput
- Task service creates subtasks from template when task is created
- CreateTaskDialog displays subtasks from template
- Users can remove individual subtasks before creating
- Subtasks sorted by order field and auto-generated with IDs
2026-01-27 20:22:58 -06:00
Brad Groux
8a731e27d8 feat(US-901): Enhanced template schema
- Extend TaskTemplate with version, category, tags, agent, subtaskTemplates, and blueprint fields
- Add SubtaskTemplate and BlueprintTask interfaces
- Implement v0 to v1 migration in template service (backward compatible)
- Export template types from shared package
- Server validates enhanced schema on create/update
2026-01-27 20:21:16 -06:00
Brad Groux
99fe5ab385 feat(task_20260128_nYPgZw): Enhanced Task Templates - Sprint 9 planning complete 2026-01-27 20:17:15 -06:00
Brad Groux
6c3925ef53 docs: add Sprint 9 plan - Enhanced Task Templates 2026-01-27 20:16:43 -06:00
Brad Groux
e675406164 Add Sprint 8 docs + telemetry data 2026-01-26 15:50:23 -06:00
Brad Groux
01b692ccb5 Merge feature/us-808-optional-traces: Optional Traces 2026-01-26 12:36:08 -06:00