@taskforcehq/taskforce 0.3.168
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +241 -0
- package/dist/Taskforce.d.ts +3 -0
- package/dist/Taskforce.js +3 -0
- package/dist/Taskforce.module.css +7587 -0
- package/dist/TaskforceCore.CategoryFallback.test.d.ts +1 -0
- package/dist/TaskforceCore.CategoryFallback.test.js +98 -0
- package/dist/TaskforceCore.d.ts +12 -0
- package/dist/TaskforceCore.js +729 -0
- package/dist/TaskforceCore.test.d.ts +1 -0
- package/dist/TaskforceCore.test.js +2132 -0
- package/dist/TaskforceScreenshot.d.ts +11 -0
- package/dist/TaskforceScreenshot.js +113 -0
- package/dist/TaskforceWidget.d.ts +6 -0
- package/dist/TaskforceWidget.js +101 -0
- package/dist/TaskforceWidget.test.d.ts +1 -0
- package/dist/TaskforceWidget.test.js +92 -0
- package/dist/UnsavedChangesRelaxed.test.d.ts +1 -0
- package/dist/UnsavedChangesRelaxed.test.js +16 -0
- package/dist/__tests__/localizationCatalogs.test.d.ts +1 -0
- package/dist/__tests__/localizationCatalogs.test.js +37 -0
- package/dist/__tests__/planParser.test.d.ts +1 -0
- package/dist/__tests__/planParser.test.js +183 -0
- package/dist/__tests__/releaseVersion.test.d.ts +1 -0
- package/dist/__tests__/releaseVersion.test.js +32 -0
- package/dist/__tests__/structuredCommentValidation.test.d.ts +1 -0
- package/dist/__tests__/structuredCommentValidation.test.js +31 -0
- package/dist/__tests__/structuredDocValidation.test.d.ts +1 -0
- package/dist/__tests__/structuredDocValidation.test.js +30 -0
- package/dist/__tests__/templateEngine.test.d.ts +1 -0
- package/dist/__tests__/templateEngine.test.js +150 -0
- package/dist/__tests__/templates.test.d.ts +1 -0
- package/dist/__tests__/templates.test.js +45 -0
- package/dist/__tests__/workflowDocumentFixtures.test.d.ts +1 -0
- package/dist/__tests__/workflowDocumentFixtures.test.js +78 -0
- package/dist/__tests__/workflowExportMatrix.test.d.ts +1 -0
- package/dist/__tests__/workflowExportMatrix.test.js +113 -0
- package/dist/__tests__/workflowExportSnapshots.test.d.ts +1 -0
- package/dist/__tests__/workflowExportSnapshots.test.js +28 -0
- package/dist/__tests__/workflowGeneration.test.d.ts +1 -0
- package/dist/__tests__/workflowGeneration.test.js +12 -0
- package/dist/__tests__/workflowSimulation.test.d.ts +1 -0
- package/dist/__tests__/workflowSimulation.test.js +113 -0
- package/dist/__tests__/workflowV2Policy.test.d.ts +1 -0
- package/dist/__tests__/workflowV2Policy.test.js +80 -0
- package/dist/api.d.ts +30 -0
- package/dist/api.js +85 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +217 -0
- package/dist/compat/priorityCompat.d.ts +2 -0
- package/dist/compat/priorityCompat.js +24 -0
- package/dist/components/features/DocumentGenerateModal.d.ts +9 -0
- package/dist/components/features/DocumentGenerateModal.js +114 -0
- package/dist/components/features/DocumentIndex.d.ts +19 -0
- package/dist/components/features/DocumentIndex.js +51 -0
- package/dist/components/features/DocumentViewer.d.ts +9 -0
- package/dist/components/features/DocumentViewer.js +253 -0
- package/dist/components/features/DocumentWorkspace.d.ts +21 -0
- package/dist/components/features/DocumentWorkspace.js +88 -0
- package/dist/components/features/TaskSettings.d.ts +209 -0
- package/dist/components/features/TaskSettings.js +500 -0
- package/dist/components/features/TaskSettings.test.d.ts +1 -0
- package/dist/components/features/TaskSettings.test.js +308 -0
- package/dist/components/features/settings/CategoryManager.d.ts +19 -0
- package/dist/components/features/settings/CategoryManager.js +113 -0
- package/dist/components/features/settings/TaxonomyEditor.d.ts +8 -0
- package/dist/components/features/settings/TaxonomyEditor.js +98 -0
- package/dist/components/features/settings/TaxonomyManager 2.d.ts +52 -0
- package/dist/components/features/settings/TaxonomyManager 2.js +75 -0
- package/dist/components/features/settings/TaxonomyManager.d.ts +54 -0
- package/dist/components/features/settings/TaxonomyManager.js +77 -0
- package/dist/components/features/settings/TypeManager.d.ts +10 -0
- package/dist/components/features/settings/TypeManager.js +50 -0
- package/dist/components/features/settings/WorkflowEditorPrototype.d.ts +15 -0
- package/dist/components/features/settings/WorkflowEditorPrototype.js +245 -0
- package/dist/components/task/TaskActionHeader.d.ts +20 -0
- package/dist/components/task/TaskActionHeader.js +13 -0
- package/dist/components/task/TaskCard.d.ts +47 -0
- package/dist/components/task/TaskCard.js +326 -0
- package/dist/components/task/TaskCard.test.d.ts +1 -0
- package/dist/components/task/TaskCard.test.js +95 -0
- package/dist/components/task/TaskContextUpload.d.ts +12 -0
- package/dist/components/task/TaskContextUpload.js +393 -0
- package/dist/components/task/TaskContextUpload.test.d.ts +1 -0
- package/dist/components/task/TaskContextUpload.test.js +189 -0
- package/dist/components/task/TaskForm.d.ts +105 -0
- package/dist/components/task/TaskForm.js +241 -0
- package/dist/components/task/TaskForm.test.d.ts +1 -0
- package/dist/components/task/TaskForm.test.js +288 -0
- package/dist/components/task/TaskKanban 2.d.ts +76 -0
- package/dist/components/task/TaskKanban 2.js +1004 -0
- package/dist/components/task/TaskKanban.d.ts +76 -0
- package/dist/components/task/TaskKanban.empty-column-drop.test.d.ts +1 -0
- package/dist/components/task/TaskKanban.empty-column-drop.test.js +66 -0
- package/dist/components/task/TaskKanban.js +1026 -0
- package/dist/components/task/TaskKanban.test.d.ts +1 -0
- package/dist/components/task/TaskKanban.test.js +46 -0
- package/dist/components/task/TaskList.d.ts +74 -0
- package/dist/components/task/TaskList.js +38 -0
- package/dist/components/task/TaskList.test.d.ts +1 -0
- package/dist/components/task/TaskList.test.js +270 -0
- package/dist/components/task/TaskScreenshotSection.d.ts +15 -0
- package/dist/components/task/TaskScreenshotSection.js +22 -0
- package/dist/components/ui/LevelSelector.d.ts +13 -0
- package/dist/components/ui/LevelSelector.js +25 -0
- package/dist/components/ui/LevelSelector.test.d.ts +1 -0
- package/dist/components/ui/LevelSelector.test.js +55 -0
- package/dist/components/ui/Markdown.d.ts +6 -0
- package/dist/components/ui/Markdown.js +94 -0
- package/dist/components/ui/Markdown.test.d.ts +1 -0
- package/dist/components/ui/Markdown.test.js +38 -0
- package/dist/components/ui/Modal.d.ts +16 -0
- package/dist/components/ui/Modal.js +49 -0
- package/dist/components/ui/MultiSelectFilter.d.ts +10 -0
- package/dist/components/ui/MultiSelectFilter.js +71 -0
- package/dist/components/ui/MultiSelectFilter.test.d.ts +1 -0
- package/dist/components/ui/MultiSelectFilter.test.js +74 -0
- package/dist/components/ui/TaxonomyDropdown.d.ts +17 -0
- package/dist/components/ui/TaxonomyDropdown.js +145 -0
- package/dist/components/ui/TaxonomyDropdown.test.d.ts +1 -0
- package/dist/components/ui/TaxonomyDropdown.test.js +130 -0
- package/dist/components/views/StandaloneLayout 2.d.ts +8 -0
- package/dist/components/views/StandaloneLayout 2.js +1660 -0
- package/dist/components/views/StandaloneLayout.d.ts +8 -0
- package/dist/components/views/StandaloneLayout.js +2117 -0
- package/dist/components/views/WidgetView.d.ts +8 -0
- package/dist/components/views/WidgetView.js +221 -0
- package/dist/config/envSchema.d.ts +28 -0
- package/dist/config/envSchema.js +374 -0
- package/dist/config/envSchema.test.d.ts +1 -0
- package/dist/config/envSchema.test.js +97 -0
- package/dist/config/surfaceBase.d.ts +2 -0
- package/dist/config/surfaceBase.js +8 -0
- package/dist/core/BulkUpdateFieldsPreview.test.d.ts +1 -0
- package/dist/core/BulkUpdateFieldsPreview.test.js +62 -0
- package/dist/core/CompletedAt.test.d.ts +1 -0
- package/dist/core/CompletedAt.test.js +44 -0
- package/dist/core/CreatedBy.test.d.ts +1 -0
- package/dist/core/CreatedBy.test.js +60 -0
- package/dist/core/EntitlementsPolicy.test.d.ts +1 -0
- package/dist/core/EntitlementsPolicy.test.js +145 -0
- package/dist/core/InitiativeTemplates.test.d.ts +1 -0
- package/dist/core/InitiativeTemplates.test.js +50 -0
- package/dist/core/ParentLifecycle.test.d.ts +1 -0
- package/dist/core/ParentLifecycle.test.js +98 -0
- package/dist/core/ScheduleFields.test.d.ts +1 -0
- package/dist/core/ScheduleFields.test.js +197 -0
- package/dist/core/SetupState.test.d.ts +1 -0
- package/dist/core/SetupState.test.js +113 -0
- package/dist/core/SystemAdmin.test.d.ts +1 -0
- package/dist/core/SystemAdmin.test.js +295 -0
- package/dist/core/TaskTaxonomyValidation.test.d.ts +1 -0
- package/dist/core/TaskTaxonomyValidation.test.js +64 -0
- package/dist/core/Taskforce.d.ts +1063 -0
- package/dist/core/Taskforce.ids.test.d.ts +1 -0
- package/dist/core/Taskforce.ids.test.js +168 -0
- package/dist/core/Taskforce.js +5981 -0
- package/dist/core/Taskforce.realtimeMutation.test.d.ts +1 -0
- package/dist/core/Taskforce.realtimeMutation.test.js +76 -0
- package/dist/core/WorkspaceDelete.test.d.ts +1 -0
- package/dist/core/WorkspaceDelete.test.js +140 -0
- package/dist/core/WorkspacePermissions.test.d.ts +1 -0
- package/dist/core/WorkspacePermissions.test.js +151 -0
- package/dist/core/WorkspacePlanMode.test.d.ts +1 -0
- package/dist/core/WorkspacePlanMode.test.js +104 -0
- package/dist/hooks/authGuardPolicy.d.ts +26 -0
- package/dist/hooks/authGuardPolicy.js +32 -0
- package/dist/hooks/authGuardPolicy.test.d.ts +1 -0
- package/dist/hooks/authGuardPolicy.test.js +76 -0
- package/dist/hooks/useDraggable.d.ts +12 -0
- package/dist/hooks/useDraggable.js +65 -0
- package/dist/hooks/useRealtimeSync.d.ts +24 -0
- package/dist/hooks/useRealtimeSync.js +275 -0
- package/dist/hooks/useRealtimeSync.test.d.ts +1 -0
- package/dist/hooks/useRealtimeSync.test.js +284 -0
- package/dist/hooks/useSyncOrchestrator.d.ts +164 -0
- package/dist/hooks/useSyncOrchestrator.js +1427 -0
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.d.ts +1 -0
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.js +367 -0
- package/dist/hooks/useTaskforce.d.ts +727 -0
- package/dist/hooks/useTaskforce.js +4396 -0
- package/dist/hooks/useTaskforce.priority-filters.test.d.ts +1 -0
- package/dist/hooks/useTaskforce.priority-filters.test.js +33 -0
- package/dist/hooks/useWorkspaceSyncController.d.ts +80 -0
- package/dist/hooks/useWorkspaceSyncController.js +598 -0
- package/dist/hooks/useWorkspaceSyncController.test.d.ts +1 -0
- package/dist/hooks/useWorkspaceSyncController.test.js +236 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +11 -0
- package/dist/localization/index.d.ts +8 -0
- package/dist/localization/index.js +81 -0
- package/dist/localization/locales/en-US.d.ts +151 -0
- package/dist/localization/locales/en-US.js +150 -0
- package/dist/localization/locales/es-419.d.ts +2 -0
- package/dist/localization/locales/es-419.js +150 -0
- package/dist/localization/locales/pt-BR.d.ts +2 -0
- package/dist/localization/locales/pt-BR.js +150 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +33 -0
- package/dist/mcp/optionResolution.d.ts +14 -0
- package/dist/mcp/optionResolution.js +126 -0
- package/dist/mcp/optionResolution.test.d.ts +1 -0
- package/dist/mcp/optionResolution.test.js +39 -0
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +1793 -0
- package/dist/mcp/structuredCommentValidation.d.ts +6 -0
- package/dist/mcp/structuredCommentValidation.js +56 -0
- package/dist/mcp/structuredDocValidation.d.ts +6 -0
- package/dist/mcp/structuredDocValidation.js +75 -0
- package/dist/migrations/billingSchemaParity.test.d.ts +1 -0
- package/dist/migrations/billingSchemaParity.test.js +46 -0
- package/dist/migrations/clientMigrations.d.ts +9 -0
- package/dist/migrations/clientMigrations.js +74 -0
- package/dist/migrations/flags.d.ts +6 -0
- package/dist/migrations/flags.js +8 -0
- package/dist/migrations/taskMigrations.d.ts +71 -0
- package/dist/migrations/taskMigrations.js +236 -0
- package/dist/migrations/taskMigrations.test.d.ts +1 -0
- package/dist/migrations/taskMigrations.test.js +34 -0
- package/dist/migrations/taskSchemaMigrations.d.ts +11 -0
- package/dist/migrations/taskSchemaMigrations.js +453 -0
- package/dist/plugins/index.d.ts +10 -0
- package/dist/plugins/index.js +10 -0
- package/dist/plugins/vite.d.ts +19 -0
- package/dist/plugins/vite.js +271 -0
- package/dist/public/android-chrome-192x192.png +0 -0
- package/dist/public/android-chrome-512x512.png +0 -0
- package/dist/public/apple-touch-icon.png +0 -0
- package/dist/public/favicon-16x16.png +0 -0
- package/dist/public/favicon-32x32.png +0 -0
- package/dist/public/favicon.ico +0 -0
- package/dist/public/favicon.png +0 -0
- package/dist/public/site.webmanifest +1 -0
- package/dist/public/taskforce.png +0 -0
- package/dist/resources/templates/WORKFLOW_V2_POLICY.md +55 -0
- package/dist/resources/templates/environments/aider.yaml +14 -0
- package/dist/resources/templates/environments/antigravity.yaml +10 -0
- package/dist/resources/templates/environments/claude.yaml +10 -0
- package/dist/resources/templates/environments/cline.yaml +10 -0
- package/dist/resources/templates/environments/codex.yaml +13 -0
- package/dist/resources/templates/environments/copilot.yaml +10 -0
- package/dist/resources/templates/environments/cursor.yaml +9 -0
- package/dist/resources/templates/environments/gemini.yaml +9 -0
- package/dist/resources/templates/environments/windsurf.yaml +10 -0
- package/dist/resources/templates/workflow-sources/README.md +9 -0
- package/dist/resources/templates/workflow-sources/workflowDocs.mjs +520 -0
- package/dist/resources/templates/workflow-sources/workflowEditorOverrides.json +1 -0
- package/dist/resources/templates/workflows/collaborate.yaml +104 -0
- package/dist/resources/templates/workflows/do.yaml +82 -0
- package/dist/resources/templates/workflows/evaluate.yaml +111 -0
- package/dist/resources/templates/workflows/execute.yaml +142 -0
- package/dist/resources/templates/workflows/plan.yaml +112 -0
- package/dist/resources/templates/workflows/review.yaml +109 -0
- package/dist/runtime/capabilities.d.ts +8 -0
- package/dist/runtime/capabilities.js +16 -0
- package/dist/security/virusScan.d.ts +16 -0
- package/dist/security/virusScan.js +83 -0
- package/dist/server/auth.d.ts +51 -0
- package/dist/server/auth.js +266 -0
- package/dist/server/auth.test.d.ts +1 -0
- package/dist/server/auth.test.js +111 -0
- package/dist/server/buildInfo.d.ts +7 -0
- package/dist/server/buildInfo.js +100 -0
- package/dist/server/buildInfo.test.d.ts +1 -0
- package/dist/server/buildInfo.test.js +29 -0
- package/dist/server/cors.d.ts +7 -0
- package/dist/server/cors.js +76 -0
- package/dist/server/cors.test.d.ts +1 -0
- package/dist/server/cors.test.js +71 -0
- package/dist/server/email.d.ts +28 -0
- package/dist/server/email.js +138 -0
- package/dist/server/email.test.d.ts +1 -0
- package/dist/server/email.test.js +113 -0
- package/dist/server/index.cookieProxy.test.d.ts +1 -0
- package/dist/server/index.cookieProxy.test.js +19 -0
- package/dist/server/index.d.ts +17 -0
- package/dist/server/index.js +757 -0
- package/dist/server/index.rateLimit.test.d.ts +1 -0
- package/dist/server/index.rateLimit.test.js +13 -0
- package/dist/server/index.test.d.ts +1 -0
- package/dist/server/index.test.js +19 -0
- package/dist/server/rateLimit.d.ts +29 -0
- package/dist/server/rateLimit.js +99 -0
- package/dist/server/rateLimit.test.d.ts +1 -0
- package/dist/server/rateLimit.test.js +107 -0
- package/dist/server/realtimeSync.auth.test.d.ts +1 -0
- package/dist/server/realtimeSync.auth.test.js +62 -0
- package/dist/server/realtimeSync.replay.test.d.ts +1 -0
- package/dist/server/realtimeSync.replay.test.js +192 -0
- package/dist/server/realtimeSync.workspaceIsolation.test.d.ts +1 -0
- package/dist/server/realtimeSync.workspaceIsolation.test.js +101 -0
- package/dist/server/realtimeSyncWs.d.ts +30 -0
- package/dist/server/realtimeSyncWs.js +257 -0
- package/dist/server/routes.billing.d.ts +15 -0
- package/dist/server/routes.billing.js +991 -0
- package/dist/server/routes.billing.test.d.ts +1 -0
- package/dist/server/routes.billing.test.js +387 -0
- package/dist/server/routes.d.ts +72 -0
- package/dist/server/routes.js +4820 -0
- package/dist/server/routes.sync.d.ts +17 -0
- package/dist/server/routes.sync.integration.test.d.ts +1 -0
- package/dist/server/routes.sync.integration.test.js +470 -0
- package/dist/server/routes.sync.js +1141 -0
- package/dist/server/routes.test.d.ts +1 -0
- package/dist/server/routes.test.js +4945 -0
- package/dist/server/runtimeMode.d.ts +4 -0
- package/dist/server/runtimeMode.js +25 -0
- package/dist/server/runtimeMode.test.d.ts +1 -0
- package/dist/server/runtimeMode.test.js +26 -0
- package/dist/server/securityHeaders.d.ts +3 -0
- package/dist/server/securityHeaders.js +25 -0
- package/dist/server/securityHeaders.test.d.ts +1 -0
- package/dist/server/securityHeaders.test.js +32 -0
- package/dist/server/smtpTransport.d.ts +21 -0
- package/dist/server/smtpTransport.js +11 -0
- package/dist/server/start.d.ts +1 -0
- package/dist/server/start.js +17 -0
- package/dist/services/formatTransformers.d.ts +29 -0
- package/dist/services/formatTransformers.js +56 -0
- package/dist/services/templateEngine.d.ts +46 -0
- package/dist/services/templateEngine.js +148 -0
- package/dist/shared/runtimeContract.d.ts +12 -0
- package/dist/shared/runtimeContract.js +23 -0
- package/dist/shared/runtimeContract.test.d.ts +1 -0
- package/dist/shared/runtimeContract.test.js +23 -0
- package/dist/soak/preflight.cli.d.ts +1 -0
- package/dist/soak/preflight.cli.js +28 -0
- package/dist/soak/preflight.d.ts +26 -0
- package/dist/soak/preflight.js +113 -0
- package/dist/soak/preflight.test.d.ts +1 -0
- package/dist/soak/preflight.test.js +39 -0
- package/dist/soak/syncSoakHarness.d.ts +6 -0
- package/dist/soak/syncSoakHarness.js +10 -0
- package/dist/storage/createDatabaseAdapter.d.ts +2 -0
- package/dist/storage/createDatabaseAdapter.js +9 -0
- package/dist/storage/databaseAdapter.d.ts +22 -0
- package/dist/storage/databaseAdapter.js +1 -0
- package/dist/storage/documentIntegrity.d.ts +28 -0
- package/dist/storage/documentIntegrity.js +103 -0
- package/dist/storage/documentPurge.d.ts +14 -0
- package/dist/storage/documentPurge.js +46 -0
- package/dist/storage/documentRegistry.d.ts +39 -0
- package/dist/storage/documentRegistry.js +115 -0
- package/dist/storage/integritySchedule.d.ts +17 -0
- package/dist/storage/integritySchedule.js +62 -0
- package/dist/storage/objectStorage.d.ts +20 -0
- package/dist/storage/objectStorage.js +15 -0
- package/dist/storage/objectStorageClient.d.ts +18 -0
- package/dist/storage/objectStorageClient.js +301 -0
- package/dist/storage/objectStorageConfig.d.ts +2 -0
- package/dist/storage/objectStorageConfig.js +45 -0
- package/dist/storage/postgresAdapter.d.ts +20 -0
- package/dist/storage/postgresAdapter.js +204 -0
- package/dist/storage/postgresWorker.d.ts +1 -0
- package/dist/storage/postgresWorker.js +110 -0
- package/dist/storage/providerConfig.d.ts +6 -0
- package/dist/storage/providerConfig.js +11 -0
- package/dist/storage/sqliteAdapter.d.ts +14 -0
- package/dist/storage/sqliteAdapter.js +28 -0
- package/dist/storage/taskAssetStore.d.ts +56 -0
- package/dist/storage/taskAssetStore.js +297 -0
- package/dist/sync/cloudSyncApi.d.ts +47 -0
- package/dist/sync/cloudSyncApi.js +138 -0
- package/dist/sync/cloudSyncApi.test.d.ts +1 -0
- package/dist/sync/cloudSyncApi.test.js +54 -0
- package/dist/sync/encryptionService.d.ts +11 -0
- package/dist/sync/encryptionService.js +61 -0
- package/dist/sync/encryptionService.test.d.ts +1 -0
- package/dist/sync/encryptionService.test.js +52 -0
- package/dist/sync/realtimeFeature.d.ts +6 -0
- package/dist/sync/realtimeFeature.js +20 -0
- package/dist/sync/realtimeFeature.test.d.ts +1 -0
- package/dist/sync/realtimeFeature.test.js +30 -0
- package/dist/sync/realtimeReconcile.d.ts +30 -0
- package/dist/sync/realtimeReconcile.js +90 -0
- package/dist/sync/realtimeReconcile.test.d.ts +1 -0
- package/dist/sync/realtimeReconcile.test.js +43 -0
- package/dist/sync/syncService.d.ts +96 -0
- package/dist/sync/syncService.js +423 -0
- package/dist/sync/syncService.test.d.ts +1 -0
- package/dist/sync/syncService.test.js +484 -0
- package/dist/sync/workspaceSyncModel.d.ts +61 -0
- package/dist/sync/workspaceSyncModel.js +136 -0
- package/dist/sync/workspaceSyncModel.test.d.ts +1 -0
- package/dist/sync/workspaceSyncModel.test.js +73 -0
- package/dist/test/setup.d.ts +1 -0
- package/dist/test/setup.js +15 -0
- package/dist/types.d.ts +157 -0
- package/dist/types.js +41 -0
- package/dist/ui/assets/RussoOne-Regular-C3BxZIj7.ttf +0 -0
- package/dist/ui/assets/index-0W5vyCpn.css +1 -0
- package/dist/ui/assets/index-MCZuNNfn.js +23 -0
- package/dist/ui/assets/logo_white_01-0Vx-iIIv.png +0 -0
- package/dist/ui/assets/taskforce-BxLPokNB.png +0 -0
- package/dist/ui/assets/vendor-dnd-BI1K77C1.js +5 -0
- package/dist/ui/assets/vendor-icons-ZFG3SGwo.js +1 -0
- package/dist/ui/assets/vendor-markdown-CKYkQHfj.js +29 -0
- package/dist/ui/assets/vendor-react-DdIDsh7f.js +9 -0
- package/dist/ui/assets/vendor-router-BtiNU7Dl.js +3 -0
- package/dist/ui/branding/logos/logo_black_01.png +0 -0
- package/dist/ui/branding/logos/logo_black_02.png +0 -0
- package/dist/ui/branding/logos/logo_white_01.png +0 -0
- package/dist/ui/branding/logos/logo_white_02.png +0 -0
- package/dist/ui/favicon/android-chrome-192x192.png +0 -0
- package/dist/ui/favicon/android-chrome-512x512.png +0 -0
- package/dist/ui/favicon/apple-touch-icon.png +0 -0
- package/dist/ui/favicon/favicon-16x16.png +0 -0
- package/dist/ui/favicon/favicon-32x32.png +0 -0
- package/dist/ui/favicon/favicon.ico +0 -0
- package/dist/ui/favicon/favicon.png +0 -0
- package/dist/ui/favicon/site.webmanifest +1 -0
- package/dist/ui/fonts/RussoOne-Regular.ttf +0 -0
- package/dist/ui/images/taskforce.png +0 -0
- package/dist/ui/index.html +19 -0
- package/dist/utils/checklistMarkdown.d.ts +9 -0
- package/dist/utils/checklistMarkdown.js +46 -0
- package/dist/utils/constants.d.ts +21 -0
- package/dist/utils/constants.icons.test.d.ts +1 -0
- package/dist/utils/constants.icons.test.js +40 -0
- package/dist/utils/constants.js +100 -0
- package/dist/utils/contextFiles.d.ts +8 -0
- package/dist/utils/contextFiles.js +54 -0
- package/dist/utils/formatting.d.ts +5 -0
- package/dist/utils/formatting.js +30 -0
- package/dist/utils/planParser.d.ts +22 -0
- package/dist/utils/planParser.js +151 -0
- package/dist/utils/taskDragZones.d.ts +8 -0
- package/dist/utils/taskDragZones.js +14 -0
- package/dist/utils/taskDragZones.test.d.ts +1 -0
- package/dist/utils/taskDragZones.test.js +14 -0
- package/dist/utils/taskHierarchy.d.ts +4 -0
- package/dist/utils/taskHierarchy.js +69 -0
- package/dist/utils/taskHierarchy.test.d.ts +1 -0
- package/dist/utils/taskHierarchy.test.js +38 -0
- package/dist/utils/taskParenting.d.ts +3 -0
- package/dist/utils/taskParenting.js +24 -0
- package/dist/utils/taskParenting.test.d.ts +1 -0
- package/dist/utils/taskParenting.test.js +21 -0
- package/dist/utils/taskRelations.d.ts +6 -0
- package/dist/utils/taskRelations.js +24 -0
- package/dist/utils/taskRelations.test.d.ts +1 -0
- package/dist/utils/taskRelations.test.js +34 -0
- package/dist/utils/taskUtils.d.ts +2 -0
- package/dist/utils/taskUtils.js +20 -0
- package/dist/utils/taskforceApiClient.d.ts +7 -0
- package/dist/utils/taskforceApiClient.js +42 -0
- package/dist/utils/workspaceIdentity.d.ts +8 -0
- package/dist/utils/workspaceIdentity.js +47 -0
- package/dist/utils/workspaceIdentity.test.d.ts +1 -0
- package/dist/utils/workspaceIdentity.test.js +32 -0
- package/dist/utils/workspaceLifecycle.d.ts +26 -0
- package/dist/utils/workspaceLifecycle.js +69 -0
- package/dist/utils/workspaceLifecycle.test.d.ts +1 -0
- package/dist/utils/workspaceLifecycle.test.js +64 -0
- package/package.json +133 -0
- package/scripts/check-compat-boundaries.js +48 -0
- package/scripts/check-env.ts +24 -0
- package/scripts/check-localization-strings.mjs +49 -0
- package/scripts/check-runtime-boundaries.mjs +44 -0
- package/scripts/debug-global.mjs +34 -0
- package/scripts/debug-server.mjs +36 -0
- package/scripts/export-sqlite-to-postgres.mjs +125 -0
- package/scripts/generate-env-example.ts +8 -0
- package/scripts/generate-workflow-templates.mjs +134 -0
- package/scripts/mcp-stdio-adapter.mjs +160 -0
- package/scripts/postinstall.js +60 -0
- package/scripts/release-version-lib.mjs +88 -0
- package/scripts/release-version.mjs +72 -0
- package/scripts/run-dev-proxy.sh +49 -0
- package/scripts/run-e2e-realtime.sh +16 -0
- package/scripts/run-smoke.sh +23 -0
- package/scripts/run-soak.sh +29 -0
- package/scripts/test-global.js +143 -0
- package/scripts/update-homebrew-formula.sh +38 -0
- package/src/resources/templates/WORKFLOW_V2_POLICY.md +55 -0
- package/src/resources/templates/environments/aider.yaml +14 -0
- package/src/resources/templates/environments/antigravity.yaml +10 -0
- package/src/resources/templates/environments/claude.yaml +10 -0
- package/src/resources/templates/environments/cline.yaml +10 -0
- package/src/resources/templates/environments/codex.yaml +13 -0
- package/src/resources/templates/environments/copilot.yaml +10 -0
- package/src/resources/templates/environments/cursor.yaml +9 -0
- package/src/resources/templates/environments/gemini.yaml +9 -0
- package/src/resources/templates/environments/windsurf.yaml +10 -0
- package/src/resources/templates/workflow-sources/README.md +9 -0
- package/src/resources/templates/workflow-sources/workflowDocs.mjs +520 -0
- package/src/resources/templates/workflow-sources/workflowEditorOverrides.json +1 -0
- package/src/resources/templates/workflows/collaborate.yaml +104 -0
- package/src/resources/templates/workflows/do.yaml +82 -0
- package/src/resources/templates/workflows/evaluate.yaml +111 -0
- package/src/resources/templates/workflows/execute.yaml +142 -0
- package/src/resources/templates/workflows/plan.yaml +112 -0
- package/src/resources/templates/workflows/review.yaml +109 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import { TaskKanban } from './TaskKanban';
|
|
5
|
+
const toDateOnlyLocal = (date) => {
|
|
6
|
+
const y = date.getFullYear();
|
|
7
|
+
const m = String(date.getMonth() + 1).padStart(2, '0');
|
|
8
|
+
const d = String(date.getDate()).padStart(2, '0');
|
|
9
|
+
return `${y}-${m}-${d}`;
|
|
10
|
+
};
|
|
11
|
+
const dateOffset = (days) => {
|
|
12
|
+
const date = new Date();
|
|
13
|
+
date.setDate(date.getDate() + days);
|
|
14
|
+
return toDateOnlyLocal(date);
|
|
15
|
+
};
|
|
16
|
+
const makeTask = (overrides = {}) => ({
|
|
17
|
+
id: 'task-expired-dual-column',
|
|
18
|
+
title: 'Expired dual visibility task',
|
|
19
|
+
description: null,
|
|
20
|
+
category: 'default',
|
|
21
|
+
type: 'feature',
|
|
22
|
+
priority: 2,
|
|
23
|
+
status: 'task',
|
|
24
|
+
createdAt: '2026-01-01T00:00:00.000Z',
|
|
25
|
+
...overrides
|
|
26
|
+
});
|
|
27
|
+
describe('TaskKanban schedule expired behavior', () => {
|
|
28
|
+
it('shows expired scheduled tasks in both day and expired columns even when not in scheduleFilteredTaskIds', () => {
|
|
29
|
+
const mon = dateOffset(-1);
|
|
30
|
+
const tue = dateOffset(1);
|
|
31
|
+
const wed = dateOffset(2);
|
|
32
|
+
const thu = dateOffset(3);
|
|
33
|
+
const fri = dateOffset(4);
|
|
34
|
+
const sat = dateOffset(5);
|
|
35
|
+
const sun = dateOffset(6);
|
|
36
|
+
const task = makeTask({ scheduledDate: mon });
|
|
37
|
+
render(_jsx(TaskKanban, { tasks: [task], allTasks: [task], columns: [
|
|
38
|
+
{ value: 'backlog', label: 'Backlog', color: '#64748b', icon: 'Inbox' },
|
|
39
|
+
{ value: 'expired', label: 'Expired', color: '#ef4444', icon: 'AlertTriangle' },
|
|
40
|
+
{ value: 'mon', label: 'Mon', color: '#3b82f6', icon: 'Calendar' }
|
|
41
|
+
], groupBy: "schedule", scheduleDates: { mon, tue, wed, thu, fri, sat, sun }, scheduleFilteredTaskIds: [], onUpdateTask: vi.fn(), onTaskClick: vi.fn() }));
|
|
42
|
+
expect(screen.getByText('Expired')).toBeInTheDocument();
|
|
43
|
+
expect(screen.getByText('Mon')).toBeInTheDocument();
|
|
44
|
+
expect(screen.getAllByText('Expired dual visibility task')).toHaveLength(2);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TaskItem, CategoryConfig, TaxonomyDefinition, PriorityDefinition, ParentTaskFilterMode, TaskAssignee } from '../../types';
|
|
3
|
+
interface TaskListProps {
|
|
4
|
+
tasks: TaskItem[];
|
|
5
|
+
archivedTasks: TaskItem[];
|
|
6
|
+
categories: CategoryConfig[];
|
|
7
|
+
types: {
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
}[];
|
|
11
|
+
priorities: PriorityDefinition[];
|
|
12
|
+
approaches: Array<{
|
|
13
|
+
value: string;
|
|
14
|
+
label: string;
|
|
15
|
+
color?: string;
|
|
16
|
+
icon?: string;
|
|
17
|
+
}>;
|
|
18
|
+
availableSpecialists: {
|
|
19
|
+
value: string;
|
|
20
|
+
label: string;
|
|
21
|
+
}[];
|
|
22
|
+
taxonomies: TaxonomyDefinition[];
|
|
23
|
+
searchQuery: string;
|
|
24
|
+
filterCategories: string[];
|
|
25
|
+
filterTypes: string[];
|
|
26
|
+
filterPriorities: (string | number)[];
|
|
27
|
+
filterStatus: (string | number)[];
|
|
28
|
+
filterAssignees?: TaskAssignee[];
|
|
29
|
+
filterTaxonomies: Record<string, (string | number)[]>;
|
|
30
|
+
sortBy: string;
|
|
31
|
+
sortOrder: 'asc' | 'desc';
|
|
32
|
+
showArchive: boolean;
|
|
33
|
+
parentTaskFilterMode?: ParentTaskFilterMode;
|
|
34
|
+
assigneeFilterEnabled?: boolean;
|
|
35
|
+
collapsedCategories: Record<string, boolean>;
|
|
36
|
+
loadingTasks: boolean;
|
|
37
|
+
filteredTasks: TaskItem[];
|
|
38
|
+
filteredArchive: TaskItem[];
|
|
39
|
+
groupedTasks: Record<string, TaskItem[]>;
|
|
40
|
+
copiedId: string | null;
|
|
41
|
+
recentlyChangedTaskIds?: string[];
|
|
42
|
+
onSearchChange: (query: string) => void;
|
|
43
|
+
onFilterCategoriesChange: (categories: (string | number)[]) => void;
|
|
44
|
+
onFilterTypesChange: (types: (string | number)[]) => void;
|
|
45
|
+
onFilterPrioritiesChange: (priorities: (string | number)[]) => void;
|
|
46
|
+
onFilterStatusChange: (status: (string | number)[]) => void;
|
|
47
|
+
onFilterAssigneesChange?: (assignees: (string | number)[]) => void;
|
|
48
|
+
onTaxonomyFilterChange: (id: string, values: (string | number)[]) => void;
|
|
49
|
+
onSortByChange: (sortBy: string) => void;
|
|
50
|
+
onSortOrderChange: () => void;
|
|
51
|
+
onShowArchiveChange: (show: boolean) => void;
|
|
52
|
+
onParentTaskFilterModeChange?: (mode: ParentTaskFilterMode) => void;
|
|
53
|
+
onClearFilters: () => void;
|
|
54
|
+
onToggleCategory: (category: string) => void;
|
|
55
|
+
onEditTask: (task: TaskItem) => void;
|
|
56
|
+
onOpenTaskById?: (taskId: string) => void;
|
|
57
|
+
onCopyId: (e: React.MouseEvent, id: string) => void;
|
|
58
|
+
onToggleInProgress: (task: TaskItem) => void;
|
|
59
|
+
onToggleReview: (task: TaskItem) => void;
|
|
60
|
+
onToggleComplete: (task: TaskItem) => void;
|
|
61
|
+
onToggleCancel: (task: TaskItem) => void;
|
|
62
|
+
onArchiveTask: (task: TaskItem) => void;
|
|
63
|
+
onBulkArchive: () => void;
|
|
64
|
+
onUnarchive: (taskId: string) => void;
|
|
65
|
+
onDelete: (taskId: string) => void;
|
|
66
|
+
onUnlinkChildTask?: (taskId: string) => void;
|
|
67
|
+
onClearParentTask?: (taskId: string) => void;
|
|
68
|
+
onFetchArchive: () => void;
|
|
69
|
+
onAddTaskToCategory?: (category: string) => void;
|
|
70
|
+
getIconForType?: (type: string) => React.ReactNode;
|
|
71
|
+
renderHighlighted?: (text: string, query: string) => React.ReactNode;
|
|
72
|
+
}
|
|
73
|
+
export declare const TaskList: React.ForwardRefExoticComponent<TaskListProps & React.RefAttributes<HTMLDivElement>>;
|
|
74
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import * as Icons from 'lucide-react';
|
|
4
|
+
const { Search, ClipboardList, ChevronRight, ChevronDown, Folder, Archive, RotateCcw, X, Plus, ArrowUpDown } = Icons;
|
|
5
|
+
import styles from '../../Taskforce.module.css';
|
|
6
|
+
import { MultiSelectFilter } from '../ui/MultiSelectFilter';
|
|
7
|
+
import { STATUS_OPTIONS, IconMap, resolveColor } from '../../utils/constants';
|
|
8
|
+
import { TaskCard } from './TaskCard';
|
|
9
|
+
import { t } from '../../localization';
|
|
10
|
+
export const TaskList = forwardRef((props, ref) => {
|
|
11
|
+
const { tasks, archivedTasks, categories, types, priorities, approaches, availableSpecialists, searchQuery, filterCategories, filterTypes, filterPriorities, filterStatus, filterAssignees = ['agent', 'user', 'unassigned'], filterTaxonomies, sortBy, sortOrder, showArchive, parentTaskFilterMode = 'all', assigneeFilterEnabled = false, collapsedCategories, loadingTasks, filteredTasks, filteredArchive, groupedTasks, copiedId, recentlyChangedTaskIds = [], onSearchChange, onFilterCategoriesChange, onFilterTypesChange, onFilterPrioritiesChange, onFilterStatusChange, onFilterAssigneesChange, onTaxonomyFilterChange, onSortByChange, onSortOrderChange, onShowArchiveChange, onParentTaskFilterModeChange, onClearFilters, onToggleCategory, onEditTask, onOpenTaskById, onCopyId, onToggleInProgress, onToggleReview, onToggleComplete, onToggleCancel, onArchiveTask, onBulkArchive, onUnarchive, onDelete, onUnlinkChildTask, onClearParentTask, onFetchArchive, onAddTaskToCategory, taxonomies, } = props;
|
|
12
|
+
const changedTaskIdSet = new Set(recentlyChangedTaskIds);
|
|
13
|
+
const relationshipTasks = [...tasks, ...archivedTasks];
|
|
14
|
+
const visibleCategories = categories.filter(c => !c.disabled);
|
|
15
|
+
return (_jsxs("div", { className: styles.viewTab, ref: ref, children: [_jsxs("div", { className: styles.filterBar, children: [_jsxs("div", { className: styles.searchContainer, children: [_jsx(Search, { size: 16, className: styles.searchIcon }), _jsx("input", { type: "text", className: styles.searchInput, placeholder: t('taskList.searchPlaceholder'), value: searchQuery, onChange: (e) => onSearchChange(e.target.value) }), searchQuery && (_jsx("button", { className: styles.clearSearchBtn, onClick: () => onSearchChange(''), title: t('taskList.clearSearchTitle'), children: _jsx(X, { size: 14 }) }))] }), _jsxs("div", { className: styles.filterRow, children: [_jsx(MultiSelectFilter, { label: t('taskList.categoryLabel'), options: visibleCategories.map(cat => ({ value: cat.value, label: cat.label })), selected: filterCategories, onChange: onFilterCategoriesChange }), _jsx(MultiSelectFilter, { label: t('taskList.typeLabel'), options: types, selected: filterTypes, onChange: onFilterTypesChange, variant: "value" })] }), _jsxs("div", { className: styles.filterRow, children: [_jsx(MultiSelectFilter, { label: t('taskList.priorityLabel'), options: priorities, selected: filterPriorities, onChange: onFilterPrioritiesChange, variant: "value" }), _jsx(MultiSelectFilter, { label: t('taskList.statusLabel'), options: STATUS_OPTIONS, selected: filterStatus, onChange: onFilterStatusChange, variant: "value" }), assigneeFilterEnabled && (_jsx(MultiSelectFilter, { label: t('taskList.assigneeLabel'), options: [
|
|
16
|
+
{ value: 'agent', label: 'AI' },
|
|
17
|
+
{ value: 'user', label: 'User' },
|
|
18
|
+
{ value: 'unassigned', label: 'Unassigned' }
|
|
19
|
+
], selected: filterAssignees, onChange: (vals) => onFilterAssigneesChange?.(vals), variant: "value" }))] }), taxonomies.map(tax => (_jsx(MultiSelectFilter, { label: tax.label, options: tax.options, selected: filterTaxonomies[tax.id] || [], onChange: (values) => onTaxonomyFilterChange(tax.id, values), variant: "value" }, tax.id))), _jsxs("div", { className: styles.filterRow, children: [_jsxs("div", { className: styles.sortLabel, children: [_jsx(ArrowUpDown, { size: 14, style: { marginRight: '4px' } }), " ", t('taskList.sortByLabel')] }), _jsxs("select", { value: sortBy, onChange: (e) => onSortByChange(e.target.value), className: `${styles.filterSelect} ${styles.filterSelectSort} `, children: [_jsx("option", { value: "created", children: t('taskList.sortCreated') }), _jsx("option", { value: "updated", children: t('taskList.sortUpdated') }), _jsx("option", { value: "priority", children: t('taskList.sortPriority') })] }), _jsx("button", { className: `${styles.resetFiltersBtn} ${styles.sortDirectionBtnWidget}`, onClick: onSortOrderChange, title: sortOrder === 'desc' ? t('taskList.sortDirectionDescTitle') : t('taskList.sortDirectionAscTitle'), children: sortOrder === 'desc' ? _jsx(Icons.ArrowDown, { size: 14 }) : _jsx(Icons.ArrowUp, { size: 14 }) }), _jsx("button", { className: styles.resetFiltersBtn, onClick: onClearFilters, title: t('taskList.resetFiltersTitle'), children: _jsx(RotateCcw, { size: 14 }) })] }), _jsxs("div", { className: `${styles.filterRow} ${styles.archiveRow} `, children: [_jsxs("button", { className: `${styles.bulkArchiveBtn} ${!tasks.some(t => t.status === 'done' || t.status === 'cancelled') ? styles.disabledBtn : ''} `, onClick: () => tasks.some(t => t.status === 'done' || t.status === 'cancelled') && onBulkArchive(), disabled: !tasks.some(t => t.status === 'done' || t.status === 'cancelled'), title: tasks.some(t => t.status === 'done' || t.status === 'cancelled') ? t('taskList.archiveAllTitle') : t('taskList.noTasksToArchiveTitle'), children: [_jsx(Archive, { size: 12 }), _jsx("span", { children: t('taskList.archiveFinished') })] }), _jsxs("label", { className: styles.archiveToggle, children: [_jsx("span", { children: t('taskList.linksLabel') }), _jsxs("select", { className: `${styles.filterSelect} ${styles.filterSelectSort}`, value: parentTaskFilterMode, onChange: (e) => onParentTaskFilterModeChange?.(e.target.value), children: [_jsx("option", { value: "all", children: t('taskList.linksAll') }), _jsx("option", { value: "parents", children: t('taskList.linksParents') }), _jsx("option", { value: "linked", children: t('taskList.linksLinked') }), _jsx("option", { value: "unlinked", children: t('taskList.linksUnlinked') })] })] }), _jsxs("label", { className: styles.archiveToggle, children: [_jsx("input", { type: "checkbox", checked: showArchive, onChange: (e) => {
|
|
20
|
+
onShowArchiveChange(e.target.checked);
|
|
21
|
+
if (e.target.checked)
|
|
22
|
+
onFetchArchive();
|
|
23
|
+
} }), _jsx("span", { children: t('taskList.includeArchive') })] })] })] }), loadingTasks && tasks.length === 0 ? (_jsx("div", { className: styles.loading, children: _jsx(Icons.Loader2, { size: 24, className: styles.spinner }) })) : filteredTasks.length === 0 && !loadingTasks ? (_jsxs("div", { className: styles.emptyState, children: [searchQuery ? _jsx(Search, { size: 48 }) : _jsx(ClipboardList, { size: 48 }), _jsx("p", { children: searchQuery ? t('taskList.noMatchingTasks') : t('taskList.noActiveTasks') })] })) : (_jsx("div", { className: styles.taskList, style: { opacity: loadingTasks ? 0.6 : 1, transition: 'opacity 0.2s ease' }, children: Object.entries(groupedTasks).map(([category, items]) => {
|
|
24
|
+
if (items.length === 0)
|
|
25
|
+
return null;
|
|
26
|
+
const isCollapsed = collapsedCategories[category];
|
|
27
|
+
return (_jsxs("div", { className: styles.categoryGroup, children: [_jsx("div", { className: styles.categoryHeader, onClick: () => onToggleCategory(category), children: _jsxs("div", { className: styles.categoryTitle, children: [isCollapsed ? _jsx(ChevronRight, { size: 16 }) : _jsx(ChevronDown, { size: 16 }), (() => {
|
|
28
|
+
const catConfig = categories.find(c => c.label === category);
|
|
29
|
+
const IconComp = catConfig?.icon && IconMap[catConfig.icon] ? IconMap[catConfig.icon] : Folder;
|
|
30
|
+
const color = resolveColor(catConfig?.color) || 'var(--color-purple, #8b5cf6)';
|
|
31
|
+
return _jsx(IconComp, { size: 16, className: styles.categoryTitleIcon, style: { color } });
|
|
32
|
+
})(), category, _jsxs("span", { className: styles.categoryCount, children: ["(", items.length, ")"] }), onAddTaskToCategory && (_jsx("button", { className: styles.kanbanQuickAdd, onClick: (e) => {
|
|
33
|
+
e.stopPropagation();
|
|
34
|
+
onAddTaskToCategory(category);
|
|
35
|
+
}, title: t('taskList.addTaskToCategoryTitle', { category }), style: { marginLeft: 'auto' }, children: _jsx(Plus, { size: 14 }) }))] }) }), !isCollapsed && (_jsx("div", { className: styles.categoryItems, children: items.map((task) => (_jsx(TaskCard, { task: task, allTasks: relationshipTasks, searchQuery: searchQuery, copiedId: copiedId, availableSpecialists: availableSpecialists, taxonomies: taxonomies, priorities: priorities, approaches: approaches, onClick: onEditTask, onOpenTaskById: onOpenTaskById, onCopyId: onCopyId, onToggleInProgress: onToggleInProgress, onToggleReview: onToggleReview, onToggleComplete: onToggleComplete, onToggleCancel: onToggleCancel, onArchiveTask: onArchiveTask, onUnlinkChildTask: onUnlinkChildTask, onClearParentTask: onClearParentTask, categories: categories, isRecentlyChanged: changedTaskIdSet.has(task.id) }, task.id))) }))] }, category));
|
|
36
|
+
}) })), showArchive && filteredArchive.length > 0 && (_jsxs("div", { className: styles.archiveList, children: [_jsx("div", { className: styles.archiveHeader, children: 'Archived' }), filteredArchive.map((task) => (_jsx(TaskCard, { task: task, searchQuery: searchQuery, copiedId: copiedId, isArchived: true, approaches: approaches, onClick: onEditTask, onCopyId: onCopyId, onUnarchive: onUnarchive, onDelete: onDelete, categories: categories }, task.id)))] }))] }));
|
|
37
|
+
});
|
|
38
|
+
TaskList.displayName = 'TaskList';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { render, screen, waitFor } from '@testing-library/react';
|
|
4
|
+
import userEvent from '@testing-library/user-event';
|
|
5
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
6
|
+
import { TaskList } from './TaskList';
|
|
7
|
+
// Mock child components
|
|
8
|
+
vi.mock('../ui/MultiSelectFilter', () => ({
|
|
9
|
+
MultiSelectFilter: ({ label, selected, onChange }) => (_jsxs("div", { "data-testid": `filter-${label.toLowerCase()}`, children: [_jsxs("button", { onClick: () => onChange(['new-selection']), children: ["Change ", label] }), _jsxs("span", { children: ["Selected: ", selected.join(', ')] })] }))
|
|
10
|
+
}));
|
|
11
|
+
vi.mock('../ui/Markdown', () => ({
|
|
12
|
+
Markdown: ({ children }) => _jsxs("div", { children: ["Markdown: ", children] })
|
|
13
|
+
}));
|
|
14
|
+
describe('TaskList Component', () => {
|
|
15
|
+
const defaultProps = {
|
|
16
|
+
tasks: [],
|
|
17
|
+
archivedTasks: [],
|
|
18
|
+
categories: [
|
|
19
|
+
{ value: 'general', label: 'General', disabled: false },
|
|
20
|
+
{ value: 'backend', label: 'Backend', disabled: false }
|
|
21
|
+
],
|
|
22
|
+
types: [{ value: 'feature', label: 'Feature' }],
|
|
23
|
+
priorities: [{ value: 3, label: 'High' }],
|
|
24
|
+
approaches: [],
|
|
25
|
+
availableSpecialists: [],
|
|
26
|
+
searchQuery: '',
|
|
27
|
+
filterCategories: ['General'],
|
|
28
|
+
filterTypes: [],
|
|
29
|
+
filterPriorities: [],
|
|
30
|
+
filterStatus: [],
|
|
31
|
+
sortBy: 'created',
|
|
32
|
+
sortOrder: 'desc',
|
|
33
|
+
showArchive: false,
|
|
34
|
+
collapsedCategories: {},
|
|
35
|
+
filterTaxonomies: {},
|
|
36
|
+
taxonomies: [],
|
|
37
|
+
loadingTasks: false,
|
|
38
|
+
filteredTasks: [],
|
|
39
|
+
filteredArchive: [],
|
|
40
|
+
groupedTasks: {},
|
|
41
|
+
copiedId: null,
|
|
42
|
+
onSearchChange: vi.fn(),
|
|
43
|
+
onFilterCategoriesChange: vi.fn(),
|
|
44
|
+
onFilterTypesChange: vi.fn(),
|
|
45
|
+
onFilterPrioritiesChange: vi.fn(),
|
|
46
|
+
onFilterStatusChange: vi.fn(),
|
|
47
|
+
onTaxonomyFilterChange: vi.fn(),
|
|
48
|
+
onSortByChange: vi.fn(),
|
|
49
|
+
onSortOrderChange: vi.fn(),
|
|
50
|
+
onShowArchiveChange: vi.fn(),
|
|
51
|
+
onClearFilters: vi.fn(),
|
|
52
|
+
onToggleCategory: vi.fn(),
|
|
53
|
+
onEditTask: vi.fn(),
|
|
54
|
+
onCopyId: vi.fn(),
|
|
55
|
+
onToggleInProgress: vi.fn(),
|
|
56
|
+
onToggleReview: vi.fn(),
|
|
57
|
+
onToggleComplete: vi.fn(),
|
|
58
|
+
onToggleCancel: vi.fn(),
|
|
59
|
+
onArchiveTask: vi.fn(),
|
|
60
|
+
onBulkArchive: vi.fn(),
|
|
61
|
+
onUnarchive: vi.fn(),
|
|
62
|
+
onDelete: vi.fn(),
|
|
63
|
+
onFetchArchive: vi.fn(),
|
|
64
|
+
getIconForType: () => _jsx("span", { children: "Icon" }),
|
|
65
|
+
renderHighlighted: (text) => text,
|
|
66
|
+
};
|
|
67
|
+
const renderComponent = (props = {}) => {
|
|
68
|
+
return render(_jsx(TaskList, { ...defaultProps, ...props }));
|
|
69
|
+
};
|
|
70
|
+
it('2.1 Renders filter controls', () => {
|
|
71
|
+
renderComponent();
|
|
72
|
+
expect(screen.getByPlaceholderText('Search tasks...')).toBeInTheDocument();
|
|
73
|
+
expect(screen.getByTestId('filter-category')).toBeInTheDocument();
|
|
74
|
+
expect(screen.getByTestId('filter-type')).toBeInTheDocument();
|
|
75
|
+
// Check Sort By
|
|
76
|
+
expect(screen.getByText('Sort By:')).toBeInTheDocument();
|
|
77
|
+
});
|
|
78
|
+
it('2.2 Search interaction', async () => {
|
|
79
|
+
const user = userEvent.setup();
|
|
80
|
+
renderComponent();
|
|
81
|
+
const input = screen.getByPlaceholderText('Search tasks...');
|
|
82
|
+
await user.type(input, 'fix');
|
|
83
|
+
expect(defaultProps.onSearchChange).toHaveBeenCalled();
|
|
84
|
+
});
|
|
85
|
+
it('2.3 Clear search', async () => {
|
|
86
|
+
const user = userEvent.setup();
|
|
87
|
+
renderComponent({ searchQuery: 'test' });
|
|
88
|
+
const clearBtn = screen.getByTitle('Clear search');
|
|
89
|
+
await user.click(clearBtn);
|
|
90
|
+
expect(defaultProps.onSearchChange).toHaveBeenCalledWith('');
|
|
91
|
+
});
|
|
92
|
+
it('2.4 Filter interactions', async () => {
|
|
93
|
+
const user = userEvent.setup();
|
|
94
|
+
renderComponent();
|
|
95
|
+
// Interact with mocked filter
|
|
96
|
+
const changeCatBtn = screen.getByText('Change Category');
|
|
97
|
+
await user.click(changeCatBtn);
|
|
98
|
+
expect(defaultProps.onFilterCategoriesChange).toHaveBeenCalledWith(['new-selection']);
|
|
99
|
+
});
|
|
100
|
+
it('2.5 Sorting', async () => {
|
|
101
|
+
const user = userEvent.setup();
|
|
102
|
+
renderComponent();
|
|
103
|
+
const select = screen.getAllByRole('combobox')[0]; // Sort select
|
|
104
|
+
await user.selectOptions(select, 'priority');
|
|
105
|
+
expect(defaultProps.onSortByChange).toHaveBeenCalledWith('priority');
|
|
106
|
+
});
|
|
107
|
+
it('2.6 Clear filters', async () => {
|
|
108
|
+
const user = userEvent.setup();
|
|
109
|
+
renderComponent();
|
|
110
|
+
const resetBtn = screen.getByTitle('Reset all filters');
|
|
111
|
+
await user.click(resetBtn);
|
|
112
|
+
expect(defaultProps.onClearFilters).toHaveBeenCalled();
|
|
113
|
+
});
|
|
114
|
+
it('2.7 Archive toggle', async () => {
|
|
115
|
+
const user = userEvent.setup();
|
|
116
|
+
renderComponent();
|
|
117
|
+
const toggle = screen.getByLabelText('Include Archive');
|
|
118
|
+
await user.click(toggle);
|
|
119
|
+
expect(defaultProps.onShowArchiveChange).toHaveBeenCalledWith(true);
|
|
120
|
+
expect(defaultProps.onFetchArchive).toHaveBeenCalled();
|
|
121
|
+
});
|
|
122
|
+
it('2.8 Renders grouped tasks', () => {
|
|
123
|
+
const task = {
|
|
124
|
+
id: '1', title: 'Test Task', category: 'General', type: 'feature',
|
|
125
|
+
priority: 3, description: null,
|
|
126
|
+
createdAt: '', updatedAt: '', completed: false, cancelled: false,
|
|
127
|
+
status: 'task'
|
|
128
|
+
};
|
|
129
|
+
renderComponent({
|
|
130
|
+
filteredTasks: [task],
|
|
131
|
+
groupedTasks: { 'General': [task] }
|
|
132
|
+
});
|
|
133
|
+
// Category header
|
|
134
|
+
expect(screen.getByText('General')).toBeInTheDocument();
|
|
135
|
+
expect(screen.getByText('(1)')).toBeInTheDocument();
|
|
136
|
+
// Task item
|
|
137
|
+
expect(screen.getByText('Test Task')).toBeInTheDocument();
|
|
138
|
+
});
|
|
139
|
+
it('2.9 Collapse category', async () => {
|
|
140
|
+
const user = userEvent.setup();
|
|
141
|
+
const task = {
|
|
142
|
+
id: '1', title: 'Test Task', category: 'General', type: 'feature',
|
|
143
|
+
priority: 3, description: null,
|
|
144
|
+
createdAt: '', updatedAt: '', completed: false, cancelled: false,
|
|
145
|
+
status: 'task'
|
|
146
|
+
};
|
|
147
|
+
renderComponent({
|
|
148
|
+
filteredTasks: [task],
|
|
149
|
+
groupedTasks: { 'General': [task] },
|
|
150
|
+
collapsedCategories: { 'General': false }
|
|
151
|
+
});
|
|
152
|
+
const titleEl = screen.getByText('General');
|
|
153
|
+
await user.click(titleEl);
|
|
154
|
+
expect(defaultProps.onToggleCategory).toHaveBeenCalledWith('General');
|
|
155
|
+
});
|
|
156
|
+
it('2.10 Task Actions - Edit', async () => {
|
|
157
|
+
const user = userEvent.setup();
|
|
158
|
+
const task = {
|
|
159
|
+
id: '1', title: 'Test Task', category: 'General', type: 'feature',
|
|
160
|
+
priority: 3, description: null,
|
|
161
|
+
createdAt: '', updatedAt: '', completed: false, cancelled: false,
|
|
162
|
+
status: 'task'
|
|
163
|
+
};
|
|
164
|
+
renderComponent({
|
|
165
|
+
filteredTasks: [task],
|
|
166
|
+
groupedTasks: { 'General': [task] }
|
|
167
|
+
});
|
|
168
|
+
await user.click(screen.getByText('Test Task'));
|
|
169
|
+
expect(defaultProps.onEditTask).toHaveBeenCalledWith(task);
|
|
170
|
+
});
|
|
171
|
+
it('2.11 Task Actions - Buttons', async () => {
|
|
172
|
+
const user = userEvent.setup();
|
|
173
|
+
const task = {
|
|
174
|
+
id: '1', title: 'Test Task', category: 'General', type: 'feature',
|
|
175
|
+
priority: 3, description: null,
|
|
176
|
+
createdAt: '', updatedAt: '', completed: false, cancelled: false,
|
|
177
|
+
status: 'task'
|
|
178
|
+
};
|
|
179
|
+
renderComponent({
|
|
180
|
+
filteredTasks: [task],
|
|
181
|
+
groupedTasks: { 'General': [task] }
|
|
182
|
+
});
|
|
183
|
+
const startBtn = screen.getByTitle('Start Working');
|
|
184
|
+
await user.click(startBtn);
|
|
185
|
+
expect(defaultProps.onToggleInProgress).toHaveBeenCalledWith(task);
|
|
186
|
+
const completeBtn = screen.getByTitle('Mark Complete');
|
|
187
|
+
await user.click(completeBtn);
|
|
188
|
+
expect(defaultProps.onToggleComplete).toHaveBeenCalledWith(task);
|
|
189
|
+
});
|
|
190
|
+
it('2.12 Empty state', () => {
|
|
191
|
+
renderComponent({ filteredTasks: [], loadingTasks: false });
|
|
192
|
+
expect(screen.getByText('No active tasks')).toBeInTheDocument();
|
|
193
|
+
});
|
|
194
|
+
it('2.13 Loading state', () => {
|
|
195
|
+
renderComponent({ loadingTasks: true });
|
|
196
|
+
expect(screen.queryByText('No active tasks')).not.toBeInTheDocument();
|
|
197
|
+
});
|
|
198
|
+
it('2.14 Archive List', () => {
|
|
199
|
+
const archivedTask = {
|
|
200
|
+
id: '2', title: 'Archived Task', category: 'General', type: 'feature',
|
|
201
|
+
priority: 1, description: null,
|
|
202
|
+
createdAt: '', updatedAt: '', completed: true, cancelled: false,
|
|
203
|
+
status: 'done'
|
|
204
|
+
};
|
|
205
|
+
renderComponent({
|
|
206
|
+
showArchive: true,
|
|
207
|
+
filteredArchive: [archivedTask]
|
|
208
|
+
});
|
|
209
|
+
expect(screen.getByText('Archived')).toBeInTheDocument();
|
|
210
|
+
expect(screen.getByText(/Archived Task/)).toBeInTheDocument();
|
|
211
|
+
});
|
|
212
|
+
it('2.15 Bulk Archive', async () => {
|
|
213
|
+
const user = userEvent.setup();
|
|
214
|
+
const completedTask = {
|
|
215
|
+
id: '1', title: 'Done Task', category: 'General', type: 'feature',
|
|
216
|
+
priority: 3, description: null,
|
|
217
|
+
createdAt: '', updatedAt: '', completed: true, cancelled: false,
|
|
218
|
+
status: 'done'
|
|
219
|
+
};
|
|
220
|
+
renderComponent({
|
|
221
|
+
tasks: [completedTask]
|
|
222
|
+
});
|
|
223
|
+
const bulkBtn = screen.getByTitle('Archive all completed and cancelled tasks');
|
|
224
|
+
expect(bulkBtn).not.toBeDisabled();
|
|
225
|
+
await user.click(bulkBtn);
|
|
226
|
+
expect(defaultProps.onBulkArchive).toHaveBeenCalled();
|
|
227
|
+
});
|
|
228
|
+
it('2.16 Search does not show archive when archive toggle is off', () => {
|
|
229
|
+
const archivedTask = {
|
|
230
|
+
id: '2', title: 'Archived Match', category: 'General', type: 'feature',
|
|
231
|
+
priority: 1, description: null,
|
|
232
|
+
createdAt: '', updatedAt: '', completed: true, cancelled: false,
|
|
233
|
+
status: 'done'
|
|
234
|
+
};
|
|
235
|
+
renderComponent({
|
|
236
|
+
showArchive: false,
|
|
237
|
+
searchQuery: 'match',
|
|
238
|
+
filteredArchive: [archivedTask]
|
|
239
|
+
});
|
|
240
|
+
expect(screen.queryByText('Archived')).not.toBeInTheDocument();
|
|
241
|
+
expect(screen.queryByText(/Archived Match/)).not.toBeInTheDocument();
|
|
242
|
+
});
|
|
243
|
+
it('2.17 Archived delete removes task immediately from archive view', async () => {
|
|
244
|
+
const user = userEvent.setup();
|
|
245
|
+
const archivedTask = {
|
|
246
|
+
id: 'arch-1',
|
|
247
|
+
title: 'Archived Immediate Remove',
|
|
248
|
+
description: null,
|
|
249
|
+
category: 'General',
|
|
250
|
+
type: 'feature',
|
|
251
|
+
priority: 1,
|
|
252
|
+
createdAt: '',
|
|
253
|
+
updatedAt: '',
|
|
254
|
+
completed: true,
|
|
255
|
+
cancelled: false,
|
|
256
|
+
status: 'done',
|
|
257
|
+
isArchived: true
|
|
258
|
+
};
|
|
259
|
+
const TestHarness = () => {
|
|
260
|
+
const [archive, setArchive] = useState([archivedTask]);
|
|
261
|
+
return (_jsx(TaskList, { ...defaultProps, showArchive: true, filteredArchive: archive, onDelete: (taskId) => setArchive((prev) => prev.filter((task) => task.id !== taskId)) }));
|
|
262
|
+
};
|
|
263
|
+
render(_jsx(TestHarness, {}));
|
|
264
|
+
expect(screen.getByText(/Archived Immediate Remove/i)).toBeInTheDocument();
|
|
265
|
+
await user.click(screen.getByTitle('Delete Permanently'));
|
|
266
|
+
await waitFor(() => {
|
|
267
|
+
expect(screen.queryByText(/Archived Immediate Remove/i)).not.toBeInTheDocument();
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ScreenshotItem } from '../../types';
|
|
2
|
+
interface TaskScreenshotSectionProps {
|
|
3
|
+
screenshots: Array<string | ScreenshotItem>;
|
|
4
|
+
isCapturingScreenshot: boolean;
|
|
5
|
+
onCaptureScreenshot: () => void;
|
|
6
|
+
onScreenshotComplete: (data: string | {
|
|
7
|
+
path: string;
|
|
8
|
+
fsPath?: string;
|
|
9
|
+
}) => void;
|
|
10
|
+
onScreenshotCancel: () => void;
|
|
11
|
+
onRemoveScreenshot: (index: number) => void;
|
|
12
|
+
onUpdateScreenshotCaption: (index: number, caption: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function TaskScreenshotSection(props: TaskScreenshotSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AlertTriangle, Camera, Copy, Trash2 } from 'lucide-react';
|
|
3
|
+
import styles from '../../Taskforce.module.css';
|
|
4
|
+
import { TaskforceScreenshot } from '../../TaskforceScreenshot';
|
|
5
|
+
export function TaskScreenshotSection(props) {
|
|
6
|
+
const { screenshots, isCapturingScreenshot, onCaptureScreenshot, onScreenshotComplete, onScreenshotCancel, onRemoveScreenshot, onUpdateScreenshotCaption } = props;
|
|
7
|
+
return (_jsxs("div", { className: `${styles.field} ${styles.marginBottom16}`, children: [_jsxs("div", { className: styles.labelRow, children: [_jsx("label", { className: styles.label, children: "Screenshots" }), _jsxs("button", { type: "button", className: styles.manageLink, onClick: onCaptureScreenshot, children: [_jsx(Camera, { size: 12 }), " Capture"] })] }), isCapturingScreenshot && (_jsx(TaskforceScreenshot, { onCapture: onScreenshotComplete, onCancel: onScreenshotCancel })), screenshots.length > 0 && (_jsx("div", { className: styles.screenshotGrid, children: screenshots.map((item, idx) => {
|
|
8
|
+
const path = typeof item === 'string' ? item : item.path;
|
|
9
|
+
const fsPath = typeof item === 'string' ? undefined : item.fsPath;
|
|
10
|
+
const caption = typeof item === 'string' ? '' : item.caption || '';
|
|
11
|
+
return (_jsxs("div", { className: styles.screenshotCard, children: [_jsxs("div", { className: styles.screenshotImageContainer, children: [_jsx("img", { src: path, alt: caption || `Screenshot ${idx}`, onClick: () => window.open(path, '_blank'), onError: (e) => {
|
|
12
|
+
e.target.style.display = 'none';
|
|
13
|
+
e.target.parentElement.classList.add(styles.brokenImage);
|
|
14
|
+
} }), _jsxs("div", { className: styles.brokenImagePlaceholder, children: [_jsx(AlertTriangle, { size: 16 }), _jsx("span", { children: "Image not found" })] }), _jsxs("div", { className: styles.screenshotActions, children: [fsPath && (_jsx("button", { type: "button", className: styles.screenshotActionBtn, onClick: (e) => {
|
|
15
|
+
e.stopPropagation();
|
|
16
|
+
navigator.clipboard.writeText(fsPath);
|
|
17
|
+
}, title: `Copy path: ${fsPath}`, children: _jsx(Copy, { size: 12 }) })), _jsx("button", { type: "button", className: styles.screenshotActionBtn, onClick: (e) => {
|
|
18
|
+
e.stopPropagation();
|
|
19
|
+
onRemoveScreenshot(idx);
|
|
20
|
+
}, title: "Delete", children: _jsx(Trash2, { size: 12 }) })] })] }), _jsx("input", { type: "text", className: styles.screenshotCaptionInput, placeholder: "Add a caption...", value: caption, onChange: (e) => onUpdateScreenshotCaption(idx, e.target.value) })] }, idx));
|
|
21
|
+
}) }))] }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function LevelSelector({ label, value, options, onChange, type, hideLabel }: {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string | number;
|
|
4
|
+
options: Array<{
|
|
5
|
+
value: string | number;
|
|
6
|
+
label: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
}>;
|
|
10
|
+
onChange: (val: string | number) => void;
|
|
11
|
+
type?: 'priority' | 'complexity' | 'general';
|
|
12
|
+
hideLabel?: boolean;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styles from '../../Taskforce.module.css';
|
|
3
|
+
import { resolveColor } from '../../utils/constants';
|
|
4
|
+
export function LevelSelector({ label, value, options, onChange, type = 'priority', hideLabel = false }) {
|
|
5
|
+
const selectedOption = options.find(o => String(o.value) === String(value));
|
|
6
|
+
return (_jsxs("div", { className: styles.field, children: [!hideLabel && (_jsxs("div", { className: styles.labelRow, children: [_jsx("label", { className: styles.label, children: label }), selectedOption && (_jsx("span", { className: styles.levelLabel, style: {
|
|
7
|
+
color: resolveColor(selectedOption.color) || (type === 'priority'
|
|
8
|
+
? `var(--priority-${value})`
|
|
9
|
+
: (type === 'complexity' ? `var(--complexity-${value})` : 'var(--text-secondary)')),
|
|
10
|
+
backgroundColor: (resolveColor(selectedOption.color) ? `${resolveColor(selectedOption.color)}25` : undefined) || (type === 'priority'
|
|
11
|
+
? `color-mix(in srgb, var(--priority-${value}), transparent 85%)`
|
|
12
|
+
: (type === 'complexity' ? `color-mix(in srgb, var(--complexity-${value}), transparent 85%)` : 'rgba(255,255,255,0.05)'))
|
|
13
|
+
}, children: selectedOption.label }))] })), _jsx("div", { className: styles.levelSelect, children: options.map((opt, index) => {
|
|
14
|
+
const selectedIndex = options.findIndex(o => String(o.value) === String(value));
|
|
15
|
+
const isFilled = index <= selectedIndex;
|
|
16
|
+
const isSelected = String(opt.value) === String(value);
|
|
17
|
+
return (_jsx("button", { type: "button", className: `${styles.levelOption} ${isFilled ? styles.levelOptionFilled : ''} ${isFilled ? styles[`levelOption_${type}_${opt.value}`] : ''} ${isSelected ? styles.levelOptionSelected : ''}`, onClick: () => onChange(opt.value), title: opt.label, style: {
|
|
18
|
+
opacity: isFilled ? 1 : 0.15,
|
|
19
|
+
backgroundColor: isFilled ? (resolveColor(opt.color) || (type === 'priority' ? `var(--priority-${opt.value})` : (type === 'complexity' ? `var(--complexity-${opt.value})` : 'var(--text-primary)'))) : undefined,
|
|
20
|
+
color: isFilled ? ((type === 'priority' && String(opt.value).toLowerCase() === 'medium') ? 'black' : 'white') : undefined,
|
|
21
|
+
boxShadow: isFilled && ((type === 'priority' && (String(opt.value).toLowerCase() === 'critical' || opt.value === 4)) ||
|
|
22
|
+
(type === 'complexity' && (String(opt.value).toLowerCase() === 'epic' || opt.value === 5))) ? `0 0 12px ${type === 'priority' ? 'rgba(239, 68, 68, 0.6)' : 'rgba(217, 70, 239, 0.6)'}` : undefined
|
|
23
|
+
} }, String(opt.value)));
|
|
24
|
+
}) })] }));
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen, fireEvent } from '@testing-library/react';
|
|
3
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
4
|
+
import { LevelSelector } from './LevelSelector';
|
|
5
|
+
describe('LevelSelector Component', () => {
|
|
6
|
+
const defaultProps = {
|
|
7
|
+
label: 'Priority',
|
|
8
|
+
options: [
|
|
9
|
+
{ value: 'low', label: 'Low' },
|
|
10
|
+
{ value: 'medium', label: 'Medium' },
|
|
11
|
+
{ value: 'high', label: 'High' }
|
|
12
|
+
],
|
|
13
|
+
value: 'medium',
|
|
14
|
+
onChange: vi.fn(),
|
|
15
|
+
type: 'priority'
|
|
16
|
+
};
|
|
17
|
+
const renderComponent = (props = {}) => {
|
|
18
|
+
return render(_jsx(LevelSelector, { ...defaultProps, ...props }));
|
|
19
|
+
};
|
|
20
|
+
it('1.7 Renders label and options', () => {
|
|
21
|
+
renderComponent();
|
|
22
|
+
expect(screen.getByText('Priority')).toBeInTheDocument();
|
|
23
|
+
// Should have 3 options
|
|
24
|
+
const options = screen.getAllByRole('button');
|
|
25
|
+
// Might be more buttons if there are help/manage links?
|
|
26
|
+
// LevelSelector usually just renders label + buttons.
|
|
27
|
+
// Let's filter by title.
|
|
28
|
+
expect(screen.getByTitle('Low')).toBeInTheDocument();
|
|
29
|
+
expect(screen.getByTitle('Medium')).toBeInTheDocument();
|
|
30
|
+
expect(screen.getByTitle('High')).toBeInTheDocument();
|
|
31
|
+
});
|
|
32
|
+
it('1.8 Highlights selected option', () => {
|
|
33
|
+
const { container } = renderComponent({ value: 'high' });
|
|
34
|
+
const highBtn = screen.getByTitle('High');
|
|
35
|
+
// Check for active class or style.
|
|
36
|
+
// Class names might be hashed, but `levelOptionFilled` or `active` concept.
|
|
37
|
+
// Let's check if it has the specific class for high priority or just check style.
|
|
38
|
+
// The implementation adds classes like `_levelOption_priority_high`.
|
|
39
|
+
// Let's assume it works if we can find it.
|
|
40
|
+
// Better: verify click triggers change.
|
|
41
|
+
fireEvent.click(highBtn);
|
|
42
|
+
// It's already high, but clicking again should still fire or be no-op?
|
|
43
|
+
// Let's click Low.
|
|
44
|
+
const lowBtn = screen.getByTitle('Low');
|
|
45
|
+
fireEvent.click(lowBtn);
|
|
46
|
+
expect(defaultProps.onChange).toHaveBeenCalledWith('low');
|
|
47
|
+
});
|
|
48
|
+
it('1.9 Visual check (snapshot-like)', () => {
|
|
49
|
+
// Select Low, so High should be dim
|
|
50
|
+
const { container } = renderComponent({ value: 'low' });
|
|
51
|
+
const highBtn = screen.getByTitle('High');
|
|
52
|
+
// Unselected options usually have lower opacity or transparent bg
|
|
53
|
+
expect(highBtn).toHaveStyle({ opacity: '0.15' });
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const Markdown: ({ children, className, onChecklistToggle, onTaskIdClick }: {
|
|
2
|
+
children: string | null | undefined;
|
|
3
|
+
className?: string;
|
|
4
|
+
onChecklistToggle?: (lineIndex: number, completed: boolean) => void;
|
|
5
|
+
onTaskIdClick?: (taskId: string) => void;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|