@runfusion/fusion 0.25.0 → 0.27.0
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 +6 -0
- package/dist/bin.js +28004 -16888
- package/dist/client/assets/AgentDetailView-B7QRcHJH.css +1 -0
- package/dist/client/assets/AgentDetailView-DwLmRXTY.js +18 -0
- package/dist/client/assets/{AgentsView-B3jYk8Kt.js → AgentsView-D-N6aA0P.js} +12 -7
- package/dist/client/assets/ChatView-DnCdKu8Z.js +1 -0
- package/dist/client/assets/{DevServerView-DyGDEiBP.js → DevServerView-BiA1nYtt.js} +1 -1
- package/dist/client/assets/{DirectoryPicker-D5UIeIl6.js → DirectoryPicker-DvBviDG6.js} +1 -1
- package/dist/client/assets/{DocumentsView-DNHu1T8K.js → DocumentsView-BWXOxpuq.js} +1 -1
- package/dist/client/assets/{EvalsView-CpRobtDi.js → EvalsView-CJFbtL7i.js} +1 -1
- package/dist/client/assets/{ExperimentalAgentOnboardingModal-DOY_oZi7.js → ExperimentalAgentOnboardingModal-DuGIPd0B.js} +1 -1
- package/dist/client/assets/InsightsView-BBpRiolN.js +11 -0
- package/dist/client/assets/{MemoryView-PSc5lGJt.js → MemoryView-48LuNkKk.js} +2 -2
- package/dist/client/assets/NodesView-CGQWSNZM.js +14 -0
- package/dist/client/assets/{PiExtensionsManager-DL_QcN56.js → PiExtensionsManager-i-7UL2oh.js} +2 -2
- package/dist/client/assets/PluginManager-DoSAykD6.js +1 -0
- package/dist/client/assets/{ResearchView-BzCcDAS4.css → ResearchView-BEI4ZSGs.css} +1 -1
- package/dist/client/assets/ResearchView-XZuRtOxE.js +1 -0
- package/dist/client/assets/SettingsModal-Ci0_sqbU.css +1 -0
- package/dist/client/assets/{SettingsModal-CUCyaAyE.js → SettingsModal-CmeF8CN4.js} +1 -1
- package/dist/client/assets/SettingsModal-DBcjf9Bu.js +31 -0
- package/dist/client/assets/SettingsModal-DWKgRxBA.css +1 -0
- package/dist/client/assets/{SetupWizardModal-BKscasuh.js → SetupWizardModal-CgtvpMX9.js} +1 -1
- package/dist/client/assets/{SkillsView-BdELqTy7.js → SkillsView-DErYRumF.js} +1 -1
- package/dist/client/assets/StashRecoveryView-B_8WIQEo.css +1 -0
- package/dist/client/assets/StashRecoveryView-QJrNS4Vg.js +1 -0
- package/dist/client/assets/{TodoView-DFNGBDNV.js → TodoView-BD9NRwq0.js} +2 -2
- package/dist/client/assets/createLucideIcon-BazL2hk5.js +21 -0
- package/dist/client/assets/dashboard-view-BWGH_fAq.js +63 -0
- package/dist/client/assets/dashboard-view-BoTzlP8b.css +1 -0
- package/dist/client/assets/dashboard-view-DdGlfuu-.css +1 -0
- package/dist/client/assets/dashboard-view-Ws9_ZnKu.js +21 -0
- package/dist/client/assets/{folder-open-k1xmUMyr.js → folder-open-CHSlllzf.js} +1 -1
- package/dist/client/assets/index-DCovGm5b.css +1 -0
- package/dist/client/assets/index-bEwSVl7B.js +692 -0
- package/dist/client/assets/{star-ne32r3Y4.js → star-BgVwWAPz.js} +1 -1
- package/dist/client/assets/{upload-MS-2Gx53.js → upload-CAzycxr9.js} +1 -1
- package/dist/client/assets/{users-C519GSjH.js → users-CZnxCCCJ.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/client/version.json +1 -1
- package/dist/droid-cli/package.json +1 -1
- package/dist/droid-cli/src/__tests__/index.test.ts +228 -0
- package/dist/extension.js +15810 -10205
- package/dist/pi-claude-cli/package.json +1 -1
- package/dist/pi-claude-cli/src/__tests__/provider.test.ts +36 -22
- package/dist/pi-claude-cli/src/provider.ts +7 -1
- package/dist/plugins/fusion-plugin-cli-printing-press/manifest.json +24 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/package.json +44 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/TestRunnerPanel.test.tsx +99 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/config-flow.test.ts +91 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/dashboard-view.test.tsx +40 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/dashboard-views.test.ts +46 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/draft-store.test.ts +50 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/fixtures/exec-mock.ts +80 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/fixtures/fixtures.test.ts +40 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/fixtures/registry.ts +82 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/generator.test.ts +54 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/manage-view.test.tsx +98 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/manifest.test.ts +36 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/registration.test.ts +29 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/run-routes.test.ts +98 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/runner.test.ts +55 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/runtime-availability.test.ts +61 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/validation.test.ts +30 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/wizard-routes.test.ts +61 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/workflow-integration.test.ts +19 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/dashboard-view.css +43 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/dashboard-view.tsx +49 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/generation/generator.ts +95 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/generation/redact.ts +9 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/generation/runner.ts +79 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/generation/types.ts +31 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/index.ts +58 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/manage/EditDraftModal.tsx +75 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/manage/useDrafts.ts +73 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/manage-view.css +79 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/manage-view.tsx +122 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/routes/wizard-routes.ts +272 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/run/TestRunnerPanel.css +70 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/run/TestRunnerPanel.tsx +98 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/run/useRunGeneratedCli.ts +37 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/runtime/__tests__/executor-runtime-env.test.ts +191 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/runtime/executor-runtime-env.ts +75 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/storage/draft-store.ts +85 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/store/__tests__/cli-press-store.test.ts +128 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/store/__tests__/credentials.test.ts +62 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/store/cli-press-store.ts +427 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/store/cli-press-types.ts +110 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/store/credentials.ts +95 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/wizard/steps.tsx +55 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/wizard/types.ts +33 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/wizard/validation.ts +63 -0
- package/dist/plugins/fusion-plugin-cursor-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-dependency-graph/package.json +1 -1
- package/dist/plugins/fusion-plugin-droid-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-hermes-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-openclaw-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-paperclip-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-reports/manifest.json +10 -0
- package/dist/plugins/fusion-plugin-reports/package.json +18 -2
- package/dist/plugins/fusion-plugin-reports/src/__tests__/approval.test.ts +164 -0
- package/dist/plugins/fusion-plugin-reports/src/__tests__/manifest.test.ts +14 -0
- package/dist/plugins/fusion-plugin-reports/src/__tests__/routes-approval.test.ts +109 -0
- package/dist/plugins/fusion-plugin-reports/src/__tests__/scaffold.test.ts +60 -0
- package/dist/plugins/fusion-plugin-reports/src/__tests__/share-blocks.test.ts +83 -0
- package/dist/plugins/fusion-plugin-reports/src/aggregation.ts +23 -0
- package/dist/plugins/fusion-plugin-reports/src/approval.ts +97 -0
- package/dist/plugins/fusion-plugin-reports/src/cadence.ts +23 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/ReportsView.css +82 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/ReportsView.tsx +24 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/__tests__/ReportComparisonDrawer.test.tsx +12 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/__tests__/ReportDetailPanel.test.tsx +12 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/__tests__/ReportFiltersBar.test.tsx +14 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/__tests__/ReportsView.test.tsx +27 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/__tests__/api.test.ts +19 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/__tests__/useReportSectionDiff.test.ts +11 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/__tests__/useReports.test.ts +13 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/api.ts +85 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/components/ReportApprovalPanel.css +59 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/components/ReportApprovalPanel.tsx +58 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/components/ReportComparisonDrawer.tsx +21 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/components/ReportDetailPanel.tsx +29 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/components/ReportEmptyState.tsx +3 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/components/ReportFiltersBar.tsx +19 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/components/ReportListItem.tsx +8 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/components/ShareBlocksPanel.css +29 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/components/ShareBlocksPanel.tsx +43 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/components/__tests__/ReportApprovalPanel.test.tsx +38 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/components/__tests__/ShareBlocksPanel.test.tsx +24 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/test-setup.ts +18 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/types.ts +22 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/useReportPreview.ts +44 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/useReportSectionDiff.ts +59 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/useReports.ts +71 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard/useViewportMode.ts +13 -0
- package/dist/plugins/fusion-plugin-reports/src/dashboard-view.tsx +6 -0
- package/dist/plugins/fusion-plugin-reports/src/index.ts +48 -2
- package/dist/plugins/fusion-plugin-reports/src/pipeline.ts +58 -0
- package/dist/plugins/fusion-plugin-reports/src/render/__tests__/escape.test.ts +20 -0
- package/dist/plugins/fusion-plugin-reports/src/render/__tests__/html-template.test.ts +110 -0
- package/dist/plugins/fusion-plugin-reports/src/render/__tests__/standalone-html.test.ts +66 -0
- package/dist/plugins/fusion-plugin-reports/src/render/escape.ts +12 -0
- package/dist/plugins/fusion-plugin-reports/src/render/html-styles.ts +40 -0
- package/dist/plugins/fusion-plugin-reports/src/render/html-template.ts +137 -0
- package/dist/plugins/fusion-plugin-reports/src/render/index.ts +4 -0
- package/dist/plugins/fusion-plugin-reports/src/render/standalone-html.ts +75 -0
- package/dist/plugins/fusion-plugin-reports/src/report-schema.ts +31 -0
- package/dist/plugins/fusion-plugin-reports/src/routes/__tests__/report-export-routes.test.ts +104 -0
- package/dist/plugins/fusion-plugin-reports/src/routes/report-approval-routes.ts +98 -0
- package/dist/plugins/fusion-plugin-reports/src/routes/report-export-routes.ts +77 -0
- package/dist/plugins/fusion-plugin-reports/src/routes/report-list-routes.ts +72 -0
- package/dist/plugins/fusion-plugin-reports/src/runs-store.ts +69 -0
- package/dist/plugins/fusion-plugin-reports/src/share-blocks.ts +82 -0
- package/dist/plugins/fusion-plugin-reports/src/store/report-store.ts +51 -2
- package/dist/plugins/fusion-plugin-reports/src/store/report-types.ts +6 -1
- package/dist/plugins/fusion-plugin-roadmap/bundled.js +1672 -0
- package/dist/plugins/fusion-plugin-roadmap/manifest.json +1 -1
- package/dist/plugins/fusion-plugin-roadmap/package.json +4 -41
- package/dist/plugins/fusion-plugin-whatsapp-chat/package.json +1 -1
- package/package.json +2 -3
- package/skill/fusion/references/engine-tools.md +1 -1
- package/skill/fusion/references/extension-tools.md +3 -3
- package/skill/fusion/references/fusion-capabilities.md +1 -1
- package/dist/client/assets/AgentDetailView-BwJaLqZh.css +0 -1
- package/dist/client/assets/AgentDetailView-ZbHEbYRT.js +0 -18
- package/dist/client/assets/ChatView-DhPkiEGs.js +0 -1
- package/dist/client/assets/InsightsView-vp0RE8Mg.js +0 -11
- package/dist/client/assets/NodesView-DMj6HGeC.js +0 -14
- package/dist/client/assets/PluginManager-BtYKm8IT.js +0 -1
- package/dist/client/assets/ResearchView-BhWqfdV0.js +0 -1
- package/dist/client/assets/SettingsModal-BAgB4_AR.js +0 -31
- package/dist/client/assets/SettingsModal-BNSrO1M9.css +0 -1
- package/dist/client/assets/SettingsModal-DzsLquBu.css +0 -1
- package/dist/client/assets/index-Qq2JOOWx.css +0 -1
- package/dist/client/assets/index-TFYXEVpn.js +0 -692
- package/dist/plugins/fusion-plugin-roadmap/src/__tests__/api-client.test.ts +0 -101
- package/dist/plugins/fusion-plugin-roadmap/src/__tests__/index.test.ts +0 -92
- package/dist/plugins/fusion-plugin-roadmap/src/__tests__/roadmap-routes.test.ts +0 -48
- package/dist/plugins/fusion-plugin-roadmap/src/__tests__/roadmap-suggestions.test.ts +0 -31
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/RoadmapsView.css +0 -1299
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/RoadmapsView.tsx +0 -2559
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/__tests__/RoadmapsView.test.tsx +0 -1144
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/__tests__/useRoadmaps.test.ts +0 -1756
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/api.ts +0 -70
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/test-setup.ts +0 -7
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/types.ts +0 -1
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/useConfirm.ts +0 -8
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/useRoadmaps.ts +0 -1188
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/useViewportMode.ts +0 -20
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard-view.tsx +0 -6
- package/dist/plugins/fusion-plugin-roadmap/src/index.ts +0 -74
- package/dist/plugins/fusion-plugin-roadmap/src/roadmap-routes.ts +0 -1
- package/dist/plugins/fusion-plugin-roadmap/src/roadmap-schema.ts +0 -41
- package/dist/plugins/fusion-plugin-roadmap/src/roadmap-suggestions.d.ts +0 -15
- package/dist/plugins/fusion-plugin-roadmap/src/roadmap-suggestions.ts +0 -15
- package/dist/plugins/fusion-plugin-roadmap/src/roadmap-types.d.ts +0 -283
- package/dist/plugins/fusion-plugin-roadmap/src/roadmap-types.d.ts.map +0 -1
- package/dist/plugins/fusion-plugin-roadmap/src/roadmap-types.js +0 -21
- package/dist/plugins/fusion-plugin-roadmap/src/roadmap-types.js.map +0 -1
- package/dist/plugins/fusion-plugin-roadmap/src/roadmap-types.ts +0 -310
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-routes.d.ts +0 -5
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-routes.d.ts.map +0 -1
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-routes.js +0 -361
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-routes.js.map +0 -1
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-routes.ts +0 -408
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-suggestions.d.ts +0 -68
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-suggestions.d.ts.map +0 -1
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-suggestions.js +0 -300
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-suggestions.js.map +0 -1
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-suggestions.ts +0 -381
- package/dist/plugins/fusion-plugin-roadmap/src/server/index.d.ts +0 -3
- package/dist/plugins/fusion-plugin-roadmap/src/server/index.ts +0 -1
- package/dist/plugins/fusion-plugin-roadmap/src/store/__tests__/roadmap-handoff.test.ts +0 -445
- package/dist/plugins/fusion-plugin-roadmap/src/store/__tests__/roadmap-ordering.test.ts +0 -334
- package/dist/plugins/fusion-plugin-roadmap/src/store/__tests__/roadmap-store.test.ts +0 -1318
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-handoff.ts +0 -163
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-ordering.d.ts +0 -37
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-ordering.d.ts.map +0 -1
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-ordering.js +0 -188
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-ordering.js.map +0 -1
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-ordering.ts +0 -311
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-store.d.ts +0 -299
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-store.d.ts.map +0 -1
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-store.js +0 -765
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-store.js.map +0 -1
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-store.ts +0 -1001
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.theme-selector{padding:0 20px 20px}.theme-mode-toggle{display:flex;align-items:center;gap:var(--space-sm);background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:var(--space-xs);margin-bottom:20px}.theme-mode-btn{display:flex;align-items:center;justify-content:center;gap:6px;padding:var(--space-sm) var(--space-lg);background:none;border:none;border-radius:var(--radius-sm);color:var(--text-muted);font-size:13px;font-weight:500;cursor:pointer;transition:all var(--transition-fast);flex:1}.theme-mode-btn:hover{color:var(--text);background:var(--card-hover)}.theme-mode-btn.active,.theme-mode-btn.active:hover{background:var(--todo);color:var(--bg)}.theme-mode-btn:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.theme-section-title{font-size:12px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;margin-bottom:var(--space-md)}.theme-font-size-toggle{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-sm);margin-bottom:var(--space-lg)}.theme-font-size-btn{align-items:center;background:var(--card);border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--text-muted);cursor:pointer;display:inline-flex;font-size:13px;font-weight:500;justify-content:center;min-height:calc(var(--space-2xl) + var(--space-sm));padding:var(--space-sm) var(--space-md);transition:all var(--transition-fast)}.theme-font-size-btn:hover{border-color:var(--todo);color:var(--text)}.theme-font-size-btn.active{background:color-mix(in srgb,var(--todo) 14%,transparent);border-color:var(--todo);color:var(--text)}.theme-font-size-btn:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.theme-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:var(--space-md)}@media(max-width:768px){.theme-grid{grid-template-columns:repeat(2,1fr)}}.theme-option{display:flex;flex-direction:column;align-items:center;gap:var(--space-sm);padding:var(--space-md);background:var(--card);border:2px solid var(--border);border-radius:var(--radius);cursor:pointer;transition:all var(--transition-fast)}.theme-option:hover{border-color:var(--todo);background:var(--card-hover)}.theme-option.active{border-color:var(--todo);background:color-mix(in srgb,var(--todo) 14%,transparent)}.theme-option:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.theme-option-swatch{width:calc(var(--space-2xl) + var(--space-lg));height:calc(var(--space-2xl) + var(--space-lg));border-radius:var(--radius);border:2px solid var(--border);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));overflow:hidden}.theme-option-swatch-sample{display:block;min-height:0}.theme-option-swatch-sample-1{background:var(--swatch-sample-1)}.theme-option-swatch-sample-2{background:var(--swatch-sample-2)}.theme-option-swatch-sample-3{background:var(--swatch-sample-3)}.theme-option-swatch-sample-4{background:var(--swatch-sample-4)}.theme-option-label{font-size:12px;font-weight:500;color:var(--text);text-align:center}.theme-swatch-default{--swatch-sample-1: #0d1117;--swatch-sample-2: #161b22;--swatch-sample-3: #58a6ff;--swatch-sample-4: #79c0ff}.theme-swatch-ocean{--swatch-sample-1: #0a1929;--swatch-sample-2: #132f4c;--swatch-sample-3: #4fc3f7;--swatch-sample-4: #00bcd4}.theme-swatch-forest{--swatch-sample-1: #0d2818;--swatch-sample-2: #1a472a;--swatch-sample-3: #4caf50;--swatch-sample-4: #2e7d32}.theme-swatch-sunset{--swatch-sample-1: #2d1f1f;--swatch-sample-2: #4a2c2c;--swatch-sample-3: #ff8a65;--swatch-sample-4: #ff7043}.theme-swatch-zen{--swatch-sample-1: #0c0c0c;--swatch-sample-2: #111111;--swatch-sample-3: #6b7b8c;--swatch-sample-4: #7a8590}.theme-swatch-berry{--swatch-sample-1: #1a0b2e;--swatch-sample-2: #2d1b4e;--swatch-sample-3: #c084fc;--swatch-sample-4: #ec4899}.theme-swatch-monochrome{--swatch-sample-1: #0d0d0d;--swatch-sample-2: #1a1a1a;--swatch-sample-3: #a3a3a3;--swatch-sample-4: #d4d4d4}.theme-swatch-slate{--swatch-sample-1: #1e293b;--swatch-sample-2: #334155;--swatch-sample-3: #60a5fa;--swatch-sample-4: #22d3ee}.theme-swatch-ash{--swatch-sample-1: #292524;--swatch-sample-2: #44403c;--swatch-sample-3: #a8a29e;--swatch-sample-4: #d6d3d1}.theme-swatch-graphite{--swatch-sample-1: #18181b;--swatch-sample-2: #27272a;--swatch-sample-3: #94a3b8;--swatch-sample-4: #cbd5e1}.theme-swatch-ember{--swatch-sample-1: #18181b;--swatch-sample-2: #27272a;--swatch-sample-3: #f97316;--swatch-sample-4: #ef4444}.theme-swatch-rust{--swatch-sample-1: #0f0b09;--swatch-sample-2: #1a1410;--swatch-sample-3: #e06830;--swatch-sample-4: #e88040}.theme-swatch-copper{--swatch-sample-1: #0e0c0a;--swatch-sample-2: #181410;--swatch-sample-3: #e89545;--swatch-sample-4: #f0a858}.theme-swatch-foundry{--swatch-sample-1: #0c0806;--swatch-sample-2: #15100c;--swatch-sample-3: #ffab20;--swatch-sample-4: #ffc040}.theme-swatch-carbon{--swatch-sample-1: #0a0b0d;--swatch-sample-2: #111318;--swatch-sample-3: #6a9acf;--swatch-sample-4: #7ab0e0}.theme-swatch-sandstone{--swatch-sample-1: #1a1712;--swatch-sample-2: #241f18;--swatch-sample-3: #d4a06a;--swatch-sample-4: #e0b080}.theme-swatch-lagoon{--swatch-sample-1: #0a1214;--swatch-sample-2: #101c1f;--swatch-sample-3: #50d8c0;--swatch-sample-4: #60e8d0}.theme-swatch-frost{--swatch-sample-1: #0c0e14;--swatch-sample-2: #121520;--swatch-sample-3: #8ac8f8;--swatch-sample-4: #9ad8ff}.theme-swatch-lavender{--swatch-sample-1: #14101a;--swatch-sample-2: #1c1624;--swatch-sample-3: #c8a0e8;--swatch-sample-4: #d8b0f0}.theme-swatch-neon-bloom{--swatch-sample-1: #120a18;--swatch-sample-2: #1a1024;--swatch-sample-3: #f080d0;--swatch-sample-4: #ff90e0}.theme-swatch-sepia{--swatch-sample-1: #161210;--swatch-sample-2: #201a16;--swatch-sample-3: #d8b878;--swatch-sample-4: #e8c888}.theme-swatch-silver{--swatch-sample-1: #27272a;--swatch-sample-2: #3f3f46;--swatch-sample-3: #94a3b8;--swatch-sample-4: #e2e8f0}.theme-swatch-high-contrast{--swatch-sample-1: #000000;--swatch-sample-2: #0a0a0a;--swatch-sample-3: #00ffff;--swatch-sample-4: #ffff00}.theme-swatch-industrial{--swatch-sample-1: #0c0c0c;--swatch-sample-2: #141414;--swatch-sample-3: #ff6b00;--swatch-sample-4: #ff8c00}.theme-swatch-solarized{--swatch-sample-1: #002b36;--swatch-sample-2: #073642;--swatch-sample-3: #268bd2;--swatch-sample-4: #2aa198}.theme-swatch-factory{--swatch-sample-1: #0a0a0a;--swatch-sample-2: #111111;--swatch-sample-3: #f59e0b;--swatch-sample-4: #06b6d4}.theme-swatch-ayu{--swatch-sample-1: #0f1419;--swatch-sample-2: #131d27;--swatch-sample-3: #39bae6;--swatch-sample-4: #ffb454}.theme-swatch-one-dark{--swatch-sample-1: #282c34;--swatch-sample-2: #21252b;--swatch-sample-3: #61afef;--swatch-sample-4: #00e5ff}.theme-swatch-nord{--swatch-sample-1: #2e3440;--swatch-sample-2: #3b4252;--swatch-sample-3: #88c0d0;--swatch-sample-4: #81a1c1}.theme-swatch-dracula{--swatch-sample-1: #282a36;--swatch-sample-2: #21222c;--swatch-sample-3: #8be9fd;--swatch-sample-4: #00e5ff}.theme-swatch-gruvbox{--swatch-sample-1: #282828;--swatch-sample-2: #1d2021;--swatch-sample-3: #83a598;--swatch-sample-4: #d3869b}.theme-swatch-tokyo-night{--swatch-sample-1: #1a1b26;--swatch-sample-2: #16161e;--swatch-sample-3: #7aa2f7;--swatch-sample-4: #00e5ff}.theme-swatch-catppuccin-mocha{--swatch-sample-1: #1e1e2e;--swatch-sample-2: #181825;--swatch-sample-3: #89b4fa;--swatch-sample-4: #89dceb}.theme-swatch-github-dark{--swatch-sample-1: #0d1117;--swatch-sample-2: #010409;--swatch-sample-3: #58a6ff;--swatch-sample-4: #79c0ff}.theme-swatch-everforest{--swatch-sample-1: #2d353b;--swatch-sample-2: #272e33;--swatch-sample-3: #7fbbb3;--swatch-sample-4: #e0c8a8}.theme-swatch-rose-pine{--swatch-sample-1: #191724;--swatch-sample-2: #1f1d2e;--swatch-sample-3: #c4a7e7;--swatch-sample-4: #ebbcba}.theme-swatch-kanagawa{--swatch-sample-1: #1f1f28;--swatch-sample-2: #16161d;--swatch-sample-3: #7e9cd8;--swatch-sample-4: #7e9cd8}.theme-swatch-night-owl{--swatch-sample-1: #011627;--swatch-sample-2: #01111d;--swatch-sample-3: #82aaff;--swatch-sample-4: #addb67}.theme-swatch-palenight{--swatch-sample-1: #292d3e;--swatch-sample-2: #1e2235;--swatch-sample-3: #82aaff;--swatch-sample-4: #ffcb6b}.theme-swatch-monokai-pro{--swatch-sample-1: #2d2a2e;--swatch-sample-2: #252229;--swatch-sample-3: #78dce8;--swatch-sample-4: #ff6188}.theme-swatch-slime{--swatch-sample-1: #0a0e09;--swatch-sample-2: #0f150d;--swatch-sample-3: #8aff40;--swatch-sample-4: #40e8a0}.theme-swatch-brutalist{--swatch-sample-1: #101010;--swatch-sample-2: #171717;--swatch-sample-3: #ff6a00;--swatch-sample-4: #ffd100}.theme-swatch-neon-city{--swatch-sample-1: #0d0d15;--swatch-sample-2: #121326;--swatch-sample-3: #ff2d95;--swatch-sample-4: #00f0ff}.theme-swatch-parchment{--swatch-sample-1: #1b1712;--swatch-sample-2: #252019;--swatch-sample-3: #d08a4b;--swatch-sample-4: #be6e3c}.theme-swatch-terminal{--swatch-sample-1: #0a0a0a;--swatch-sample-2: #0f120d;--swatch-sample-3: #33ff00;--swatch-sample-4: #8fff38}.theme-swatch-glass{--swatch-sample-1: #13111f;--swatch-sample-2: color-mix(in srgb, #221b34 78%, transparent);--swatch-sample-3: #c86bff;--swatch-sample-4: #ff7aa8}.theme-swatch-horizon{--swatch-sample-1: #1c1e26;--swatch-sample-2: #16161c;--swatch-sample-3: #e59371;--swatch-sample-4: #f08c42}.theme-swatch-vitesse{--swatch-sample-1: #121817;--swatch-sample-2: #0d1210;--swatch-sample-3: #4c9a91;--swatch-sample-4: #dca561}.theme-swatch-outrun{--swatch-sample-1: #0a0a14;--swatch-sample-2: #0d0d1a;--swatch-sample-3: #ff2d95;--swatch-sample-4: #b537f2}.theme-swatch-snazzy{--swatch-sample-1: #282a36;--swatch-sample-2: #1e1f29;--swatch-sample-3: #ff5c57;--swatch-sample-4: #5af78e}.theme-swatch-porple{--swatch-sample-1: #292d3e;--swatch-sample-2: #1e2030;--swatch-sample-3: #c792ea;--swatch-sample-4: #82aaff}.theme-swatch-espresso{--swatch-sample-1: #2c1f1a;--swatch-sample-2: #231813;--swatch-sample-3: #d4a574;--swatch-sample-4: #c17d56}.theme-swatch-mars{--swatch-sample-1: #1a1210;--swatch-sample-2: #140e0c;--swatch-sample-3: #c1440e;--swatch-sample-4: #e77d3d}.theme-swatch-poimandres{--swatch-sample-1: #1a1b26;--swatch-sample-2: #14151f;--swatch-sample-3: #89ddff;--swatch-sample-4: #5de4c7}[data-theme=light] .theme-swatch-factory{--swatch-sample-1: #f5f5f5;--swatch-sample-2: #ffffff;--swatch-sample-3: #d97706;--swatch-sample-4: #0891b2}[data-theme=light] .theme-swatch-ayu{--swatch-sample-1: #fafafa;--swatch-sample-2: #f3f3f3;--swatch-sample-3: #007acc;--swatch-sample-4: #ff8f40}[data-theme=light] .theme-swatch-zen{--swatch-sample-1: #f5f5f5;--swatch-sample-2: #fafafa;--swatch-sample-3: #5a6a7a;--swatch-sample-4: #6a757f}[data-theme=light] .theme-swatch-nord{--swatch-sample-1: #eceff4;--swatch-sample-2: #e5e9f0;--swatch-sample-3: #5e81ac;--swatch-sample-4: #5e81ac}[data-theme=light] .theme-swatch-dracula{--swatch-sample-1: #f8f8f2;--swatch-sample-2: #efeefa;--swatch-sample-3: #0097a7;--swatch-sample-4: #00bcd4}[data-theme=light] .theme-swatch-gruvbox{--swatch-sample-1: #fbf1c7;--swatch-sample-2: #f2e5bc;--swatch-sample-3: #076678;--swatch-sample-4: #8f3f71}[data-theme=light] .theme-swatch-tokyo-night{--swatch-sample-1: #e1e2e7;--swatch-sample-2: #d5d6db;--swatch-sample-3: #3b5ea5;--swatch-sample-4: #00bcd4}[data-theme=light] .theme-swatch-catppuccin-mocha{--swatch-sample-1: #eff1f5;--swatch-sample-2: #e6e9ef;--swatch-sample-3: #1e66f5;--swatch-sample-4: #04a5e5}[data-theme=light] .theme-swatch-github-dark{--swatch-sample-1: #ffffff;--swatch-sample-2: #f6f8fa;--swatch-sample-3: #0969da;--swatch-sample-4: #0969da}[data-theme=light] .theme-swatch-everforest{--swatch-sample-1: #fdf6e3;--swatch-sample-2: #f4f0d9;--swatch-sample-3: #3a94a5;--swatch-sample-4: #83a08a}[data-theme=light] .theme-swatch-rose-pine{--swatch-sample-1: #faf4ed;--swatch-sample-2: #fffaf3;--swatch-sample-3: #907aa9;--swatch-sample-4: #b4637a}[data-theme=light] .theme-swatch-kanagawa{--swatch-sample-1: #edeadd;--swatch-sample-2: #e1ddd4;--swatch-sample-3: #4e76b5;--swatch-sample-4: #4e76b5}[data-theme=light] .theme-swatch-one-dark{--swatch-sample-1: #fafafa;--swatch-sample-2: #f0f0f0;--swatch-sample-3: #4078f2;--swatch-sample-4: #0184bc}[data-theme=light] .theme-swatch-night-owl{--swatch-sample-1: #f6f7f9;--swatch-sample-2: #eef0f4;--swatch-sample-3: #2563eb;--swatch-sample-4: #5a9e2f}[data-theme=light] .theme-swatch-palenight{--swatch-sample-1: #f5f7fa;--swatch-sample-2: #ebeef5;--swatch-sample-3: #3b6fcf;--swatch-sample-4: #c49020}[data-theme=light] .theme-swatch-monokai-pro{--swatch-sample-1: #faf8f5;--swatch-sample-2: #f0ece5;--swatch-sample-3: #2d8fa0;--swatch-sample-4: #c4405e}[data-theme=light] .theme-swatch-slime{--swatch-sample-1: #f2f7ea;--swatch-sample-2: #e6efda;--swatch-sample-3: #3d8f10;--swatch-sample-4: #1a8a6a}[data-theme=light] .theme-swatch-brutalist{--swatch-sample-1: #ece9e4;--swatch-sample-2: #f7f4ef;--swatch-sample-3: #d9480f;--swatch-sample-4: #b8860b}[data-theme=light] .theme-swatch-neon-city{--swatch-sample-1: #f7f5ff;--swatch-sample-2: #f1edff;--swatch-sample-3: #cc166e;--swatch-sample-4: #008e9b}[data-theme=light] .theme-swatch-parchment{--swatch-sample-1: #f5f0e8;--swatch-sample-2: #efe7dc;--swatch-sample-3: #a8562f;--swatch-sample-4: #8f4e2a}[data-theme=light] .theme-swatch-terminal{--swatch-sample-1: #e7f5dd;--swatch-sample-2: #deefd2;--swatch-sample-3: #2d6b14;--swatch-sample-4: #4c8f25}[data-theme=light] .theme-swatch-glass{--swatch-sample-1: #eceaf5;--swatch-sample-2: color-mix(in srgb, #ffffff 75%, transparent);--swatch-sample-3: #9d40cf;--swatch-sample-4: #c74b7a}[data-theme=light] .theme-swatch-slate{--swatch-sample-1: #f1f5f9;--swatch-sample-2: #e2e8f0;--swatch-sample-3: #3b5ea5;--swatch-sample-4: #4f7090}[data-theme=light] .theme-swatch-ash{--swatch-sample-1: #fafaf9;--swatch-sample-2: #f5f5f4;--swatch-sample-3: #5a6a7a;--swatch-sample-4: #768694}[data-theme=light] .theme-swatch-graphite{--swatch-sample-1: #fafafa;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #6f7f90;--swatch-sample-4: #8a99aa}[data-theme=light] .theme-swatch-ember{--swatch-sample-1: #fafafa;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #d9480f;--swatch-sample-4: #e8646a}[data-theme=light] .theme-swatch-rust{--swatch-sample-1: #f5efe8;--swatch-sample-2: #ebe3d8;--swatch-sample-3: #a04020;--swatch-sample-4: #b85828}[data-theme=light] .theme-swatch-copper{--swatch-sample-1: #f3ede6;--swatch-sample-2: #e8e0d6;--swatch-sample-3: #905820;--swatch-sample-4: #a87030}[data-theme=light] .theme-swatch-foundry{--swatch-sample-1: #f5f0e6;--swatch-sample-2: #ebe4d6;--swatch-sample-3: #c07808;--swatch-sample-4: #d08a10}[data-theme=light] .theme-swatch-carbon{--swatch-sample-1: #eef0f4;--swatch-sample-2: #e2e6ec;--swatch-sample-3: #3a6090;--swatch-sample-4: #4878a0}[data-theme=light] .theme-swatch-sandstone{--swatch-sample-1: #f5f0e8;--swatch-sample-2: #ebe4d8;--swatch-sample-3: #a07040;--swatch-sample-4: #b08050}[data-theme=light] .theme-swatch-lagoon{--swatch-sample-1: #eef5f3;--swatch-sample-2: #e0ebe8;--swatch-sample-3: #208070;--swatch-sample-4: #289080}[data-theme=light] .theme-swatch-frost{--swatch-sample-1: #f0f4f8;--swatch-sample-2: #e4eaf0;--swatch-sample-3: #3078a8;--swatch-sample-4: #4088b8}[data-theme=light] .theme-swatch-lavender{--swatch-sample-1: #f4f0f8;--swatch-sample-2: #e8e2f0;--swatch-sample-3: #8060a0;--swatch-sample-4: #9070b0}[data-theme=light] .theme-swatch-neon-bloom{--swatch-sample-1: #f8f0f8;--swatch-sample-2: #f0e4f0;--swatch-sample-3: #a03090;--swatch-sample-4: #b040a0}[data-theme=light] .theme-swatch-sepia{--swatch-sample-1: #f5f0e4;--swatch-sample-2: #ece4d4;--swatch-sample-3: #907040;--swatch-sample-4: #a08050}[data-theme=light] .theme-swatch-silver{--swatch-sample-1: #fafafa;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #6b7280;--swatch-sample-4: #9ca3af}[data-theme=light] .theme-swatch-horizon{--swatch-sample-1: #fdf0ed;--swatch-sample-2: #f9cec0;--swatch-sample-3: #e8646a;--swatch-sample-4: #f08c42}[data-theme=light] .theme-swatch-vitesse{--swatch-sample-1: #f8f5f0;--swatch-sample-2: #efe9e0;--swatch-sample-3: #3a8578;--swatch-sample-4: #c08040}[data-theme=light] .theme-swatch-outrun{--swatch-sample-1: #f0f0f5;--swatch-sample-2: #e8e8ef;--swatch-sample-3: #d02080;--swatch-sample-4: #9030c8}[data-theme=light] .theme-swatch-snazzy{--swatch-sample-1: #fafafa;--swatch-sample-2: #f0f0f2;--swatch-sample-3: #d04040;--swatch-sample-4: #30a050}[data-theme=light] .theme-swatch-porple{--swatch-sample-1: #f5f3f7;--swatch-sample-2: #eae7ef;--swatch-sample-3: #9060d8;--swatch-sample-4: #4080c8}[data-theme=light] .theme-swatch-espresso{--swatch-sample-1: #f5ece4;--swatch-sample-2: #ebe1d6;--swatch-sample-3: #a07050;--swatch-sample-4: #906040}[data-theme=light] .theme-swatch-mars{--swatch-sample-1: #f5ece6;--swatch-sample-2: #ebe0d4;--swatch-sample-3: #a03010;--swatch-sample-4: #c06030}[data-theme=light] .theme-swatch-poimandres{--swatch-sample-1: #f0f0f5;--swatch-sample-2: #e6e6ee;--swatch-sample-3: #4090c0;--swatch-sample-4: #30a090}.theme-reset-btn{display:flex;align-items:center;justify-content:center;gap:var(--space-sm);margin-top:20px;padding:10px 16px;background:var(--card);border:1px solid var(--border);border-radius:var(--radius);color:var(--text-muted);font-size:13px;font-weight:500;cursor:pointer;transition:all var(--transition-fast);width:100%}.theme-reset-btn:hover{background:var(--card-hover);color:var(--text);border-color:var(--text-muted)}.theme-reset-btn:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.theme-current-preview{display:flex;align-items:center;gap:var(--space-md);padding:var(--space-md) var(--space-lg);background:var(--card);border:1px solid var(--border);border-radius:var(--radius);margin-bottom:20px}.theme-preview-icon{display:flex;align-items:center;justify-content:center;width:40px;height:40px;background:var(--surface);border-radius:var(--radius);color:var(--todo)}.theme-preview-info{flex:1}.theme-preview-label{font-size:12px;color:var(--text-muted);margin-bottom:2px}.theme-preview-value{font-size:14px;font-weight:600;color:var(--text);text-transform:capitalize}@media(max-width:768px){.model-combobox-dropdown{max-height:50vh;width:min(360px,calc(100vw - 32px))}.model-combobox-search{font-size:16px}.model-combobox-option{min-height:36px}.theme-selector{padding:0 14px 14px}.theme-font-size-toggle{grid-template-columns:1fr}}.cli-binary-panel{display:flex;flex-direction:column;gap:12px;padding:0 var(--space-xl);margin-top:var(--space-lg);border:0;background:transparent}.cli-binary-header{display:flex;align-items:center;justify-content:space-between;gap:12px}.cli-binary-header .settings-section-heading{margin:0}.cli-binary-pill{display:inline-flex;align-items:center;padding:2px 10px;border-radius:999px;font-size:11px;font-weight:600;letter-spacing:.02em;text-transform:uppercase}.cli-binary-pill--ok{background:color-mix(in srgb,var(--color-success) 18%,transparent);color:var(--color-success);border:1px solid color-mix(in srgb,var(--color-success) 40%,transparent)}.cli-binary-pill--warn{background:color-mix(in srgb,var(--color-warning) 18%,transparent);color:var(--color-warning);border:1px solid color-mix(in srgb,var(--color-warning) 40%,transparent)}.cli-binary-pill--err{background:color-mix(in srgb,var(--color-error) 18%,transparent);color:var(--color-error);border:1px solid color-mix(in srgb,var(--color-error) 40%,transparent)}.cli-binary-help{color:var(--text-secondary, #98a3b1);line-height:1.4}.cli-binary-help code{background:color-mix(in srgb,var(--text) 6%,transparent);padding:1px 6px;border-radius:4px;font-size:.92em}.cli-binary-status-line{margin:0;color:var(--text-secondary, #98a3b1)}.cli-binary-status-line code{background:color-mix(in srgb,var(--text) 6%,transparent);padding:1px 6px;border-radius:4px}.cli-binary-detail{display:flex;flex-direction:column;gap:12px}.cli-binary-info-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px;font-size:13px}.cli-binary-info-list li{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.cli-binary-info-list span{color:var(--text-secondary, #98a3b1);min-width:64px}.cli-binary-info-list code{background:color-mix(in srgb,var(--text) 6%,transparent);padding:1px 6px;border-radius:4px;word-break:break-all}.cli-binary-expected{color:var(--text-secondary, #98a3b1);font-size:12px}.cli-binary-actions{display:flex;gap:8px;flex-wrap:wrap}.cli-binary-install-btn,.cli-binary-refresh-btn,.cli-binary-copy-btn{cursor:pointer;border-radius:6px;padding:6px 12px;font-size:13px;border:1px solid transparent;transition:background .15s ease,border-color .15s ease}.cli-binary-install-btn{background:var(--accent, #3b82f6);color:var(--accent-text)}.cli-binary-install-btn:hover:not(:disabled){background:var(--accent-hover, #2563eb)}.cli-binary-install-btn:disabled,.cli-binary-refresh-btn:disabled{opacity:.55;cursor:not-allowed}.cli-binary-refresh-btn,.cli-binary-copy-btn{background:color-mix(in srgb,var(--text) 4%,transparent);color:var(--text);border-color:color-mix(in srgb,var(--text) 12%,transparent)}.cli-binary-refresh-btn:hover:not(:disabled),.cli-binary-copy-btn:hover{background:color-mix(in srgb,var(--text) 8%,transparent)}.cli-binary-commands{display:flex;flex-direction:column;gap:6px}.cli-binary-commands label{font-size:12px;color:var(--text-secondary, #98a3b1);text-transform:uppercase;letter-spacing:.04em}.cli-binary-command-row{display:flex;align-items:center;gap:8px;background:color-mix(in srgb,var(--bg) 25%,transparent);border:1px solid color-mix(in srgb,var(--text) 6%,transparent);border-radius:6px;padding:6px 8px 6px 12px}.cli-binary-command-row code{flex:1;font-family:var(--font-mono, ui-monospace, "SFMono-Regular", monospace);font-size:12.5px;color:var(--text-primary, #e6edf3);white-space:nowrap;overflow-x:auto}.cli-binary-install-log{border-top:1px solid color-mix(in srgb,var(--text) 6%,transparent);padding-top:10px;font-size:12.5px}.cli-binary-install-log summary{cursor:pointer;color:var(--text-secondary, #98a3b1)}.cli-binary-install-output{margin:6px 0 0;padding:8px 10px;background:color-mix(in srgb,var(--bg) 35%,transparent);border-radius:4px;max-height:220px;overflow:auto;white-space:pre-wrap;font-size:12px;line-height:1.4}.cli-binary-install-output--err{color:var(--color-error)}.cli-binary-permissions-hint{margin:6px 0;padding:8px 10px;background:color-mix(in srgb,var(--color-error) 10%,transparent);border-left:3px solid color-mix(in srgb,var(--color-error) 55%,transparent);border-radius:0 var(--radius-sm) var(--radius-sm) 0;color:var(--color-error);font-size:12.5px;line-height:1.5}.prompt-manager{display:flex;flex-direction:column;gap:var(--space-md);padding:0 var(--space-xl);margin-top:var(--space-md)}.prompt-manager-tabs{display:flex;gap:var(--space-xs);border-bottom:1px solid var(--border);padding-bottom:var(--space-sm)}.prompt-manager-tab{display:inline-flex;align-items:center;gap:var(--space-xs);padding:var(--space-sm) var(--space-md);background:none;border:1px solid transparent;border-radius:var(--radius-md);color:var(--text-muted);font-size:13px;cursor:pointer;transition:all var(--transition-fast)}.prompt-manager-tab:hover{color:var(--text);background:var(--surface)}.prompt-manager-tab:focus-visible{outline:none;box-shadow:var(--focus-ring-strong);border-color:var(--todo)}.prompt-manager-tab.active{color:var(--text);background:var(--surface);border-color:var(--border)}.prompt-manager-content{min-height:200px}.prompt-manager-templates-tab,.prompt-manager-assignments-tab,.prompt-manager-overrides-tab{display:flex;flex-direction:column;gap:var(--space-lg)}.prompt-template-section{display:flex;flex-direction:column;gap:var(--space-md)}.prompt-template-section-title{font-size:14px;font-weight:600;color:var(--text);margin:0}.prompt-template-section-desc{font-size:12px;color:var(--text-muted);margin:0}.prompt-template-list{display:flex;flex-direction:column;gap:var(--space-md)}.prompt-template-card{padding:var(--space-md);background:var(--card);border:1px solid var(--border);border-radius:var(--radius-md);transition:border-color var(--transition-fast)}.prompt-template-card:hover{border-color:var(--text-dim)}.prompt-template-card-header{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--space-md);margin-bottom:var(--space-sm)}.prompt-template-card-info{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-sm)}.prompt-template-card-name{font-weight:600;color:var(--text);font-size:14px}.prompt-template-badge-built-in,.prompt-template-badge-custom,.prompt-template-badge-override{display:inline-flex;align-items:center;padding:calc(var(--space-xs) * .5) calc(var(--space-xs) * 1.5);font-size:10px;font-weight:500;border-radius:var(--radius-sm);text-transform:uppercase;letter-spacing:.02em}.prompt-template-badge-built-in{background:var(--surface);color:var(--text-muted);border:1px solid var(--border)}.prompt-template-badge-custom{background:color-mix(in srgb,var(--color-info) 15%,transparent);color:var(--color-info)}.prompt-template-badge-override{background:color-mix(in srgb,var(--color-warning) 15%,transparent);color:var(--color-warning)}.prompt-template-badge-role{display:inline-flex;align-items:center;padding:calc(var(--space-xs) * .5) calc(var(--space-xs) * 1.5);font-size:10px;font-weight:500;border-radius:var(--radius-sm)}.prompt-template-badge-built-in,.prompt-template-badge-role,.prompt-role-badge{--prompt-role-color: var(--color-muted)}.prompt-role-tone--executor{--prompt-role-color: var(--todo)}.prompt-role-tone--triage{--prompt-role-color: var(--triage)}.prompt-role-tone--reviewer{--prompt-role-color: var(--in-review)}.prompt-role-tone--merger{--prompt-role-color: var(--done)}.prompt-role-tone--scheduler{--prompt-role-color: var(--color-info)}.prompt-role-tone--engineer{--prompt-role-color: var(--color-warning)}.prompt-role-tone--custom{--prompt-role-color: var(--color-muted)}.prompt-template-badge-role,.prompt-role-badge{background:color-mix(in srgb,var(--prompt-role-color) 15%,transparent);color:var(--prompt-role-color)}.prompt-template-badge-built-in.prompt-role-tone--executor,.prompt-template-badge-built-in.prompt-role-tone--triage,.prompt-template-badge-built-in.prompt-role-tone--reviewer,.prompt-template-badge-built-in.prompt-role-tone--merger,.prompt-template-badge-built-in.prompt-role-tone--scheduler,.prompt-template-badge-built-in.prompt-role-tone--engineer,.prompt-template-badge-built-in.prompt-role-tone--custom{border-color:var(--prompt-role-color)}.prompt-template-card-actions{display:flex;gap:var(--space-xs)}.prompt-template-card-actions .btn-icon{padding:var(--space-xs)}.prompt-template-card-description{font-size:12px;color:var(--text-muted);margin:0 0 var(--space-sm) 0;line-height:1.4}.prompt-template-card-preview{background:var(--surface);border-radius:var(--radius-sm);padding:var(--space-sm);overflow:hidden}.prompt-template-card-preview code{font-size:calc(var(--space-sm) + var(--space-xs) * .75);color:var(--text-muted);font-family:var(--font-mono);white-space:pre-wrap;word-break:break-word;display:block;max-height:120px;overflow-y:auto}.prompt-template-empty{padding:var(--space-lg);text-align:center;color:var(--text-muted);font-size:13px;background:var(--surface);border:1px dashed var(--border);border-radius:var(--radius-md)}.prompt-template-add-btn{align-self:flex-start;margin-top:var(--space-sm)}.prompt-template-editor{padding:var(--space-lg);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);margin-bottom:var(--space-lg)}.prompt-template-editor-title{font-size:14px;font-weight:600;color:var(--text);margin:0 0 var(--space-md) 0}.prompt-template-editor-fields{display:flex;flex-direction:column;gap:var(--space-md)}.prompt-template-field{display:flex;flex-direction:column;gap:var(--space-xs)}.prompt-template-field label{font-size:12px;font-weight:500;color:var(--text-muted)}.prompt-template-field input,.prompt-template-field select,.prompt-template-prompt-textarea{padding:var(--space-sm) var(--space-md);background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-md);color:var(--text);font-size:13px;transition:border-color var(--transition-fast)}.prompt-template-field input:focus,.prompt-template-field select:focus,.prompt-template-prompt-textarea:focus{outline:none;border-color:var(--todo)}.prompt-template-prompt-textarea{font-family:var(--font-mono);font-size:12px;line-height:1.5;resize:vertical;min-height:120px}.prompt-template-error{padding:var(--space-sm);background:color-mix(in srgb,var(--color-error) 10%,transparent);border:1px solid var(--color-error);border-radius:var(--radius-sm);color:var(--color-error);font-size:12px}.prompt-template-editor-actions{display:flex;gap:var(--space-sm);justify-content:flex-end;margin-top:var(--space-sm)}.prompt-template-delete-confirm{padding:var(--space-md);background:color-mix(in srgb,var(--color-error) 10%,transparent);border:1px solid var(--color-error);border-radius:var(--radius-md);display:flex;flex-direction:column;gap:var(--space-sm)}.prompt-template-delete-confirm p{margin:0;font-size:13px;color:var(--text)}.prompt-template-delete-actions{display:flex;gap:var(--space-sm)}.prompt-assignments-desc{font-size:12px;color:var(--text-muted);margin:0}.prompt-role-assignment-list{display:flex;flex-direction:column;gap:var(--space-md)}.prompt-role-assignment-row{display:flex;align-items:center;justify-content:space-between;gap:var(--space-lg);padding:var(--space-md);background:var(--card);border:1px solid var(--border);border-radius:var(--radius-md)}.prompt-role-assignment-label{display:flex;align-items:center;gap:var(--space-md)}.prompt-role-badge{display:inline-flex;align-items:center;padding:var(--space-xs) var(--space-sm);font-size:12px;font-weight:600;border-radius:var(--radius-sm)}.prompt-role-assignment-status{font-size:12px;color:var(--text-muted)}.prompt-role-select{min-width:200px;padding:var(--space-sm) var(--space-md);background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-md);color:var(--text);font-size:13px;cursor:pointer}.prompt-role-select:focus{outline:none;border-color:var(--todo)}.prompt-role-select:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.prompt-assignments-note{margin-top:var(--space-md);padding:var(--space-md);background:var(--surface);border-radius:var(--radius-md);font-size:12px;color:var(--text-muted);line-height:1.5}.prompt-assignments-note strong{color:var(--text)}.prompt-overrides-desc{font-size:12px;color:var(--text-muted);margin:0}.prompt-overrides-list{display:flex;flex-direction:column;gap:var(--space-md)}.prompt-override-item{background:var(--card);border:1px solid var(--border);border-radius:var(--radius-md);overflow:hidden}.prompt-override-header{display:flex;align-items:center;justify-content:space-between;padding:var(--space-md);cursor:pointer;transition:background var(--transition-fast)}.prompt-override-header:hover{background:var(--card-hover)}.prompt-override-info{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-sm);flex:1;min-width:0;border:none;background:none;color:inherit;padding:0;text-align:left;font:inherit;cursor:pointer;border-radius:var(--radius-sm)}.prompt-override-info:focus-visible{outline:none;box-shadow:var(--focus-ring-strong)}.prompt-override-name{font-weight:600;color:var(--text);font-size:13px}.prompt-override-key{font-size:11px;font-family:var(--font-mono);color:var(--text-muted);padding:calc(var(--space-xs) * .5) var(--space-xs);background:var(--surface);border-radius:var(--radius-sm)}.prompt-override-badge{display:inline-flex;align-items:center;padding:calc(var(--space-xs) * .5) calc(var(--space-xs) * 1.5);font-size:10px;font-weight:500;background:color-mix(in srgb,var(--color-warning) 15%,transparent);color:var(--color-warning);border-radius:var(--radius-sm)}.prompt-override-expand-btn{display:flex;align-items:center;justify-content:center;width:var(--space-xl);height:var(--space-xl);background:none;border:none;color:var(--text-muted);cursor:pointer;border-radius:var(--radius-sm);transition:color var(--transition-fast),background var(--transition-fast)}.prompt-override-expand-btn:hover{color:var(--text);background:var(--surface)}.prompt-override-expand-btn:focus-visible{outline:none;box-shadow:var(--focus-ring-strong);color:var(--text);background:var(--surface)}.prompt-override-description{font-size:12px;color:var(--text-muted);margin:0;padding:0 var(--space-md) var(--space-md);line-height:1.4}.prompt-override-editor{padding:var(--space-md);border-top:1px solid var(--border);background:var(--surface);display:flex;flex-direction:column;gap:var(--space-sm)}.prompt-override-textarea{padding:var(--space-sm) var(--space-md);background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-md);color:var(--text);font-size:12px;font-family:var(--font-mono);line-height:1.5;resize:vertical;min-height:calc(var(--space-xl) * 3 + var(--space-sm));transition:border-color var(--transition-fast)}.prompt-override-textarea:focus{outline:none;border-color:var(--todo)}.prompt-override-footer{display:flex;align-items:center;gap:var(--space-md)}.prompt-override-hint{font-size:calc(var(--space-sm) + var(--space-xs) * .75);color:var(--text-muted)}.prompt-override-header-actions{display:flex;align-items:center;gap:var(--space-xs)}.prompt-override-fullscreen-btn{display:flex;align-items:center;justify-content:center;width:var(--space-xl);height:var(--space-xl);background:none;border:none;color:var(--text-muted);cursor:pointer;border-radius:var(--radius-sm);transition:color var(--transition-fast),background var(--transition-fast)}.prompt-override-fullscreen-btn:hover{color:var(--text);background:var(--surface)}.prompt-override-fullscreen-btn:focus-visible{outline:none;box-shadow:var(--focus-ring-strong);color:var(--text);background:var(--surface)}.prompt-override-fullscreen{position:fixed;inset:0;z-index:10000;background:var(--surface);padding:max(var(--space-lg),env(safe-area-inset-top,0px)) max(var(--space-lg),env(safe-area-inset-right,0px)) max(var(--space-lg),env(safe-area-inset-bottom,0px)) max(var(--space-lg),env(safe-area-inset-left,0px));display:flex;flex-direction:column}.prompt-override-fullscreen-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-md);flex-shrink:0}.prompt-override-fullscreen-title{font-size:13px;font-weight:600;color:var(--text);display:flex;align-items:center;gap:var(--space-sm)}.prompt-override-fullscreen-close{display:flex;align-items:center;justify-content:center;gap:var(--space-xs);padding:var(--space-xs) var(--space-sm);background:none;border:1px solid var(--border);border-radius:var(--radius-md);color:var(--text-muted);cursor:pointer;font-size:12px;transition:all var(--transition-fast)}.prompt-override-fullscreen-close:hover{color:var(--text);border-color:var(--text-muted)}.prompt-override-fullscreen-close:focus-visible{outline:none;box-shadow:var(--focus-ring-strong)}.prompt-override-fullscreen textarea{flex:1;min-height:unset;resize:none;border-radius:var(--radius-md);font-size:14px;line-height:1.6}.prompt-template-fullscreen-pre{flex:1;font-family:var(--font-mono);font-size:13px;line-height:1.6;color:var(--text);white-space:pre-wrap;word-break:break-word;overflow-y:auto;padding:var(--space-md);background:var(--bg);border-radius:var(--radius-md);border:1px solid var(--border);margin:0}.prompt-override-fullscreen .prompt-override-footer{flex-shrink:0;padding-top:var(--space-sm)}.prompt-template-prompt-label-row{display:flex;align-items:center;gap:var(--space-sm);margin-bottom:var(--space-xs)}.prompt-template-prompt-label-row label{display:block}.prompt-template-fullscreen-btn{vertical-align:middle}.prompt-template-prompt-label-row .prompt-template-fullscreen-btn{margin-left:var(--space-xs)}@media(max-width:768px){.prompt-manager{padding:0 var(--space-lg)}.prompt-manager-tabs{flex-wrap:wrap}.prompt-manager-tab{flex:1;justify-content:center;min-width:calc(50% - var(--space-xs))}.prompt-role-assignment-row{flex-direction:column;align-items:stretch;gap:var(--space-sm)}.prompt-role-select{width:100%}.prompt-template-editor-actions{flex-direction:column}.prompt-template-editor-actions .btn{width:100%}.prompt-override-fullscreen{padding:max(var(--space-md),env(safe-area-inset-top,0px)) max(var(--space-md),env(safe-area-inset-right,0px)) max(var(--space-md),env(safe-area-inset-bottom,0px)) max(var(--space-md),env(safe-area-inset-left,0px))}.prompt-override-fullscreen textarea{font-size:16px}.prompt-override-expand-btn,.prompt-override-fullscreen-btn{width:calc(var(--space-lg) * 2 + var(--space-xs));height:calc(var(--space-lg) * 2 + var(--space-xs))}}@keyframes custom-provider-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.custom-providers-section .onboarding-disclosure-content{margin-top:var(--space-sm);display:flex;flex-direction:column;gap:var(--space-sm)}.custom-provider-list{display:flex;flex-direction:column;gap:var(--space-sm)}.custom-provider-item{display:flex;align-items:center;justify-content:space-between;padding:var(--space-sm) var(--space-md);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);transition:border-color var(--transition-fast),box-shadow var(--transition-fast)}.custom-provider-item:hover{border-color:var(--text-dim)}.custom-provider-item-info{display:flex;flex-direction:column;gap:var(--space-xs);min-width:0}.custom-provider-item-name{font-weight:600;color:var(--text)}.custom-provider-item-meta{color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.custom-provider-item-actions{display:flex;gap:var(--space-xs);flex-shrink:0}.custom-provider-badge{display:inline-flex;align-items:center;padding:var(--space-xs);border-radius:var(--radius-pill);background:color-mix(in srgb,var(--color-info) 15%,transparent);color:var(--color-info)}.custom-provider-empty{color:var(--text-muted);padding:var(--space-sm) 0}.custom-provider-add-btn{margin-top:var(--space-sm)}.custom-provider-form{padding:var(--space-md);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);margin-top:var(--space-sm)}.custom-provider-form-row{margin-bottom:var(--space-sm)}.custom-provider-form-actions{display:flex;gap:var(--space-sm);margin-top:var(--space-md)}.custom-provider-form-error{display:flex;align-items:center;gap:var(--space-xs);color:var(--color-error);margin-top:var(--space-xs);background:color-mix(in srgb,var(--color-error) 10%,transparent);padding:var(--space-xs) var(--space-sm);border-radius:var(--radius-sm)}.custom-provider-item-edit-form{margin-top:var(--space-xs)}.spin{animation:custom-provider-spin calc(var(--transition-slow) * 4) linear infinite}@media(max-width:768px){.custom-provider-item{flex-direction:column;align-items:flex-start;gap:var(--space-xs)}.custom-provider-item-meta{max-width:100%}.custom-provider-form{padding:var(--space-sm)}.custom-provider-item-actions{align-self:flex-end;margin-top:var(--space-xs)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,j as e}from"./vendor-react-K0fH_qHe.js";import{cg as w,a$ as L,ch as O,ci as _,cj as $,X as W,b as Y,C as k,L as G}from"./index-TFYXEVpn.js";import{D as q}from"./DirectoryPicker-D5UIeIl6.js";import{s as f}from"./projectDetection-G3XuxD2X.js";import"./vendor-xterm-DzcZoU0P.js";import"./folder-open-k1xmUMyr.js";function V({onProjectRegistered:m,onClose:p}){const C="https://github.com/runfusion/fusion/discussions",[z,y]=o.useState(!0),[s,n]=o.useState(()=>({step:w()?"manual":"auth",manualMode:"existing",manualPath:"",manualCloneUrl:"",manualName:"",manualIsolationMode:"in-process",manualNodeId:"",isRegistering:!1,error:null})),[j,M]=o.useState(!1),[i,c]=o.useState(""),[u,x]=o.useState(()=>w()),{nodes:g,loading:I}=L(),S=g.find(a=>a.type==="local")?.id,N=o.useCallback(()=>{y(!1),p?.()},[p]),P=o.useCallback(a=>{n(t=>{const d={manualPath:a};return a&&(!t.manualName||t.manualName===f(t.manualPath))&&(d.manualName=f(a)),{...t,...d}})},[]),R=o.useCallback(async()=>{const a=s.manualPath.trim(),t=s.manualName.trim(),d=s.manualCloneUrl.trim();if(!(!a||!t)&&!(s.manualMode==="clone"&&!d)){n(r=>({...r,isRegistering:!0,error:null}));try{const r={name:t,path:a,isolationMode:s.manualIsolationMode,nodeId:s.manualNodeId||void 0,cloneUrl:s.manualMode==="clone"?d:void 0},h=await O(r);m(h),n(B=>({...B,step:"complete",isRegistering:!1}))}catch(r){n(h=>({...h,isRegistering:!1,error:r instanceof Error?r.message:"Failed to register project"}))}}},[s.manualPath,s.manualName,s.manualCloneUrl,s.manualMode,s.manualIsolationMode,s.manualNodeId,m]),v=o.useCallback(()=>{const a=i.trim();a&&(_(a),x(a),c(""),n(t=>t.step==="auth"?{...t,step:"manual"}:t))},[i]),A=o.useCallback(()=>{$(),x(void 0),c("")},[]),F=o.useCallback(()=>{n(a=>({...a,step:"manual"}))},[]);if(!z)return null;const b=s.manualMode==="existing",l=s.manualMode==="clone",T=s.manualPath.trim().length>0,U=s.manualName.trim().length>0,D=s.manualCloneUrl.trim().length>0,E=s.isRegistering||!T||!U||l&&!D;return e.jsx("div",{className:"modal-overlay open setup-wizard-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"wizard-title",children:e.jsxs("div",{className:"modal setup-wizard-modal",children:[e.jsxs("div",{className:"setup-wizard-header",children:[e.jsxs("div",{className:"setup-wizard-heading",children:[e.jsxs("div",{className:"setup-wizard-brand","aria-label":"Fusion",children:[e.jsxs("svg",{className:"setup-wizard-brand-logo",width:28,height:28,viewBox:"0 0 128 128",fill:"none","aria-label":"Fusion logo",role:"img",children:[e.jsx("circle",{cx:"64",cy:"64",r:"52",stroke:"currentColor",strokeWidth:"8"}),e.jsx("path",{d:"M26 101C44 82 62 64 82 45C90 37 98 30 104 24C96 35 89 47 81 60C70 79 57 95 43 108C38 112 32 108 26 101Z",fill:"currentColor"})]}),e.jsx("span",{className:"setup-wizard-brand-name",children:"Fusion"})]}),e.jsxs("h2",{id:"wizard-title",className:"setup-wizard-title",children:[s.step==="auth"&&"Set Auth Token",s.step==="manual"&&"Welcome to Fusion",s.step==="complete"&&"Setup Complete!"]})]}),s.step!=="complete"&&e.jsx("button",{className:"modal-close",onClick:N,"aria-label":"Close wizard",children:e.jsx(W,{size:20})})]}),e.jsxs("div",{className:"setup-wizard-content",children:[s.step==="auth"&&e.jsxs("div",{className:"setup-wizard-auth-step",children:[e.jsx("p",{className:"setup-wizard-auth-step-description",children:"This dashboard requires an auth token to communicate with the Fusion daemon. Paste the token below to continue."}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"setup-auth-token",children:"Auth Token"}),e.jsx("input",{id:"setup-auth-token",type:"password",value:i,onChange:a=>c(a.target.value),placeholder:"Paste the daemon auth token",autoComplete:"off",spellCheck:!1,autoFocus:!0}),e.jsxs("p",{className:"form-hint",children:["The token was set via the ",e.jsx("code",{children:"FUSION_DAEMON_TOKEN"})," environment variable when starting the dashboard."]})]}),s.error&&e.jsx("div",{className:"wizard-error",role:"alert",children:s.error})]}),s.step==="manual"&&e.jsxs("div",{className:"setup-wizard-manual",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"project-name",children:"Project Name"}),e.jsx("input",{id:"project-name",type:"text",value:s.manualName,onChange:a=>n(t=>({...t,manualName:a.target.value})),placeholder:"my-project"}),e.jsx("p",{className:"form-hint",children:l?"By default this follows the destination folder name unless you edit it.":"By default this follows the selected directory name unless you edit it."})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"project-path",children:l?"Destination Directory":"Project Directory"}),e.jsx(q,{value:s.manualPath,onChange:P,nodeId:s.manualNodeId||void 0,localNodeId:S,placeholder:l?"/path/for/new-clone":"/path/to/your/project"}),e.jsx("p",{className:"form-hint",children:l?"Select or type an absolute destination path. Fusion will clone into this directory.":"Select or type the absolute path to your project"})]}),e.jsxs("div",{className:"setup-wizard-advanced",children:[e.jsxs("button",{type:"button",className:"setup-wizard-advanced-toggle","aria-expanded":j,onClick:()=>M(a=>!a),children:[e.jsx(Y,{size:16,className:"setup-wizard-advanced-chevron"}),e.jsx("span",{children:"Advanced settings"})]}),j&&e.jsxs("div",{className:"setup-wizard-advanced-panel",children:[e.jsxs("fieldset",{className:"setup-wizard-mode-switch","aria-label":"Project setup mode",children:[e.jsx("legend",{children:"Setup Mode"}),e.jsxs("label",{className:`setup-wizard-mode-option${b?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"setup-mode",value:"existing",checked:b,onChange:()=>n(a=>({...a,manualMode:"existing",error:null}))}),e.jsx("span",{children:"Use Existing Directory"})]}),e.jsxs("label",{className:`setup-wizard-mode-option${l?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"setup-mode",value:"clone",checked:l,onChange:()=>n(a=>({...a,manualMode:"clone",error:null}))}),e.jsx("span",{children:"Clone Git Repository"})]})]}),l&&e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"project-clone-url",children:"Repository URL"}),e.jsx("input",{id:"project-clone-url",type:"text",value:s.manualCloneUrl,onChange:a=>n(t=>({...t,manualCloneUrl:a.target.value})),placeholder:"https://github.com/owner/repo.git"}),e.jsx("p",{className:"form-hint",children:"Fusion will run git clone into the destination directory, then register that cloned folder."})]}),e.jsx("div",{className:"form-group",children:e.jsxs("div",{className:"project-node-selector",children:[e.jsx("span",{className:"project-node-selector__label",children:"Runtime Node"}),e.jsxs("select",{value:s.manualNodeId,onChange:a=>n(t=>({...t,manualNodeId:a.target.value})),disabled:I||s.isRegistering,children:[e.jsx("option",{value:"",children:"Local node"}),g.map(a=>e.jsxs("option",{value:a.id,children:[a.name," (",a.type,")"]},a.id))]})]})}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"Isolation Mode"}),e.jsxs("div",{className:"setup-wizard-isolation-options",children:[e.jsxs("label",{className:`setup-wizard-isolation-option${s.manualIsolationMode==="in-process"?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"isolation-mode",value:"in-process",checked:s.manualIsolationMode==="in-process",onChange:()=>n(a=>({...a,manualIsolationMode:"in-process"}))}),e.jsxs("div",{className:"setup-wizard-isolation-option-content",children:[e.jsx("strong",{children:"In-Process"}),e.jsx("span",{children:"Lower overhead, shared memory. Best for most projects."}),e.jsx("span",{className:"wizard-option-recommended",children:"Recommended"})]})]}),e.jsxs("label",{className:`setup-wizard-isolation-option${s.manualIsolationMode==="child-process"?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"isolation-mode",value:"child-process",checked:s.manualIsolationMode==="child-process",onChange:()=>n(a=>({...a,manualIsolationMode:"child-process"}))}),e.jsxs("div",{className:"setup-wizard-isolation-option-content",children:[e.jsx("strong",{children:"Child-Process"}),e.jsx("span",{children:"Isolated execution with crash containment."})]})]})]})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"advanced-auth-token",children:"Browser Auth Token"}),e.jsxs("div",{className:"setup-wizard-auth-token",children:[e.jsx("input",{id:"advanced-auth-token",type:"password",value:i,onChange:a=>c(a.target.value),placeholder:u?"Enter a new token to replace the stored one":"Paste the auth token for this browser",autoComplete:"off",spellCheck:!1}),e.jsxs("div",{className:"setup-wizard-auth-token-actions",children:[e.jsx("button",{type:"button",className:"btn",onClick:v,disabled:i.trim().length===0,children:u?"Update token":"Set token"}),u&&e.jsx("button",{type:"button",className:"btn",onClick:A,children:"Reset token"})]})]}),e.jsx("p",{className:"form-hint",children:u?"A token is already stored in this browser. You can update or reset it below.":"No token is stored. Use the auth prompt at the top of the wizard, or set one here."})]})]})]}),s.error&&e.jsx("div",{className:"wizard-error",role:"alert",children:s.error})]}),s.step==="complete"&&e.jsxs("div",{className:"setup-wizard-complete",children:[e.jsxs("div",{className:"setup-wizard-success-streak","aria-hidden":"true",children:[e.jsx("div",{className:"setup-wizard-success-streak-core"}),e.jsx("div",{className:"setup-wizard-success-streak-glow"})]}),e.jsx(k,{size:64,className:"success-icon"}),e.jsx("h3",{children:"All Set!"}),e.jsx("p",{children:"Your project has been registered successfully."}),e.jsx("p",{children:"You can add more projects anytime from the project overview."})]})]}),e.jsxs("div",{className:"setup-wizard-footer",children:[e.jsx("a",{className:"btn setup-wizard-help-link",href:C,target:"_blank",rel:"noreferrer",children:"Need help?"}),s.step==="auth"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"btn",onClick:F,children:"Skip"}),e.jsx("button",{className:"btn btn-primary",onClick:v,disabled:i.trim().length===0,children:e.jsx("span",{children:"Set Token & Continue"})})]}),s.step==="manual"&&e.jsx("button",{className:"btn btn-primary",onClick:R,disabled:E,children:s.isRegistering?e.jsxs(e.Fragment,{children:[e.jsx(G,{size:16,className:"animate-spin"}),e.jsx("span",{children:"Registering..."})]}):e.jsx("span",{children:"Register Project"})}),s.step==="complete"&&e.jsxs("button",{className:"btn btn-primary",onClick:N,children:[e.jsx(k,{size:16}),e.jsx("span",{children:"Get Started"})]})]})]})})}export{V as SetupWizardModal};
|
|
1
|
+
import{r as o,j as e}from"./vendor-react-K0fH_qHe.js";import{cl as w,b1 as L,cm as O,cn as _,co as $,X as W,b as Y,C as k,L as G}from"./index-bEwSVl7B.js";import{D as q}from"./DirectoryPicker-DvBviDG6.js";import{s as f}from"./projectDetection-G3XuxD2X.js";import"./vendor-xterm-DzcZoU0P.js";import"./folder-open-CHSlllzf.js";function V({onProjectRegistered:m,onClose:p}){const C="https://github.com/runfusion/fusion/discussions",[z,y]=o.useState(!0),[s,n]=o.useState(()=>({step:w()?"manual":"auth",manualMode:"existing",manualPath:"",manualCloneUrl:"",manualName:"",manualIsolationMode:"in-process",manualNodeId:"",isRegistering:!1,error:null})),[j,M]=o.useState(!1),[i,c]=o.useState(""),[u,x]=o.useState(()=>w()),{nodes:g,loading:I}=L(),S=g.find(a=>a.type==="local")?.id,N=o.useCallback(()=>{y(!1),p?.()},[p]),P=o.useCallback(a=>{n(t=>{const d={manualPath:a};return a&&(!t.manualName||t.manualName===f(t.manualPath))&&(d.manualName=f(a)),{...t,...d}})},[]),R=o.useCallback(async()=>{const a=s.manualPath.trim(),t=s.manualName.trim(),d=s.manualCloneUrl.trim();if(!(!a||!t)&&!(s.manualMode==="clone"&&!d)){n(r=>({...r,isRegistering:!0,error:null}));try{const r={name:t,path:a,isolationMode:s.manualIsolationMode,nodeId:s.manualNodeId||void 0,cloneUrl:s.manualMode==="clone"?d:void 0},h=await O(r);m(h),n(B=>({...B,step:"complete",isRegistering:!1}))}catch(r){n(h=>({...h,isRegistering:!1,error:r instanceof Error?r.message:"Failed to register project"}))}}},[s.manualPath,s.manualName,s.manualCloneUrl,s.manualMode,s.manualIsolationMode,s.manualNodeId,m]),b=o.useCallback(()=>{const a=i.trim();a&&(_(a),x(a),c(""),n(t=>t.step==="auth"?{...t,step:"manual"}:t))},[i]),A=o.useCallback(()=>{$(),x(void 0),c("")},[]),F=o.useCallback(()=>{n(a=>({...a,step:"manual"}))},[]);if(!z)return null;const v=s.manualMode==="existing",l=s.manualMode==="clone",T=s.manualPath.trim().length>0,U=s.manualName.trim().length>0,D=s.manualCloneUrl.trim().length>0,E=s.isRegistering||!T||!U||l&&!D;return e.jsx("div",{className:"modal-overlay open setup-wizard-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"wizard-title",children:e.jsxs("div",{className:"modal setup-wizard-modal",children:[e.jsxs("div",{className:"setup-wizard-header",children:[e.jsxs("div",{className:"setup-wizard-heading",children:[e.jsxs("div",{className:"setup-wizard-brand","aria-label":"Fusion",children:[e.jsxs("svg",{className:"setup-wizard-brand-logo",width:28,height:28,viewBox:"0 0 128 128",fill:"none","aria-label":"Fusion logo",role:"img",children:[e.jsx("circle",{cx:"64",cy:"64",r:"52",stroke:"currentColor",strokeWidth:"8"}),e.jsx("path",{d:"M26 101C44 82 62 64 82 45C90 37 98 30 104 24C96 35 89 47 81 60C70 79 57 95 43 108C38 112 32 108 26 101Z",fill:"currentColor"})]}),e.jsx("span",{className:"setup-wizard-brand-name",children:"Fusion"})]}),e.jsxs("h2",{id:"wizard-title",className:"setup-wizard-title",children:[s.step==="auth"&&"Set Auth Token",s.step==="manual"&&"Welcome to Fusion",s.step==="complete"&&"Setup Complete!"]})]}),s.step!=="complete"&&e.jsx("button",{className:"modal-close",onClick:N,"aria-label":"Close wizard",children:e.jsx(W,{size:20})})]}),e.jsxs("div",{className:"setup-wizard-content",children:[s.step==="auth"&&e.jsxs("div",{className:"setup-wizard-auth-step",children:[e.jsx("p",{className:"setup-wizard-auth-step-description",children:"This dashboard requires an auth token to communicate with the Fusion daemon. Paste the token below to continue."}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"setup-auth-token",children:"Auth Token"}),e.jsx("input",{id:"setup-auth-token",type:"password",value:i,onChange:a=>c(a.target.value),placeholder:"Paste the daemon auth token",autoComplete:"off",spellCheck:!1,autoFocus:!0}),e.jsxs("p",{className:"form-hint",children:["The token was set via the ",e.jsx("code",{children:"FUSION_DAEMON_TOKEN"})," environment variable when starting the dashboard."]})]}),s.error&&e.jsx("div",{className:"wizard-error",role:"alert",children:s.error})]}),s.step==="manual"&&e.jsxs("div",{className:"setup-wizard-manual",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"project-name",children:"Project Name"}),e.jsx("input",{id:"project-name",type:"text",value:s.manualName,onChange:a=>n(t=>({...t,manualName:a.target.value})),placeholder:"my-project"}),e.jsx("p",{className:"form-hint",children:l?"By default this follows the destination folder name unless you edit it.":"By default this follows the selected directory name unless you edit it."})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"project-path",children:l?"Destination Directory":"Project Directory"}),e.jsx(q,{value:s.manualPath,onChange:P,nodeId:s.manualNodeId||void 0,localNodeId:S,placeholder:l?"/path/for/new-clone":"/path/to/your/project"}),e.jsx("p",{className:"form-hint",children:l?"Select or type an absolute destination path. Fusion will clone into this directory.":"Select or type the absolute path to your project"})]}),e.jsxs("div",{className:"setup-wizard-advanced",children:[e.jsxs("button",{type:"button",className:"setup-wizard-advanced-toggle","aria-expanded":j,onClick:()=>M(a=>!a),children:[e.jsx(Y,{size:16,className:"setup-wizard-advanced-chevron"}),e.jsx("span",{children:"Advanced settings"})]}),j&&e.jsxs("div",{className:"setup-wizard-advanced-panel",children:[e.jsxs("fieldset",{className:"setup-wizard-mode-switch","aria-label":"Project setup mode",children:[e.jsx("legend",{children:"Setup Mode"}),e.jsxs("label",{className:`setup-wizard-mode-option${v?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"setup-mode",value:"existing",checked:v,onChange:()=>n(a=>({...a,manualMode:"existing",error:null}))}),e.jsx("span",{children:"Use Existing Directory"})]}),e.jsxs("label",{className:`setup-wizard-mode-option${l?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"setup-mode",value:"clone",checked:l,onChange:()=>n(a=>({...a,manualMode:"clone",error:null}))}),e.jsx("span",{children:"Clone Git Repository"})]})]}),l&&e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"project-clone-url",children:"Repository URL"}),e.jsx("input",{id:"project-clone-url",type:"text",value:s.manualCloneUrl,onChange:a=>n(t=>({...t,manualCloneUrl:a.target.value})),placeholder:"https://github.com/owner/repo.git"}),e.jsx("p",{className:"form-hint",children:"Fusion will run git clone into the destination directory, then register that cloned folder."})]}),e.jsx("div",{className:"form-group",children:e.jsxs("div",{className:"project-node-selector",children:[e.jsx("span",{className:"project-node-selector__label",children:"Runtime Node"}),e.jsxs("select",{value:s.manualNodeId,onChange:a=>n(t=>({...t,manualNodeId:a.target.value})),disabled:I||s.isRegistering,children:[e.jsx("option",{value:"",children:"Local node"}),g.map(a=>e.jsxs("option",{value:a.id,children:[a.name," (",a.type,")"]},a.id))]})]})}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"Isolation Mode"}),e.jsxs("div",{className:"setup-wizard-isolation-options",children:[e.jsxs("label",{className:`setup-wizard-isolation-option${s.manualIsolationMode==="in-process"?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"isolation-mode",value:"in-process",checked:s.manualIsolationMode==="in-process",onChange:()=>n(a=>({...a,manualIsolationMode:"in-process"}))}),e.jsxs("div",{className:"setup-wizard-isolation-option-content",children:[e.jsx("strong",{children:"In-Process"}),e.jsx("span",{children:"Lower overhead, shared memory. Best for most projects."}),e.jsx("span",{className:"wizard-option-recommended",children:"Recommended"})]})]}),e.jsxs("label",{className:`setup-wizard-isolation-option${s.manualIsolationMode==="child-process"?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"isolation-mode",value:"child-process",checked:s.manualIsolationMode==="child-process",onChange:()=>n(a=>({...a,manualIsolationMode:"child-process"}))}),e.jsxs("div",{className:"setup-wizard-isolation-option-content",children:[e.jsx("strong",{children:"Child-Process"}),e.jsx("span",{children:"Isolated execution with crash containment."})]})]})]})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"advanced-auth-token",children:"Browser Auth Token"}),e.jsxs("div",{className:"setup-wizard-auth-token",children:[e.jsx("input",{id:"advanced-auth-token",type:"password",value:i,onChange:a=>c(a.target.value),placeholder:u?"Enter a new token to replace the stored one":"Paste the auth token for this browser",autoComplete:"off",spellCheck:!1}),e.jsxs("div",{className:"setup-wizard-auth-token-actions",children:[e.jsx("button",{type:"button",className:"btn",onClick:b,disabled:i.trim().length===0,children:u?"Update token":"Set token"}),u&&e.jsx("button",{type:"button",className:"btn",onClick:A,children:"Reset token"})]})]}),e.jsx("p",{className:"form-hint",children:u?"A token is already stored in this browser. You can update or reset it below.":"No token is stored. Use the auth prompt at the top of the wizard, or set one here."})]})]})]}),s.error&&e.jsx("div",{className:"wizard-error",role:"alert",children:s.error})]}),s.step==="complete"&&e.jsxs("div",{className:"setup-wizard-complete",children:[e.jsxs("div",{className:"setup-wizard-success-streak","aria-hidden":"true",children:[e.jsx("div",{className:"setup-wizard-success-streak-core"}),e.jsx("div",{className:"setup-wizard-success-streak-glow"})]}),e.jsx(k,{size:64,className:"success-icon"}),e.jsx("h3",{children:"All Set!"}),e.jsx("p",{children:"Your project has been registered successfully."}),e.jsx("p",{children:"You can add more projects anytime from the project overview."})]})]}),e.jsxs("div",{className:"setup-wizard-footer",children:[e.jsx("a",{className:"btn setup-wizard-help-link",href:C,target:"_blank",rel:"noreferrer",children:"Need help?"}),s.step==="auth"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"btn",onClick:F,children:"Skip"}),e.jsx("button",{className:"btn btn-primary",onClick:b,disabled:i.trim().length===0,children:e.jsx("span",{children:"Set Token & Continue"})})]}),s.step==="manual"&&e.jsx("button",{className:"btn btn-primary",onClick:R,disabled:E,children:s.isRegistering?e.jsxs(e.Fragment,{children:[e.jsx(G,{size:16,className:"animate-spin"}),e.jsx("span",{children:"Registering..."})]}):e.jsx("span",{children:"Register Project"})}),s.step==="complete"&&e.jsxs("button",{className:"btn btn-primary",onClick:N,children:[e.jsx(k,{size:16}),e.jsx("span",{children:"Get Started"})]})]})]})})}export{V as SetupWizardModal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as e}from"./vendor-react-K0fH_qHe.js";import{
|
|
1
|
+
import{r as i,j as e}from"./vendor-react-K0fH_qHe.js";import{bo as U,bz as X,bA as _,bB as G,bx as H,X as P,R as J,a as O,b as Y,L as Z,aq as I}from"./index-bEwSVl7B.js";import"./vendor-xterm-DzcZoU0P.js";function ie({projectId:c,addToast:o,onClose:Q}){const[d,v]=i.useState([]),[f,y]=i.useState(!0),[A,E]=i.useState(!1),[L,p]=i.useState(null),[D,K]=i.useState([]),[h,V]=i.useState(""),[m,g]=i.useState(null),[k,x]=i.useState(null),[W,z]=i.useState(!1),[R,b]=i.useState(null),r=i.useRef(null),[N,q]=i.useState(""),F=h.trim()?d.filter(s=>s.name.toLowerCase().includes(h.toLowerCase())||s.relativePath.toLowerCase().includes(h.toLowerCase())):d,C=i.useCallback(async()=>{y(!0);try{const s=await U(c);v(s)}catch(s){const a=s instanceof Error?s.message:"Failed to load discovered skills";o(a,"error")}finally{y(!1)}},[c,o]),u=i.useCallback(async s=>{const a=l=>{if(!l||typeof l!="object")return!1;const t=l;if(typeof t.status=="number"&&t.status>=500)return!0;if(t.details&&typeof t.details=="object"){const w=t.details;if(typeof w.code=="string"&&w.code.startsWith("upstream_"))return!0}const n=l;return typeof n.error=="string"&&typeof n.code=="string"};E(!0),p(null);try{const l=await X(s,20,c);K(l.entries)}catch(l){if(a(l))p("Catalog is temporarily unavailable. Please try again later.");else{const t=l instanceof Error?l.message:"Failed to load catalog";p(t)}}finally{E(!1)}},[c]);i.useEffect(()=>{C(),u("")},[C,u]);const B=i.useCallback(s=>{V(s),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{q(s),r.current=null},300)},[]);i.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),i.useEffect(()=>{u(N)},[N,u]);const M=i.useCallback(async(s,a)=>{const l=!a;v(t=>t.map(n=>n.id===s?{...n,toggling:!0}:n));try{await _(s,l,c),v(t=>t.map(n=>n.id===s?{...n,enabled:l,toggling:!1}:n)),o(`Skill ${l?"enabled":"disabled"}`,"success")}catch(t){v(w=>w.map(S=>S.id===s?{...S,toggling:!1}:S));const n=t instanceof Error?t.message:"Failed to toggle skill";o(`Failed to toggle skill: ${n}`,"error")}},[c,o]),j=i.useCallback(async s=>{z(!0),b(null),x(null);try{const a=await G(s,c);x(a)}catch(a){const l=a instanceof Error?a.message:"Failed to load skill content";b(l)}finally{z(!1)}},[c]),$=i.useCallback((s,a)=>{if(!(a&&a.target.closest(".skills-view-item-toggle"))){if(m===s){g(null),x(null),b(null);return}g(s),j(s)}},[m,j]),T=i.useCallback(s=>{m!==s&&g(s),j(s)},[j,m]);return e.jsxs("div",{className:"skills-view","data-testid":"skills-view",children:[e.jsxs("div",{className:"skills-view-header",children:[e.jsxs("div",{className:"skills-view-title",children:[e.jsxs("h2",{children:[e.jsx(H,{size:20}),"Skills"]}),e.jsxs("span",{className:"skills-view-count","aria-label":`${d.length} discovered skills`,children:[d.length," discovered"]})]}),e.jsxs("div",{className:"skills-view-actions",children:[e.jsx("button",{className:"btn-icon skills-view-close touch-target",onClick:Q,"aria-label":"Close skills view",children:e.jsx(P,{size:16})}),e.jsxs("button",{className:"btn btn-sm touch-target",onClick:()=>void C(),disabled:f,children:[e.jsx(J,{size:14,className:f?"spin":""}),"Refresh"]})]})]}),e.jsxs("div",{className:"skills-view-content",children:[e.jsx("div",{className:"skills-view-search",children:e.jsx("input",{type:"text",className:"form-input",placeholder:"Search skills...",value:h,onChange:s=>B(s.target.value),"aria-label":"Search skills"})}),e.jsxs("section",{className:"skills-view-section","aria-labelledby":"discovered-skills-title",children:[e.jsx("h3",{id:"discovered-skills-title",className:"skills-view-section-title",children:"Discovered Skills"}),f?e.jsxs("div",{className:"skills-view-loading",children:[e.jsx("span",{className:"spinner"}),"Loading discovered skills..."]}):d.length===0?e.jsx("div",{className:"skills-view-empty",children:e.jsx("p",{children:"No skills discovered in this project."})}):F.length===0?e.jsx("div",{className:"skills-view-empty",children:e.jsx("p",{children:"No discovered skills match your search."})}):e.jsx("div",{className:"skills-view-list",children:F.map(s=>{const a=m===s.id;return e.jsxs("div",{children:[e.jsxs("div",{className:`skills-view-item${a?" skills-view-item--selected":""}`,onClick:l=>$(s.id,l),role:"button",tabIndex:0,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),$(s.id))},"aria-expanded":a,"aria-label":`View details for ${s.name}`,children:[e.jsxs("div",{className:"skills-view-item-info",children:[e.jsxs("span",{className:"skills-view-item-name",children:[a?e.jsx(O,{size:14}):e.jsx(Y,{size:14}),s.name]}),e.jsx("span",{className:"skills-view-item-path",children:s.relativePath}),e.jsx("span",{className:"skills-view-item-source",children:s.metadata.source})]}),e.jsxs("label",{className:"skills-view-item-toggle",onClick:l=>l.stopPropagation(),children:[e.jsx("input",{type:"checkbox",checked:s.enabled,disabled:s.toggling,onChange:()=>void M(s.id,s.enabled),"aria-label":`${s.enabled?"Disable":"Enable"} ${s.name}`}),e.jsx("span",{className:"skills-view-toggle-slider"})]})]}),a&&e.jsxs("div",{className:"skills-view-detail","data-testid":"skill-detail",children:[e.jsxs("div",{className:"skills-view-detail-header",children:[e.jsx("span",{className:"skills-view-detail-title",children:s.name}),e.jsxs("button",{className:"btn btn-sm skills-view-detail-close",onClick:()=>{g(null),x(null),b(null)},"aria-label":"Close skill detail",children:[e.jsx(P,{size:14}),"Close"]})]}),W?e.jsxs("div",{className:"skills-view-detail-loading",children:[e.jsx(Z,{size:16,className:"spin"}),"Loading skill content..."]}):R?e.jsxs("div",{className:"skills-view-detail-error",children:[e.jsx(I,{size:14}),e.jsx("span",{children:R}),e.jsx("button",{className:"btn btn-sm",onClick:()=>T(s.id),children:"Retry"})]}):k?e.jsxs(e.Fragment,{children:[e.jsx("pre",{className:"skills-view-detail-content",children:k.skillMd||"(No SKILL.md found)"}),k.files.length>0&&e.jsxs("div",{className:"skills-view-detail-files",children:[e.jsx("span",{className:"skills-view-detail-files-label",children:"Files:"}),k.files.map(l=>e.jsxs("span",{className:"badge badge--sm",children:[l.name,l.type==="directory"&&"/"]},l.relativePath))]})]}):null]})]},s.id)})})]}),e.jsxs("section",{className:"skills-view-section","aria-labelledby":"catalog-title",children:[e.jsx("h3",{id:"catalog-title",className:"skills-view-section-title",children:"Skills Catalog"}),L?e.jsxs("div",{className:"skills-view-error",children:[e.jsx("p",{children:L}),e.jsx("button",{className:"btn btn-sm",onClick:()=>void u(N),children:"Try Again"})]}):A?e.jsxs("div",{className:"skills-view-loading",children:[e.jsx("span",{className:"spinner"}),"Loading catalog..."]}):D.length===0?e.jsx("div",{className:"skills-view-empty",children:h?e.jsx("p",{children:"No skills match your search."}):e.jsx("p",{children:"No skills available in the catalog."})}):e.jsx("div",{className:"skills-view-grid",children:D.map(s=>e.jsxs("div",{className:"skills-view-card",children:[e.jsx("h4",{className:"skills-view-card-title",children:s.name}),s.description&&e.jsx("p",{className:"skills-view-card-description",children:s.description}),s.tags&&s.tags.length>0&&e.jsx("div",{className:"skills-view-card-tags",children:s.tags.map(a=>e.jsx("span",{className:"badge badge--sm",children:a},a))}),s.installs!==void 0&&e.jsxs("span",{className:"skills-view-card-installs",children:[s.installs.toLocaleString()," installs"]})]},s.id))})]})]})]})}export{ie as SkillsView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.stash-recovery-view{padding:var(--space-lg);display:flex;flex-direction:column;gap:var(--space-md)}.stash-recovery-header{display:flex;align-items:center;gap:var(--space-md)}.stash-row{display:grid;grid-template-columns:1fr 1fr 1fr auto auto;gap:var(--space-sm);align-items:center;padding:var(--space-sm) 0;border-bottom:var(--btn-border-width) solid var(--border)}.stash-field{display:flex;flex-direction:column;gap:var(--space-xs)}.stash-field-label{display:none;color:var(--text-muted);font-size:.75rem;text-transform:uppercase}.stash-row-actions,.stash-row-actions-danger{display:flex;gap:var(--space-sm);justify-content:flex-end}.stash-action-btn{white-space:nowrap}.stash-status{color:var(--text-muted);grid-column:1 / -1}.stash-recovery-diff-modal{max-width:80vw}.stash-recovery-diff-pre{margin:0;padding:var(--space-md);max-height:50vh;overflow:auto;background:var(--surface);border:var(--btn-border-width) solid var(--border);border-radius:var(--radius-sm);font-family:var(--font-mono);font-size:.75rem;line-height:1.5;white-space:pre-wrap;word-break:break-word}@media(max-width:768px){.stash-row{display:flex;flex-direction:column;align-items:stretch;gap:var(--space-md)}.stash-field-label{display:inline}.stash-row-actions,.stash-row-actions-danger{justify-content:stretch}.stash-action-btn{flex:1;min-height:var(--mobile-nav-height)}.stash-row-actions-danger .stash-action-btn{width:100%}.stash-recovery-diff-modal{width:100%;max-width:100%}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,j as s}from"./vendor-react-K0fH_qHe.js";import{v as y,ci as i}from"./index-bEwSVl7B.js";import"./vendor-xterm-DzcZoU0P.js";function w(){const{confirm:h}=y(),[c,u]=t.useState([]),[d,f]=t.useState(null),[p,x]=t.useState({}),[n,l]=t.useState(null),o=t.useCallback(async()=>{try{f(null);const a=await i("/stash-recovery/orphans");u(a.records??[])}catch(a){f(a instanceof Error?a.message:"Failed to load orphans")}},[]);t.useEffect(()=>{o()},[o]);const j=t.useMemo(()=>{const a=new Map;for(const e of c){const r=e.sourceTaskId??"Unknown source",m=a.get(r)??[];m.push(e),a.set(r,m)}return Array.from(a.entries())},[c]),v=t.useCallback(async a=>{const e=await i(`/stash-recovery/orphans/${a}/apply`,{method:"POST"});x(r=>({...r,[a]:e.ok?"Applied":e.stderr??e.reason??"Apply failed"}))},[]),b=t.useCallback(async a=>{await h({title:"Drop orphaned stash?",message:"This removes the stash entry permanently.",confirmLabel:"Drop",danger:!0})&&(await i(`/stash-recovery/orphans/${a}/drop`,{method:"POST",body:JSON.stringify({confirm:!0})}),await o())},[h,o]),N=t.useCallback(async a=>{l({sha:a,diff:"",truncated:!1,loading:!0,error:null});try{const e=await i(`/stash-recovery/orphans/${a}/diff`);l({sha:a,diff:e.diff??"",truncated:!!e.truncated,loading:!1,error:null})}catch(e){l({sha:a,diff:"",truncated:!1,loading:!1,error:e instanceof Error?e.message:"Failed to load diff"})}},[]);return c.length===0&&!d?s.jsxs("div",{className:"card stash-recovery-view",children:[s.jsx("p",{children:"No orphaned merger autostashes found."}),s.jsx("button",{className:"btn btn-sm",onClick:()=>void o(),children:"Refresh"})]}):s.jsxs("div",{className:"card stash-recovery-view",children:[s.jsxs("div",{className:"stash-recovery-header",children:[s.jsx("h2",{children:"Stash Recovery"}),s.jsxs("span",{children:[c.length," orphans"]}),s.jsx("button",{className:"btn btn-sm",onClick:()=>void o(),children:"Refresh"})]}),d&&s.jsx("div",{className:"form-error",children:d}),j.map(([a,e])=>s.jsxs("section",{children:[s.jsx("h3",{children:a}),e.map(r=>s.jsxs("div",{className:"stash-row",children:[s.jsxs("div",{className:"stash-field",children:[s.jsx("span",{className:"stash-field-label",children:"SHA"}),s.jsx("span",{children:r.sha.slice(0,7)})]}),s.jsxs("div",{className:"stash-field",children:[s.jsx("span",{className:"stash-field-label",children:"Classification"}),s.jsx("span",{children:r.classification})]}),s.jsxs("div",{className:"stash-field",children:[s.jsx("span",{className:"stash-field-label",children:"Changed paths"}),s.jsxs("span",{children:[r.changedPaths.length," files"]})]}),s.jsxs("div",{className:"stash-row-actions",children:[s.jsx("button",{className:"btn btn-sm stash-action-btn",onClick:()=>void N(r.sha),children:"Inspect diff"}),s.jsx("button",{className:"btn btn-sm stash-action-btn",onClick:()=>void v(r.sha),children:"Apply"})]}),s.jsx("div",{className:"stash-row-actions-danger",children:s.jsx("button",{className:"btn btn-sm btn-danger stash-action-btn",onClick:()=>void b(r.sha),children:"Drop"})}),p[r.sha]&&s.jsx("div",{className:"stash-status",children:p[r.sha]})]},r.sha))]},a)),n&&s.jsx("div",{className:"modal-overlay open",onClick:()=>l(null),children:s.jsxs("div",{className:"modal stash-recovery-diff-modal",role:"dialog","aria-modal":"true","aria-label":`Diff for ${n.sha}`,onClick:a=>a.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsxs("h3",{children:["Diff for ",n.sha.slice(0,7)]}),s.jsx("button",{className:"modal-close",onClick:()=>l(null),"aria-label":"Close diff dialog",children:"×"})]}),n.loading&&s.jsx("p",{children:"Loading diff…"}),n.error&&s.jsx("div",{className:"form-error",children:n.error}),!n.loading&&!n.error&&s.jsxs(s.Fragment,{children:[s.jsx("pre",{className:"stash-recovery-diff-pre",children:n.diff||"No diff output available."}),n.truncated&&s.jsx("p",{className:"stash-status",children:"Diff output truncated."})]}),s.jsx("div",{className:"modal-actions",children:s.jsx("button",{className:"btn",onClick:()=>l(null),children:"Close"})})]})})]})}export{w as StashRecoveryView};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{r as d,j as e}from"./vendor-react-K0fH_qHe.js";import{c as wt,
|
|
1
|
+
import{r as d,j as e}from"./vendor-react-K0fH_qHe.js";import{c as wt,c8 as Ct,c9 as St,ca as At,cb as $t,cc as Et,cd as Dt,ce as Ft,cf as Tt,v as Mt,i as Ot,z as H,cg as lt,L as Rt,I as Pt,bp as J,X as Q,ch as ut,aW as mt,W as bt,ad as Ut,a as _t,as as Kt,B as pt}from"./index-bEwSVl7B.js";import"./vendor-xterm-DzcZoU0P.js";/**
|
|
2
2
|
* @license lucide-react v1.7.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Bt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],qt=wt("circle-plus",Bt);function zt(L){const{items:l,...x}=L;return x}function ft(L){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`${L}-${crypto.randomUUID()}`:`${L}-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function Vt(L={}){const{projectId:l,addToast:x}=L,[k,N]=d.useState([]),[g,I]=d.useState([]),[q,F]=d.useState(!0),[S,j]=d.useState(null),[$,E]=d.useState(null),[y,h]=d.useState([]),C=d.useRef($);C.current=$,d.useEffect(()=>{let s=!1;async function c(){F(!0),j(null);try{const r=await Tt(l);if(s)return;h(r),N(r.map(zt));const m=C.current&&r.some(i=>i.id===C.current)?C.current:r[0]?.id??null;E(m),I(m?r.find(i=>i.id===m)?.items??[]:[])}catch(r){if(s)return;h([]),N([]),I([]),E(null),j(r instanceof Error?r.message:"Failed to load todo lists")}finally{s||F(!1)}}return c(),()=>{s=!0}},[l]),d.useEffect(()=>{if(!$){I([]);return}const s=y.find(c=>c.id===$);I(s?.items??[])},[y,$]);const z=d.useCallback(async s=>{const c=k,r=y,m=new Date().toISOString(),i={id:ft("temp-list"),projectId:l??"",title:s,createdAt:m,updatedAt:m};j(null),N(n=>[...n,i]),h(n=>[...n,{...i,items:[]}]);try{const n=await Ct(s,l);N(a=>a.map(o=>o.id===i.id?n:o)),h(a=>a.map(o=>o.id===i.id?{...n,items:[]}:o)),C.current||E(n.id)}catch(n){N(c),h(r),j(n instanceof Error?n.message:"Failed to create list"),x?.("Failed to create todo list","error")}},[x,y,k,l]),V=d.useCallback(async(s,c)=>{const r=k,m=y;j(null),N(i=>i.map(n=>n.id===s?{...n,title:c}:n)),h(i=>i.map(n=>n.id===s?{...n,title:c}:n));try{const i=await St(s,c,l);N(n=>n.map(a=>a.id===s?i:a)),h(n=>n.map(a=>a.id===s?{...i,items:a.items}:a))}catch(i){N(r),h(m),j(i instanceof Error?i.message:"Failed to rename list"),x?.("Failed to rename todo list","error")}},[x,y,k,l]),W=d.useCallback(async s=>{const c=k,r=y,m=C.current,i=m===s?k.find(n=>n.id!==s)?.id??null:m;j(null),N(n=>n.filter(a=>a.id!==s)),h(n=>n.filter(a=>a.id!==s)),m===s&&E(i);try{await At(s,l)}catch(n){N(c),h(r),E(m),j(n instanceof Error?n.message:"Failed to delete list"),x?.("Failed to delete todo list","error")}},[x,y,k,l]),T=d.useCallback(async s=>{const c=C.current;if(!c)return;const r=g,m=y,i=new Date().toISOString(),n=g.reduce((o,u)=>Math.max(o,u.sortOrder),-1),a={id:ft("temp-item"),listId:c,text:s,completed:!1,completedAt:null,createdAt:i,updatedAt:i,sortOrder:n+1};j(null),I(o=>[...o,a]),h(o=>o.map(u=>u.id===c?{...u,items:[...u.items,a]}:u));try{const o=await $t(c,s,l);I(u=>u.map(f=>f.id===a.id?o:f)),h(u=>u.map(f=>f.id===c?{...f,items:f.items.map(D=>D.id===a.id?o:D)}:f))}catch(o){I(r),h(m),j(o instanceof Error?o.message:"Failed to create item"),x?.("Failed to create todo item","error")}},[x,g,y,l]),w=d.useCallback(async(s,c)=>{const r=g.find(o=>o.id===s);if(!r)return;const m=g,i=y,n=c.completed??r.completed,a={...r,...c,completed:n,completedAt:n?r.completedAt??new Date().toISOString():null,updatedAt:new Date().toISOString()};j(null),I(o=>o.map(u=>u.id===s?a:u)),h(o=>o.map(u=>u.id===a.listId?{...u,items:u.items.map(f=>f.id===s?a:f)}:u));try{const o=await Et(s,c,l);I(u=>u.map(f=>f.id===s?o:f)),h(u=>u.map(f=>f.id===o.listId?{...f,items:f.items.map(D=>D.id===s?o:D)}:f))}catch(o){I(m),h(i),j(o instanceof Error?o.message:"Failed to update item"),x?.("Failed to update todo item","error")}},[x,g,y,l]),_=d.useCallback(async s=>{const c=g.find(r=>r.id===s);c&&await w(s,{completed:!c.completed})},[g,w]),A=d.useCallback(async s=>{const c=g,r=y;j(null),I(m=>m.filter(i=>i.id!==s)),h(m=>m.map(i=>({...i,items:i.items.filter(n=>n.id!==s)})));try{await Dt(s,l)}catch(m){I(c),h(r),j(m instanceof Error?m.message:"Failed to delete item"),x?.("Failed to delete todo item","error")}},[x,g,y,l]),M=d.useCallback(async s=>{const c=C.current;if(!c)return;const r=g,m=y,i=new Map(g.map(a=>[a.id,a])),n=s.map((a,o)=>{const u=i.get(a);return u?{...u,sortOrder:o}:null}).filter(a=>a!==null);j(null),I(n),h(a=>a.map(o=>o.id===c?{...o,items:n}:o));try{await Ft(c,s,l)}catch(a){I(r),h(m),j(a instanceof Error?a.message:"Failed to reorder items"),x?.("Failed to reorder todo items","error")}},[x,g,y,l]);return{lists:k,items:g,loading:q,error:S,selectedListId:$,setSelectedListId:E,createList:z,renameList:V,deleteList:W,createItem:T,updateItem:w,toggleItem:_,deleteItem:A,reorderItems:M}}function Wt(L){return[...L].sort((l,x)=>l.sortOrder-x.sortOrder)}function Jt({projectId:L,addToast:l,onPlanningMode:x,onTaskCreated:k,mobileKeyboardActive:N=!1}){const{lists:g,items:I,loading:q,error:F,selectedListId:S,setSelectedListId:j,createList:$,renameList:E,deleteList:y,createItem:h,updateItem:C,toggleItem:z,deleteItem:V,reorderItems:W}=Vt({projectId:L,addToast:(t,p)=>{if(p==="success"||p==="error"||p==="info"||p===void 0){l(t,p);return}l(t,"info")}}),[T,w]=d.useState(null),[_,A]=d.useState(""),[M,s]=d.useState(null),[c,r]=d.useState(""),[m,i]=d.useState(""),[n,a]=d.useState(!1),[o,u]=d.useState(""),[f,D]=d.useState([]),[ht,Y]=d.useState(!1),[X,O]=d.useState(!1),[Z,R]=d.useState(null),G=d.useRef(null),{confirm:xt}=Mt(),tt=d.useMemo(()=>g.find(t=>t.id===S)??null,[g,S]),K=d.useMemo(()=>Wt(I.filter(t=>t.listId===S)),[I,S]);function et(){w(null),A(""),i(""),a(!1)}function B(){s(null),r(""),u("")}function gt(t){et(),B(),j(t)}const vt=d.useCallback(async()=>{Y(!0);try{const t=await Ot(void 0,L);D(t),O(!0)}catch(t){l(`Failed to load agents: ${H(t)}`,"error"),O(!1),R(null)}finally{Y(!1)}},[L,l]);d.useEffect(()=>{w(null),A(""),i(""),a(!1),s(null),r(""),u(""),O(!1),R(null)},[S]),d.useEffect(()=>{if(!X)return;const t=p=>{G.current&&!G.current.contains(p.target)&&(O(!1),R(null))};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[X]);function jt(t){B(),w(t.id),A(t.title),a(!1)}async function st(){if(!T)return;const t=_.trim();if(!t){w(null),A("");return}await E(T,t),w(null),A("")}function nt(){w(null),A("")}function at(t){et(),s(t.id),r(t.text)}async function it(){if(!M)return;const t=c.trim();if(!t){s(null),r("");return}await C(M,{text:t}),s(null),r("")}function ot(){s(null),r("")}async function dt(){const t=m.trim();t&&(await $(t),i(""),a(!1))}async function rt(){if(!S)return;const t=o.trim();t&&(await h(t),u(""))}async function yt(t){await xt({title:"Delete List",message:"Delete this list and all its items?",danger:!0})&&await y(t)}async function It(t){await V(t)}async function ct(t,p){const v=K.map(U=>U.id),b=v.findIndex(U=>U===t);if(b<0)return;const P=p==="up"?b-1:b+1;P<0||P>=v.length||([v[b],v[P]]=[v[P],v[b]],await W(v))}const Lt=d.useCallback(async t=>{try{const p={description:t.text,column:"triage",source:{sourceType:"dashboard_ui"}},v=await lt(p,L);k?.(v),l(`Created ${v.id} from todo`,"success")}catch(p){l(`Failed to create task: ${H(p)}`,"error")}},[L,l,k]),kt=d.useCallback(async(t,p)=>{try{const v={description:t.text,column:"triage",assignedAgentId:p,source:{sourceType:"dashboard_ui"}},b=await lt(v,L);k?.(b);const U=f.find(Nt=>Nt.id===p)?.name??p;l(`Created ${b.id} and assigned to ${U}`,"success"),O(!1),R(null)}catch(v){l(`Failed to create and assign task: ${H(v)}`,"error")}},[L,l,f,k]);return q?e.jsx("div",{className:"todo-view",children:e.jsxs("div",{className:"todo-loading",children:[e.jsx(Rt,{className:"todo-loading-icon","aria-hidden":"true"}),e.jsx("p",{children:"Loading todos..."})]})}):e.jsx("div",{className:`todo-view${N?" todo-view--mobile-keyboard-active":""}`,"data-testid":"todo-view-root",children:e.jsxs("div",{className:"todo-view-layout",children:[e.jsxs("aside",{className:"todo-view-sidebar","aria-label":"Todo lists sidebar",children:[e.jsxs("div",{className:"todo-sidebar-header",children:[e.jsx("h3",{className:"todo-sidebar-title",children:"Lists"}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-add-list-btn",onClick:()=>{B(),a(!0),w(null)},"aria-label":"Add list","data-testid":"add-list-button",children:e.jsx(Pt,{})})]}),n&&e.jsxs("div",{className:"todo-list-item",children:[e.jsx("input",{className:"input todo-inline-edit-input",placeholder:"New list title",value:m,onChange:t=>i(t.target.value),onKeyDown:t=>{t.key==="Enter"&&dt(),t.key==="Escape"&&(i(""),a(!1))},autoFocus:!0,"data-testid":"new-list-input"}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{dt()},"aria-label":"Save list",children:e.jsx(J,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{i(""),a(!1)},"aria-label":"Cancel list",children:e.jsx(Q,{})})]}),g.length===0&&!n?e.jsxs("div",{className:"todo-empty-state",children:[e.jsx(ut,{"aria-hidden":"true"}),e.jsx("p",{children:"No todo lists yet. Create one to get started."}),e.jsx("button",{type:"button",className:"btn btn-sm",onClick:()=>{B(),a(!0)},children:"Create List"})]}):e.jsx("div",{className:"todo-list-items",role:"list","aria-label":"Todo lists",children:g.map(t=>{const p=t.id===S,v=t.id===T;return e.jsx("div",{className:`todo-list-item${p?" todo-list-item--active":""}`,role:"listitem",children:v?e.jsxs(e.Fragment,{children:[e.jsx("input",{className:"input todo-inline-edit-input",value:_,onChange:b=>A(b.target.value),onKeyDown:b=>{b.key==="Enter"&&st(),b.key==="Escape"&&nt()},autoFocus:!0,"data-testid":`rename-list-input-${t.id}`}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{st()},"aria-label":"Save list rename",children:e.jsx(J,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:nt,"aria-label":"Cancel list rename",children:e.jsx(Q,{})})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"todo-list-select-btn",onClick:()=>gt(t.id),"aria-label":`Select list ${t.title}`,"aria-current":p?"true":void 0,"data-testid":`todo-list-${t.id}`,children:e.jsx("span",{className:"todo-list-item-name",children:t.title})}),e.jsxs("div",{className:"todo-list-item-actions",children:[e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{jt(t)},"aria-label":`Rename ${t.title}`,"data-testid":`rename-list-button-${t.id}`,children:e.jsx(mt,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon btn-danger todo-icon-btn",onClick:()=>{yt(t.id)},"aria-label":`Delete ${t.title}`,"data-testid":`delete-list-button-${t.id}`,children:e.jsx(bt,{})})]})]})},t.id)})})]}),e.jsxs("section",{className:"todo-view-main","aria-label":"Todo items",children:[F&&e.jsxs("div",{className:"todo-error-banner",role:"alert",children:[e.jsx("span",{className:"todo-error-message",children:F}),e.jsx("button",{type:"button",className:"btn btn-sm",onClick:()=>window.location.reload(),children:"Retry"})]}),tt?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"todo-items-header",children:e.jsx("h3",{children:tt.title})}),e.jsxs("div",{className:"todo-add-item-row",children:[e.jsx("input",{className:"input",placeholder:"Add a todo item",value:o,onChange:t=>u(t.target.value),onKeyDown:t=>{t.key==="Enter"&&rt(),t.key==="Escape"&&u("")},"data-testid":"new-item-input"}),e.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>{rt()},children:"Add"})]}),K.length===0?e.jsx("div",{className:"todo-empty-state",children:e.jsx("p",{children:"No items in this list. Add one above."})}):e.jsx("div",{className:"todo-items-list",children:K.map((t,p)=>{const v=t.id===M;return e.jsxs("div",{className:"todo-item","data-testid":`todo-item-${t.id}`,children:[e.jsxs("div",{className:"todo-item-main-row",children:[e.jsx("input",{type:"checkbox",checked:t.completed,onChange:()=>{z(t.id)},className:"todo-item-checkbox","aria-label":`Toggle ${t.text}`,"data-testid":`toggle-item-${t.id}`}),v?e.jsx("input",{className:"input todo-inline-edit-input",value:c,onChange:b=>r(b.target.value),onKeyDown:b=>{b.key==="Enter"&&it(),b.key==="Escape"&&ot()},autoFocus:!0,"data-testid":`edit-item-input-${t.id}`}):e.jsx("button",{type:"button",className:`todo-item-text${t.completed?" todo-item-text--completed":""}`,onClick:()=>at(t),children:t.text})]}),e.jsx("div",{className:"todo-item-actions","data-testid":`todo-item-actions-${t.id}`,children:v?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{it()},"aria-label":"Save item edit",children:e.jsx(J,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:ot,"aria-label":"Cancel item edit",children:e.jsx(Q,{})})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"todo-item-reorder-btns",children:[e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-item-reorder-btn",onClick:()=>{ct(t.id,"up")},disabled:p===0,"aria-label":`Move ${t.text} up`,"data-testid":`move-up-${t.id}`,children:e.jsx(Ut,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-item-reorder-btn",onClick:()=>{ct(t.id,"down")},disabled:p===K.length-1,"aria-label":`Move ${t.text} down`,"data-testid":`move-down-${t.id}`,children:e.jsx(_t,{})})]}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{x?.(t.text)},"aria-label":`Start planning from ${t.text}`,"data-testid":`planning-from-${t.id}`,children:e.jsx(Kt,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{Lt(t)},"aria-label":`Create task from ${t.text}`,"data-testid":`create-task-from-${t.id}`,children:e.jsx(qt,{})}),e.jsxs("div",{className:"todo-agent-picker-trigger",ref:Z===t.id?G:void 0,children:[e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{R(t.id),vt()},"aria-label":`Assign ${t.text} to agent`,"data-testid":`assign-agent-for-${t.id}`,children:e.jsx(pt,{})}),X&&Z===t.id&&e.jsx("div",{className:"todo-agent-picker-dropdown",onMouseDown:b=>{b.preventDefault()},children:ht?e.jsx("div",{className:"todo-agent-picker-loading",children:"Loading agents..."}):f.length>0?f.map(b=>e.jsxs("button",{type:"button",className:"todo-agent-picker-item",onClick:()=>{kt(t,b.id)},children:[e.jsx(pt,{}),e.jsx("span",{children:b.name}),e.jsx("span",{className:"todo-agent-picker-role",children:b.role})]},b.id)):e.jsx("div",{className:"todo-agent-picker-empty",children:"No agents available"})})]}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>at(t),"aria-label":`Edit ${t.text}`,"data-testid":`edit-item-${t.id}`,children:e.jsx(mt,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon btn-danger todo-icon-btn",onClick:()=>{It(t.id)},"aria-label":`Delete ${t.text}`,"data-testid":`delete-item-${t.id}`,children:e.jsx(bt,{})})]})})]},t.id)})})]}):e.jsxs("div",{className:"todo-empty-state",children:[e.jsx(ut,{"aria-hidden":"true"}),e.jsx("p",{children:"Select a list from the sidebar"})]})]})]})})}export{Jt as TodoView};
|
|
6
|
+
*/const Bt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],Wt=wt("circle-plus",Bt);function zt(L){const{items:l,...x}=L;return x}function ht(L){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`${L}-${crypto.randomUUID()}`:`${L}-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function Vt(L={}){const{projectId:l,addToast:x}=L,[k,N]=d.useState([]),[g,I]=d.useState([]),[W,F]=d.useState(!0),[S,j]=d.useState(null),[$,E]=d.useState(null),[y,f]=d.useState([]),C=d.useRef($);C.current=$,d.useEffect(()=>{let s=!1;async function c(){F(!0),j(null);try{const r=await Tt(l);if(s)return;f(r),N(r.map(zt));const m=C.current&&r.some(i=>i.id===C.current)?C.current:r[0]?.id??null;E(m),I(m?r.find(i=>i.id===m)?.items??[]:[])}catch(r){if(s)return;f([]),N([]),I([]),E(null),j(r instanceof Error?r.message:"Failed to load todo lists")}finally{s||F(!1)}}return c(),()=>{s=!0}},[l]),d.useEffect(()=>{if(!$){I([]);return}const s=y.find(c=>c.id===$);I(s?.items??[])},[y,$]);const z=d.useCallback(async s=>{const c=k,r=y,m=new Date().toISOString(),i={id:ht("temp-list"),projectId:l??"",title:s,createdAt:m,updatedAt:m};j(null),N(n=>[...n,i]),f(n=>[...n,{...i,items:[]}]);try{const n=await Ct(s,l);N(a=>a.map(o=>o.id===i.id?n:o)),f(a=>a.map(o=>o.id===i.id?{...n,items:[]}:o)),C.current||E(n.id)}catch(n){N(c),f(r),j(n instanceof Error?n.message:"Failed to create list"),x?.("Failed to create todo list","error")}},[x,y,k,l]),V=d.useCallback(async(s,c)=>{const r=k,m=y;j(null),N(i=>i.map(n=>n.id===s?{...n,title:c}:n)),f(i=>i.map(n=>n.id===s?{...n,title:c}:n));try{const i=await St(s,c,l);N(n=>n.map(a=>a.id===s?i:a)),f(n=>n.map(a=>a.id===s?{...i,items:a.items}:a))}catch(i){N(r),f(m),j(i instanceof Error?i.message:"Failed to rename list"),x?.("Failed to rename todo list","error")}},[x,y,k,l]),X=d.useCallback(async s=>{const c=k,r=y,m=C.current,i=m===s?k.find(n=>n.id!==s)?.id??null:m;j(null),N(n=>n.filter(a=>a.id!==s)),f(n=>n.filter(a=>a.id!==s)),m===s&&E(i);try{await At(s,l)}catch(n){N(c),f(r),E(m),j(n instanceof Error?n.message:"Failed to delete list"),x?.("Failed to delete todo list","error")}},[x,y,k,l]),T=d.useCallback(async s=>{const c=C.current;if(!c)return;const r=g,m=y,i=new Date().toISOString(),n=g.reduce((o,u)=>Math.max(o,u.sortOrder),-1),a={id:ht("temp-item"),listId:c,text:s,completed:!1,completedAt:null,createdAt:i,updatedAt:i,sortOrder:n+1};j(null),I(o=>[...o,a]),f(o=>o.map(u=>u.id===c?{...u,items:[...u.items,a]}:u));try{const o=await $t(c,s,l);I(u=>u.map(h=>h.id===a.id?o:h)),f(u=>u.map(h=>h.id===c?{...h,items:h.items.map(D=>D.id===a.id?o:D)}:h))}catch(o){I(r),f(m),j(o instanceof Error?o.message:"Failed to create item"),x?.("Failed to create todo item","error")}},[x,g,y,l]),w=d.useCallback(async(s,c)=>{const r=g.find(o=>o.id===s);if(!r)return;const m=g,i=y,n=c.completed??r.completed,a={...r,...c,completed:n,completedAt:n?r.completedAt??new Date().toISOString():null,updatedAt:new Date().toISOString()};j(null),I(o=>o.map(u=>u.id===s?a:u)),f(o=>o.map(u=>u.id===a.listId?{...u,items:u.items.map(h=>h.id===s?a:h)}:u));try{const o=await Et(s,c,l);I(u=>u.map(h=>h.id===s?o:h)),f(u=>u.map(h=>h.id===o.listId?{...h,items:h.items.map(D=>D.id===s?o:D)}:h))}catch(o){I(m),f(i),j(o instanceof Error?o.message:"Failed to update item"),x?.("Failed to update todo item","error")}},[x,g,y,l]),_=d.useCallback(async s=>{const c=g.find(r=>r.id===s);c&&await w(s,{completed:!c.completed})},[g,w]),A=d.useCallback(async s=>{const c=g,r=y;j(null),I(m=>m.filter(i=>i.id!==s)),f(m=>m.map(i=>({...i,items:i.items.filter(n=>n.id!==s)})));try{await Dt(s,l)}catch(m){I(c),f(r),j(m instanceof Error?m.message:"Failed to delete item"),x?.("Failed to delete todo item","error")}},[x,g,y,l]),M=d.useCallback(async s=>{const c=C.current;if(!c)return;const r=g,m=y,i=new Map(g.map(a=>[a.id,a])),n=s.map((a,o)=>{const u=i.get(a);return u?{...u,sortOrder:o}:null}).filter(a=>a!==null);j(null),I(n),f(a=>a.map(o=>o.id===c?{...o,items:n}:o));try{await Ft(c,s,l)}catch(a){I(r),f(m),j(a instanceof Error?a.message:"Failed to reorder items"),x?.("Failed to reorder todo items","error")}},[x,g,y,l]);return{lists:k,items:g,loading:W,error:S,selectedListId:$,setSelectedListId:E,createList:z,renameList:V,deleteList:X,createItem:T,updateItem:w,toggleItem:_,deleteItem:A,reorderItems:M}}function Xt(L){return[...L].sort((l,x)=>l.sortOrder-x.sortOrder)}function Jt({projectId:L,addToast:l,onPlanningMode:x,onTaskCreated:k,mobileKeyboardActive:N=!1}){const{lists:g,items:I,loading:W,error:F,selectedListId:S,setSelectedListId:j,createList:$,renameList:E,deleteList:y,createItem:f,updateItem:C,toggleItem:z,deleteItem:V,reorderItems:X}=Vt({projectId:L,addToast:(t,p)=>{if(p==="success"||p==="error"||p==="info"||p===void 0){l(t,p);return}l(t,"info")}}),[T,w]=d.useState(null),[_,A]=d.useState(""),[M,s]=d.useState(null),[c,r]=d.useState(""),[m,i]=d.useState(""),[n,a]=d.useState(!1),[o,u]=d.useState(""),[h,D]=d.useState([]),[ft,Y]=d.useState(!1),[q,O]=d.useState(!1),[Z,R]=d.useState(null),G=d.useRef(null),{confirm:xt}=Mt(),tt=d.useMemo(()=>g.find(t=>t.id===S)??null,[g,S]),K=d.useMemo(()=>Xt(I.filter(t=>t.listId===S)),[I,S]);function et(){w(null),A(""),i(""),a(!1)}function B(){s(null),r(""),u("")}function gt(t){et(),B(),j(t)}const vt=d.useCallback(async()=>{Y(!0);try{const t=await Ot(void 0,L);D(t),O(!0)}catch(t){l(`Failed to load agents: ${H(t)}`,"error"),O(!1),R(null)}finally{Y(!1)}},[L,l]);d.useEffect(()=>{w(null),A(""),i(""),a(!1),s(null),r(""),u(""),O(!1),R(null)},[S]),d.useEffect(()=>{if(!q)return;const t=p=>{G.current&&!G.current.contains(p.target)&&(O(!1),R(null))};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[q]);function jt(t){B(),w(t.id),A(t.title),a(!1)}async function st(){if(!T)return;const t=_.trim();if(!t){w(null),A("");return}await E(T,t),w(null),A("")}function nt(){w(null),A("")}function at(t){et(),s(t.id),r(t.text)}async function it(){if(!M)return;const t=c.trim();if(!t){s(null),r("");return}await C(M,{text:t}),s(null),r("")}function ot(){s(null),r("")}async function dt(){const t=m.trim();t&&(await $(t),i(""),a(!1))}async function rt(){if(!S)return;const t=o.trim();t&&(await f(t),u(""))}async function yt(t){await xt({title:"Delete List",message:"Delete this list and all its items?",danger:!0})&&await y(t)}async function It(t){await V(t)}async function ct(t,p){const v=K.map(U=>U.id),b=v.findIndex(U=>U===t);if(b<0)return;const P=p==="up"?b-1:b+1;P<0||P>=v.length||([v[b],v[P]]=[v[P],v[b]],await X(v))}const Lt=d.useCallback(async t=>{try{const p={description:t.text,column:"triage",source:{sourceType:"dashboard_ui"}},v=await lt(p,L);k?.(v),l(`Created ${v.id} from todo`,"success")}catch(p){l(`Failed to create task: ${H(p)}`,"error")}},[L,l,k]),kt=d.useCallback(async(t,p)=>{try{const v={description:t.text,column:"triage",assignedAgentId:p,source:{sourceType:"dashboard_ui"}},b=await lt(v,L);k?.(b);const U=h.find(Nt=>Nt.id===p)?.name??p;l(`Created ${b.id} and assigned to ${U}`,"success"),O(!1),R(null)}catch(v){l(`Failed to create and assign task: ${H(v)}`,"error")}},[L,l,h,k]);return W?e.jsx("div",{className:"todo-view",children:e.jsxs("div",{className:"todo-loading",children:[e.jsx(Rt,{className:"todo-loading-icon","aria-hidden":"true"}),e.jsx("p",{children:"Loading todos..."})]})}):e.jsx("div",{className:`todo-view${N?" todo-view--mobile-keyboard-active":""}`,"data-testid":"todo-view-root",children:e.jsxs("div",{className:"todo-view-layout",children:[e.jsxs("aside",{className:"todo-view-sidebar","aria-label":"Todo lists sidebar",children:[e.jsxs("div",{className:"todo-sidebar-header",children:[e.jsx("h3",{className:"todo-sidebar-title",children:"Lists"}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-add-list-btn",onClick:()=>{B(),a(!0),w(null)},"aria-label":"Add list","data-testid":"add-list-button",children:e.jsx(Pt,{})})]}),n&&e.jsxs("div",{className:"todo-list-item",children:[e.jsx("input",{className:"input todo-inline-edit-input",placeholder:"New list title",value:m,onChange:t=>i(t.target.value),onKeyDown:t=>{t.key==="Enter"&&dt(),t.key==="Escape"&&(i(""),a(!1))},autoFocus:!0,"data-testid":"new-list-input"}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{dt()},"aria-label":"Save list",children:e.jsx(J,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{i(""),a(!1)},"aria-label":"Cancel list",children:e.jsx(Q,{})})]}),g.length===0&&!n?e.jsxs("div",{className:"todo-empty-state",children:[e.jsx(ut,{"aria-hidden":"true"}),e.jsx("p",{children:"No todo lists yet. Create one to get started."}),e.jsx("button",{type:"button",className:"btn btn-sm",onClick:()=>{B(),a(!0)},children:"Create List"})]}):e.jsx("div",{className:"todo-list-items",role:"list","aria-label":"Todo lists",children:g.map(t=>{const p=t.id===S,v=t.id===T;return e.jsx("div",{className:`todo-list-item${p?" todo-list-item--active":""}`,role:"listitem",children:v?e.jsxs(e.Fragment,{children:[e.jsx("input",{className:"input todo-inline-edit-input",value:_,onChange:b=>A(b.target.value),onKeyDown:b=>{b.key==="Enter"&&st(),b.key==="Escape"&&nt()},autoFocus:!0,"data-testid":`rename-list-input-${t.id}`}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{st()},"aria-label":"Save list rename",children:e.jsx(J,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:nt,"aria-label":"Cancel list rename",children:e.jsx(Q,{})})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"todo-list-select-btn",onClick:()=>gt(t.id),"aria-label":`Select list ${t.title}`,"aria-current":p?"true":void 0,"data-testid":`todo-list-${t.id}`,children:e.jsx("span",{className:"todo-list-item-name",children:t.title})}),e.jsxs("div",{className:"todo-list-item-actions",children:[e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{jt(t)},"aria-label":`Rename ${t.title}`,"data-testid":`rename-list-button-${t.id}`,children:e.jsx(mt,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon btn-danger todo-icon-btn",onClick:()=>{yt(t.id)},"aria-label":`Delete ${t.title}`,"data-testid":`delete-list-button-${t.id}`,children:e.jsx(bt,{})})]})]})},t.id)})})]}),e.jsxs("section",{className:"todo-view-main","aria-label":"Todo items",children:[F&&e.jsxs("div",{className:"todo-error-banner",role:"alert",children:[e.jsx("span",{className:"todo-error-message",children:F}),e.jsx("button",{type:"button",className:"btn btn-sm",onClick:()=>window.location.reload(),children:"Retry"})]}),tt?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"todo-items-header",children:e.jsx("h3",{children:tt.title})}),e.jsxs("div",{className:"todo-add-item-row",children:[e.jsx("input",{className:"input",placeholder:"Add a todo item",value:o,onChange:t=>u(t.target.value),onKeyDown:t=>{t.key==="Enter"&&rt(),t.key==="Escape"&&u("")},"data-testid":"new-item-input"}),e.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>{rt()},children:"Add"})]}),K.length===0?e.jsx("div",{className:"todo-empty-state",children:e.jsx("p",{children:"No items in this list. Add one above."})}):e.jsx("div",{className:"todo-items-list",children:K.map((t,p)=>{const v=t.id===M;return e.jsxs("div",{className:"todo-item","data-testid":`todo-item-${t.id}`,children:[e.jsxs("div",{className:"todo-item-main-row",children:[e.jsx("input",{type:"checkbox",checked:t.completed,onChange:()=>{z(t.id)},className:"todo-item-checkbox","aria-label":`Toggle ${t.text}`,"data-testid":`toggle-item-${t.id}`}),v?e.jsx("input",{className:"input todo-inline-edit-input",value:c,onChange:b=>r(b.target.value),onKeyDown:b=>{b.key==="Enter"&&it(),b.key==="Escape"&&ot()},autoFocus:!0,"data-testid":`edit-item-input-${t.id}`}):e.jsx("button",{type:"button",className:`todo-item-text${t.completed?" todo-item-text--completed":""}`,onClick:()=>at(t),children:t.text})]}),e.jsx("div",{className:"todo-item-actions","data-testid":`todo-item-actions-${t.id}`,children:v?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{it()},"aria-label":"Save item edit",children:e.jsx(J,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:ot,"aria-label":"Cancel item edit",children:e.jsx(Q,{})})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"todo-item-reorder-btns",children:[e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-item-reorder-btn",onClick:()=>{ct(t.id,"up")},disabled:p===0,"aria-label":`Move ${t.text} up`,"data-testid":`move-up-${t.id}`,children:e.jsx(Ut,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-item-reorder-btn",onClick:()=>{ct(t.id,"down")},disabled:p===K.length-1,"aria-label":`Move ${t.text} down`,"data-testid":`move-down-${t.id}`,children:e.jsx(_t,{})})]}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{x?.(t.text)},"aria-label":`Start planning from ${t.text}`,"data-testid":`planning-from-${t.id}`,children:e.jsx(Kt,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{Lt(t)},"aria-label":`Create task from ${t.text}`,"data-testid":`create-task-from-${t.id}`,children:e.jsx(Wt,{})}),e.jsxs("div",{className:"todo-agent-picker-trigger",ref:Z===t.id?G:void 0,children:[e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{R(t.id),vt()},"aria-label":`Assign ${t.text} to agent`,"data-testid":`assign-agent-for-${t.id}`,children:e.jsx(pt,{})}),q&&Z===t.id&&e.jsx("div",{className:"todo-agent-picker-dropdown",onMouseDown:b=>{b.preventDefault()},children:ft?e.jsx("div",{className:"todo-agent-picker-loading",children:"Loading agents..."}):h.length>0?h.map(b=>e.jsxs("button",{type:"button",className:"todo-agent-picker-item",onClick:()=>{kt(t,b.id)},children:[e.jsx(pt,{}),e.jsx("span",{children:b.name}),e.jsx("span",{className:"todo-agent-picker-role",children:b.role})]},b.id)):e.jsx("div",{className:"todo-agent-picker-empty",children:"No agents available"})})]}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>at(t),"aria-label":`Edit ${t.text}`,"data-testid":`edit-item-${t.id}`,children:e.jsx(mt,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon btn-danger todo-icon-btn",onClick:()=>{It(t.id)},"aria-label":`Delete ${t.text}`,"data-testid":`delete-item-${t.id}`,children:e.jsx(bt,{})})]})})]},t.id)})})]}):e.jsxs("div",{className:"todo-empty-state",children:[e.jsx(ut,{"aria-hidden":"true"}),e.jsx("p",{children:"Select a list from the sidebar"})]})]})]})})}export{Jt as TodoView};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{r as s}from"./vendor-react-K0fH_qHe.js";/**
|
|
2
|
+
* @license lucide-react v0.542.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const C=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),w=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,o)=>o?o.toUpperCase():r.toLowerCase()),i=t=>{const e=w(t);return e.charAt(0).toUpperCase()+e.slice(1)},l=(...t)=>t.filter((e,r,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===r).join(" ").trim(),f=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
|
|
7
|
+
* @license lucide-react v0.542.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/var h={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
12
|
+
* @license lucide-react v0.542.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const g=s.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:n="",children:a,iconNode:u,...c},p)=>s.createElement("svg",{ref:p,...h,width:e,height:e,stroke:t,strokeWidth:o?Number(r)*24/Number(e):r,className:l("lucide",n),...!a&&!f(c)&&{"aria-hidden":"true"},...c},[...u.map(([m,d])=>s.createElement(m,d)),...Array.isArray(a)?a:[a]]));/**
|
|
17
|
+
* @license lucide-react v0.542.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const b=(t,e)=>{const r=s.forwardRef(({className:o,...n},a)=>s.createElement(g,{ref:a,iconNode:e,className:l(`lucide-${C(i(t))}`,`lucide-${t}`,o),...n}));return r.displayName=i(t),r};export{b as c};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import{r as s,j as e}from"./vendor-react-K0fH_qHe.js";import{c as X}from"./createLucideIcon-BazL2hk5.js";/**
|
|
2
|
+
* @license lucide-react v0.542.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const It=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],zt=X("arrow-left",It);/**
|
|
7
|
+
* @license lucide-react v0.542.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const At=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],he=X("check",At);/**
|
|
12
|
+
* @license lucide-react v0.542.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const Ot=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Tt=X("chevron-up",Ot);/**
|
|
17
|
+
* @license lucide-react v0.542.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const Pt=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Ht=X("copy",Pt);/**
|
|
22
|
+
* @license lucide-react v0.542.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const Bt=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],it=X("download",Bt);/**
|
|
27
|
+
* @license lucide-react v0.542.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const Gt=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Xe=X("grip-vertical",Gt);/**
|
|
32
|
+
* @license lucide-react v0.542.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/const Lt=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],Vt=X("loader",Lt);/**
|
|
37
|
+
* @license lucide-react v0.542.0 - ISC
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the ISC license.
|
|
40
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const Jt=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],$e=X("pencil",Jt);/**
|
|
42
|
+
* @license lucide-react v0.542.0 - ISC
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the ISC license.
|
|
45
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/const Ut=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Te=X("plus",Ut);/**
|
|
47
|
+
* @license lucide-react v0.542.0 - ISC
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the ISC license.
|
|
50
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/const Kt=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],ht=X("sparkles",Kt);/**
|
|
52
|
+
* @license lucide-react v0.542.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/const qt=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Ve=X("trash-2",qt);/**
|
|
57
|
+
* @license lucide-react v0.542.0 - ISC
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the ISC license.
|
|
60
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/const Wt=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],oe=X("x",Wt),Yt="/api/plugins/fusion-plugin-roadmap";async function z(a,r){const d=await fetch(`${Yt}${a}`,{headers:{"Content-Type":"application/json",...r?.headers??{}},...r});if(!d.ok){let g=`${d.status} ${d.statusText}`;try{const _=await d.json();_.error&&(g=_.error)}catch{}throw new Error(g)}if(d.status!==204)return await d.json()}function A(a){return a?`?projectId=${encodeURIComponent(a)}`:""}function Xt(a){return z(`/roadmaps${A(a)}`)}function Qt(a,r){return z(`/roadmaps/${a}${A(r)}`)}function Zt(a,r){return z(`/roadmaps${A(r)}`,{method:"POST",body:JSON.stringify({...a,projectId:r})})}function ea(a,r,d){return z(`/roadmaps/${a}${A(d)}`,{method:"PATCH",body:JSON.stringify({...r,projectId:d})})}function ta(a,r){return z(`/roadmaps/${a}${A(r)}`,{method:"DELETE"})}function st(a,r,d){return z(`/roadmaps/${a}/milestones${A(d)}`,{method:"POST",body:JSON.stringify({...r,projectId:d})})}function aa(a,r,d){return z(`/roadmaps/milestones/${a}${A(d)}`,{method:"PATCH",body:JSON.stringify({...r,projectId:d})})}function ra(a,r){return z(`/roadmaps/milestones/${a}${A(r)}`,{method:"DELETE"})}function sa(a,r,d){return z(`/roadmaps/${a}/milestones/reorder${A(d)}`,{method:"POST",body:JSON.stringify({orderedMilestoneIds:r,projectId:d})})}function nt(a,r,d){return z(`/roadmaps/milestones/${a}/features${A(d)}`,{method:"POST",body:JSON.stringify({...r,projectId:d})})}function na(a,r,d){return z(`/roadmaps/features/${a}${A(d)}`,{method:"PATCH",body:JSON.stringify({...r,projectId:d})})}function ia(a,r){return z(`/roadmaps/features/${a}${A(r)}`,{method:"DELETE"})}function oa(a,r,d){return z(`/roadmaps/milestones/${a}/features/reorder${A(d)}`,{method:"POST",body:JSON.stringify({orderedFeatureIds:r,projectId:d})})}function la(a,r,d,g){return z(`/roadmaps/features/${a}/move${A(g)}`,{method:"POST",body:JSON.stringify({targetMilestoneId:r,targetIndex:d,projectId:g})})}function da(a,r,d=5,g){return z(`/roadmaps/${a}/suggestions/milestones${A(g)}`,{method:"POST",body:JSON.stringify({goalPrompt:r,count:d,projectId:g})})}function ca(a,r,d){return z(`/roadmaps/milestones/${a}/suggestions/features${A(d)}`,{method:"POST",body:JSON.stringify({...r,projectId:d})})}function ua(a,r){return z(`/roadmaps/${a}/handoff${A(r)}`)}function ma(a){const r=a?.projectId,[d,g]=s.useState([]),[_,j]=s.useState(null),[N,f]=s.useState(null),[E,D]=s.useState([]),[y,S]=s.useState({}),[O,Q]=s.useState(!1),[J,I]=s.useState(null),[le,fe]=s.useState(null),[Je,ve]=s.useState(!1),[be,ae]=s.useState(null),[xe,B]=s.useState([]),[P,G]=s.useState(!1),[we,L]=s.useState({}),[de,re]=s.useState({}),Z=s.useRef(we),_e=s.useRef(de),ce=s.useRef(xe);Z.current=we,_e.current=de,ce.current=xe;const je=s.useRef(r),M=s.useRef(0),ue=s.useRef(0),ye=s.useRef(d),x=s.useRef(_),me=s.useRef(E),Ce=s.useRef(y),$=s.useRef(r),Pe=s.useRef(le);ye.current=d,x.current=_,me.current=E,Ce.current=y,$.current=r,Pe.current=le,s.useEffect(()=>{je.current!==r&&(je.current=r,M.current++,j(null),f(null),D([]),S({}),fe(null),ae(null),B([]),G(!1),L({}),re({}))},[r]);const ee=s.useCallback(async()=>{Q(!0),I(null);try{const n=await Xt(r);g(n)}catch(n){I(n instanceof Error?n:new Error("Failed to fetch roadmaps"))}finally{Q(!1)}},[r]),C=s.useCallback(async n=>{try{const c=await Qt(n,r);f(c),D(c.milestones||[]);const o={};for(const i of c.milestones||[])o[i.id]=i.features||[];S(o)}catch(c){I(c instanceof Error?c:new Error("Failed to fetch roadmap"))}},[r]);s.useEffect(()=>{ee()},[ee]),s.useEffect(()=>{_?C(_):(f(null),D([]),S({}))},[_,C]);const He=s.useCallback(async(n,c)=>{try{const o=await Zt(n,$.current);g(i=>[...i,o]),c?.onSuccess?.()}catch(o){const i=o instanceof Error?o:new Error("Failed to create roadmap");throw c?.onError?.(i),i}},[]),Ne=s.useCallback(async(n,c,o)=>{try{const i=await ea(n,c,$.current);g(u=>u.map(l=>l.id===n?i:l)),x.current===n&&f(u=>u?{...u,...i}:null),o?.onSuccess?.()}catch(i){const u=i instanceof Error?i:new Error("Failed to update roadmap");throw o?.onError?.(u),u}},[]),Be=s.useCallback(async(n,c)=>{try{await ta(n,$.current),g(o=>o.filter(i=>i.id!==n)),x.current===n&&(j(null),f(null),D([]),S({})),c?.onSuccess?.()}catch(o){const i=o instanceof Error?o:new Error("Failed to delete roadmap");throw c?.onError?.(i),i}},[]),Ue=s.useCallback(n=>{j(n)},[]),h=s.useCallback(async(n,c)=>{const o=x.current;if(!o){const i=new Error("No roadmap selected");throw c?.onError?.(i),i}try{const i=await st(o,n,$.current);D(u=>[...u,i]),S(u=>({...u,[i.id]:[]})),x.current&&C(x.current),c?.onSuccess?.()}catch(i){const u=i instanceof Error?i:new Error("Failed to create milestone");throw c?.onError?.(u),u}},[C]),R=s.useCallback(async(n,c,o)=>{try{const i=await aa(n,c,$.current);D(u=>u.map(l=>l.id===n?i:l)),x.current&&C(x.current),o?.onSuccess?.()}catch(i){const u=i instanceof Error?i:new Error("Failed to update milestone");throw o?.onError?.(u),u}},[C]),se=s.useCallback(async(n,c)=>{try{await ra(n,$.current),D(o=>o.filter(i=>i.id!==n)),S(o=>{const i={...o};return delete i[n],i}),x.current&&C(x.current),c?.onSuccess?.()}catch(o){const i=o instanceof Error?o:new Error("Failed to delete milestone");throw c?.onError?.(i),i}},[C]),Ke=s.useCallback(async(n,c,o)=>{try{const i=await nt(n,c,$.current);S(u=>({...u,[n]:[...u[n]||[],i]})),x.current&&C(x.current),o?.onSuccess?.()}catch(i){const u=i instanceof Error?i:new Error("Failed to create feature");throw o?.onError?.(u),u}},[C]),Re=s.useCallback(async(n,c,o)=>{try{const i=await na(n,c,$.current);S(u=>{const l={};for(const[v,p]of Object.entries(u))l[v]=p.map(w=>w.id===n?i:w);return l}),x.current&&C(x.current),o?.onSuccess?.()}catch(i){const u=i instanceof Error?i:new Error("Failed to update feature");throw o?.onError?.(u),u}},[C]),Ie=s.useCallback(async(n,c)=>{try{await ia(n,$.current),S(o=>{const i={};for(const[u,l]of Object.entries(o))i[u]=l.filter(v=>v.id!==n);return i}),x.current&&C(x.current),c?.onSuccess?.()}catch(o){const i=o instanceof Error?o:new Error("Failed to delete feature");throw c?.onError?.(i),i}},[C]),k=s.useCallback(async(n,c,o)=>{const i=me.current,u=c.map(l=>i.find(v=>v.id===l)).filter(l=>l!==void 0).map((l,v)=>({...l,orderIndex:v}));D(u);try{await sa(n,c,$.current),x.current&&C(x.current),o?.onSuccess?.()}catch(l){D(i);const v=l instanceof Error?l:new Error("Failed to reorder milestones");throw o?.onError?.(v),v}},[C]),pe=s.useCallback(async(n,c,o)=>{const i=Ce.current[n]||[],u=i.map(p=>p.id);if(JSON.stringify(u)===JSON.stringify(c)){o?.onSuccess?.();return}const l=Ce.current,v=c.map(p=>i.find(w=>w.id===p)).filter(p=>p!==void 0).map((p,w)=>({...p,orderIndex:w}));S(p=>({...p,[n]:v}));try{await oa(n,c,$.current),x.current&&C(x.current),o?.onSuccess?.()}catch(p){S(l);const w=p instanceof Error?p:new Error("Failed to reorder features");throw o?.onError?.(w),w}},[C]),te=s.useCallback(async(n,c,o,i)=>{const u=Ce.current;let l=null;for(const[F,W]of Object.entries(u))if(W.some(We=>We.id===n)){l=F;break}if(!l){const F=new Error("Feature not found");throw i?.onError?.(F),F}if(l===c){const F=u[l]||[],W=Math.max(0,Math.min(o,F.length-1));if(F.findIndex(Ye=>Ye.id===n)===W){i?.onSuccess?.();return}}const v=u[l]||[],p=u[c]||[],w=v.find(F=>F.id===n);if(!w){const F=new Error("Feature not found");throw i?.onError?.(F),F}const H=v.filter(F=>F.id!==n).map((F,W)=>({...F,orderIndex:W})),Ee={...w,milestoneId:c,orderIndex:o},ie=[...p];ie.splice(o,0,Ee);const qe=ie.map((F,W)=>({...F,orderIndex:W}));S(l===c?F=>({...F,[l]:qe}):F=>({...F,[l]:H,[c]:qe}));try{await la(n,c,o,r),x.current&&C(x.current),i?.onSuccess?.()}catch(F){S(u);const W=F instanceof Error?F:new Error("Failed to move feature");throw i?.onError?.(W),W}},[C,r]);function U(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`draft-${Date.now()}-${Math.random().toString(36).slice(2,11)}`}const ne=s.useCallback(async(n,c=5,o)=>{const i=x.current;if(!i){const v=new Error("No roadmap selected");throw o?.onError?.(v),v}const u=M.current,l=$.current;G(!0);try{const v=await da(i,n,c,l);if(M.current!==u)return;const p=v.suggestions.map(w=>({id:U(),title:w.title,description:w.description}));B(p),o?.onSuccess?.()}catch(v){if(M.current!==u)return;const p=v instanceof Error?v:new Error("Failed to generate suggestions");throw o?.onError?.(p),p}finally{M.current===u&&G(!1)}},[]),ze=s.useCallback((n,c)=>{const i=ce.current.map(u=>u.id===n?{...u,...c}:u);ce.current=i,B(u=>u.map(l=>l.id===n?{...l,...c}:l))},[]),K=s.useCallback(async(n,c)=>{const o=x.current;if(!o){const p=new Error("No roadmap selected");throw c?.onError?.(p),p}const i=M.current,u=ce.current,l=u.findIndex(p=>p.id===n);if(l===-1){const p=new Error("Suggestion draft not found");throw c?.onError?.(p),p}const v=u[l];if(!v.title.trim()){const p=new Error("Title cannot be empty");throw c?.onError?.(p),p}B(p=>p.filter(w=>w.id!==n));try{if(await st(o,{title:v.title,description:v.description},$.current),M.current!==i){B(p=>{const w=[...p];return w.splice(l,0,v),w});return}x.current&&C(x.current),c?.onSuccess?.()}catch(p){B(H=>{const Ee=[...H];return Ee.splice(l,0,v),Ee});const w=p instanceof Error?p:new Error("Failed to accept suggestion");throw c?.onError?.(w),w}},[C]),q=s.useCallback(async n=>{const c=x.current;if(!c){const l=new Error("No roadmap selected");throw n?.onError?.(l),l}const o=[...ce.current];if(o.length===0)return;const i=o.findIndex(l=>!l.title.trim());if(i!==-1){const l=new Error(`Title cannot be empty at position ${i+1}`);throw n?.onError?.(l),l}B([]);const u=M.current;for(let l=0;l<o.length&&M.current===u;l++){const v=o[l];try{await st(c,{title:v.title,description:v.description},$.current)}catch(p){const w=p instanceof Error?p:new Error("Failed to accept all suggestions");throw n?.onError?.(w),w}}M.current===u&&(x.current&&C(x.current),n?.onSuccess?.())},[C]),Qe=s.useCallback(n=>_e.current[n]??!1,[]),Ge=s.useCallback(async(n,c,o)=>{const i=M.current,u=$.current;re(l=>({...l,[n]:!0}));try{const l=await ca(n,c,u);if(M.current!==i)return;const v=l.suggestions.map(p=>({id:U(),title:p.title,description:p.description}));L(p=>({...p,[n]:v})),o?.onSuccess?.()}catch(l){if(M.current!==i)return;const v=l instanceof Error?l:new Error("Failed to generate feature suggestions");throw o?.onError?.(v),v}finally{M.current===i&&re(l=>({...l,[n]:!1}))}},[]),Se=s.useCallback((n,c,o)=>{const u=(Z.current[n]||[]).map(l=>l.id===c?{...l,...o}:l);Z.current={...Z.current,[n]:u},L(l=>({...l,[n]:l[n]?.map(v=>v.id===c?{...v,...o}:v)||[]}))},[]),Le=s.useCallback(async(n,c,o)=>{const i=M.current,u=Z.current[n]||[],l=u.findIndex(p=>p.id===c);if(l===-1){const p=new Error("Suggestion draft not found");throw o?.onError?.(p),p}const v=u[l];if(!v.title.trim()){const p=new Error("Title cannot be empty");throw o?.onError?.(p),p}L(p=>({...p,[n]:p[n]?.filter(w=>w.id!==c)||[]}));try{if(await nt(n,{title:v.title,description:v.description},$.current),M.current!==i){L(p=>{const H=[...p[n]||[]];return H.splice(l,0,v),{...p,[n]:H}});return}x.current&&C(x.current),o?.onSuccess?.()}catch(p){L(H=>{const ie=[...H[n]||[]];return ie.splice(l,0,v),{...H,[n]:ie}});const w=p instanceof Error?p:new Error("Failed to accept suggestion");throw o?.onError?.(w),w}},[C]),Ze=s.useCallback(async(n,c)=>{const o=[...Z.current[n]||[]];if(o.length===0)return;const i=o.findIndex(l=>!l.title.trim());if(i!==-1){const l=new Error(`Title cannot be empty at position ${i+1}`);throw c?.onError?.(l),l}L(l=>({...l,[n]:[]}));const u=M.current;for(let l=0;l<o.length&&M.current===u;l++){const v=o[l];try{await nt(n,{title:v.title,description:v.description},$.current)}catch(p){const w=p instanceof Error?p:new Error("Failed to accept all suggestions");throw c?.onError?.(w),w}}M.current===u&&(x.current&&C(x.current),c?.onSuccess?.())},[C]),ke=s.useCallback(()=>{B([]),G(!1)},[]),et=s.useCallback(n=>{L(c=>{const o={...c};return delete o[n],o}),re(c=>{const o={...c};return delete o[n],o})},[]),ge=s.useCallback(async(n,c)=>{const o=++ue.current,i=r;ve(!0),ae(null);try{const u=await ua(n,i);if(ue.current!==o||r!==i)return;fe(u),c?.onSuccess?.()}catch(u){if(ue.current!==o||r!==i)return;const l=u instanceof Error?u:new Error(String(u));ae(l),fe(null),c?.onError?.(l)}finally{ue.current===o&&ve(!1)}},[r]),Ae=s.useCallback(()=>{fe(null),ae(null),ve(!1)},[]),tt=s.useCallback(async()=>{await ee(),x.current&&await C(x.current)},[ee,C]);return{roadmaps:d,selectedRoadmapId:_,selectedRoadmap:N,milestones:E,featuresByMilestoneId:y,loading:O,error:J,createRoadmap:He,updateRoadmap:Ne,deleteRoadmap:Be,selectRoadmap:Ue,createMilestone:h,updateMilestone:R,deleteMilestone:se,reorderMilestones:k,createFeature:Ke,updateFeature:Re,deleteFeature:Ie,reorderFeatures:pe,moveFeature:te,milestoneSuggestions:xe,isGeneratingSuggestions:P,generateMilestoneSuggestions:ne,updateMilestoneSuggestionDraft:ze,acceptMilestoneSuggestion:K,acceptAllMilestoneSuggestions:q,clearMilestoneSuggestions:ke,featureSuggestionsByMilestoneId:we,isGeneratingFeatureSuggestions:Qe,generateFeatureSuggestions:Ge,updateFeatureSuggestionDraft:Se,acceptFeatureSuggestion:Le,acceptAllFeatureSuggestions:Ze,clearFeatureSuggestions:et,handoffPayload:le,isFetchingHandoff:Je,handoffError:be,fetchHandoff:ge,clearHandoff:Ae,refresh:tt}}function pt(){return typeof window>"u"?"desktop":window.matchMedia("(max-width: 768px)").matches?"mobile":window.matchMedia("(min-width: 769px) and (max-width: 1024px)").matches?"tablet":"desktop"}function pa(){const[a,r]=s.useState(()=>pt());return s.useEffect(()=>{const d=()=>r(pt());return window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[]),a}function ga(){return{confirm:async a=>{const r=typeof a=="string"?a:[a.title,a.message].filter(Boolean).join(`
|
|
62
|
+
|
|
63
|
+
`);return window.confirm(r||"Are you sure?")}}}function ha({isOpen:a,onClose:r,roadmapTitle:d,handoffPayload:g,isLoading:_,error:j,onFetchHandoff:N,onCopyToClipboard:f}){return a?e.jsx("div",{className:"modal-overlay open",onClick:r,role:"presentation",children:e.jsxs("div",{className:"modal modal-lg",onClick:E=>E.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"handoff-modal-title",children:[e.jsxs("div",{className:"modal-header",children:[e.jsxs("h2",{id:"handoff-modal-title",children:["Export Roadmap: ",d]}),e.jsx("button",{className:"modal-close",onClick:r,"aria-label":"Close modal",children:e.jsx(oe,{size:18})})]}),e.jsxs("div",{className:"modal-body",children:[e.jsx("p",{className:"text-muted roadmaps-view__handoff-intro",children:"Export roadmap data for use in mission and task planning flows. This is a read-only export — no missions or tasks will be created."}),j&&e.jsxs("div",{className:"form-error roadmaps-view__handoff-error",children:["Error loading handoff data: ",j.message]}),!g&&!_&&e.jsx("div",{className:"roadmaps-view__handoff-empty-state",children:e.jsxs("button",{className:"btn btn-primary",onClick:N,children:[e.jsx(it,{size:16,className:"roadmaps-view__handoff-button-icon"}),"Load Handoff Data"]})}),_&&e.jsxs("div",{className:"roadmaps-view__handoff-loading-state",children:[e.jsx(Vt,{size:24,className:"spin"}),e.jsx("p",{className:"roadmaps-view__handoff-loading-text",children:"Loading handoff data..."})]}),g&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"roadmaps-view__handoff-section",children:[e.jsx("h3",{className:"roadmaps-view__handoff-section-title",children:"Mission Planning Handoff"}),e.jsx("div",{className:"card roadmaps-view__handoff-card",children:e.jsx("pre",{className:"roadmaps-view__handoff-pre roadmaps-view__handoff-pre--mission",children:JSON.stringify(g.mission,null,2)})})]}),e.jsxs("div",{className:"roadmaps-view__handoff-section",children:[e.jsxs("h3",{className:"roadmaps-view__handoff-section-title",children:["Feature Task Planning Handoffs (",g.features.length,")"]}),e.jsx("div",{className:"card roadmaps-view__handoff-card",children:e.jsx("pre",{className:"roadmaps-view__handoff-pre roadmaps-view__handoff-pre--features",children:JSON.stringify(g.features,null,2)})})]})]})]}),e.jsxs("div",{className:"modal-actions",children:[e.jsx("div",{className:"modal-actions-left",children:g&&e.jsxs("button",{className:"btn btn-sm",onClick:f,children:[e.jsx(Ht,{size:14,className:"roadmaps-view__handoff-copy-icon"}),"Copy to Clipboard"]})}),e.jsx("div",{className:"modal-actions-right",children:e.jsx("button",{className:"btn",onClick:r,children:"Close"})})]})]})}):null}function fa({roadmap:a,isSelected:r,onSelect:d,onEdit:g,onDelete:_,onExport:j}){const N=y=>{y.key==="Enter"&&d()},f=y=>{y.stopPropagation(),g()},E=y=>{y.stopPropagation(),_()},D=y=>{y.stopPropagation(),j()};return e.jsxs("div",{className:`roadmaps-view__sidebar-item${r?" roadmaps-view__sidebar-item--active":""}`,onClick:d,onKeyDown:N,role:"button",tabIndex:0,"aria-selected":r,"data-testid":`roadmap-item-${a.id}`,children:[e.jsxs("div",{className:"roadmaps-view__sidebar-item-content",children:[e.jsx("div",{className:"roadmaps-view__sidebar-item-title",children:a.title}),a.description&&e.jsx("div",{className:"roadmaps-view__sidebar-item-desc",children:a.description})]}),e.jsxs("div",{className:"roadmaps-view__sidebar-item-actions",onClick:f,role:"presentation",children:[e.jsx("button",{className:"roadmaps-view__icon-btn",onClick:D,title:"Export roadmap","aria-label":"Export roadmap","data-testid":`roadmap-export-${a.id}`,type:"button",children:e.jsx(it,{size:14})}),e.jsx("button",{className:"roadmaps-view__icon-btn",onClick:f,title:"Edit roadmap","aria-label":"Edit roadmap","data-testid":`roadmap-edit-${a.id}`,type:"button",children:e.jsx($e,{size:14})}),e.jsx("button",{className:"roadmaps-view__icon-btn roadmaps-view__icon-btn--danger",onClick:E,title:"Delete roadmap","aria-label":"Delete roadmap","data-testid":`roadmap-delete-${a.id}`,type:"button",children:e.jsx(Ve,{size:14})})]})]})}function va({roadmaps:a,selectedRoadmapId:r,onSelect:d,onCreate:g,onEdit:_,onDelete:j,onExport:N,showCreateForm:f,onCancelCreate:E,onSaveCreate:D}){return e.jsxs("div",{className:"roadmaps-view__mobile-list","data-testid":"roadmaps-view__mobile-list",children:[e.jsxs("div",{className:"roadmaps-view__mobile-list-header",children:[e.jsx("h2",{className:"roadmaps-view__mobile-list-title",children:"Roadmaps"}),!f&&e.jsx("button",{className:"roadmaps-view__mobile-add-btn",onClick:g,title:"Create roadmap","aria-label":"Create roadmap","data-testid":"mobile-create-roadmap-btn",children:e.jsx(Te,{size:18})})]}),f&&e.jsx("div",{className:"roadmaps-view__mobile-create-form",children:e.jsx(ft,{onSave:D,onCancel:E})}),a.length===0&&!f?e.jsxs("div",{className:"roadmaps-view__mobile-empty",children:[e.jsx("p",{children:"No roadmaps yet."}),e.jsxs("button",{className:"btn btn-primary btn-sm",onClick:g,children:[e.jsx(Te,{size:14}),e.jsx("span",{children:"Create Roadmap"})]})]}):e.jsx("div",{className:"roadmaps-view__mobile-list-items",children:a.map(y=>e.jsxs("div",{className:`roadmaps-view__mobile-item${y.id===r?" roadmaps-view__mobile-item--active":""}`,onClick:()=>d(y.id),role:"button",tabIndex:0,onKeyDown:S=>{S.key==="Enter"&&d(y.id)},"data-testid":`mobile-roadmap-item-${y.id}`,children:[e.jsxs("div",{className:"roadmaps-view__mobile-item-content",children:[e.jsx("span",{className:"roadmaps-view__mobile-item-title",children:y.title}),y.description&&e.jsx("span",{className:"roadmaps-view__mobile-item-desc",children:y.description})]}),e.jsxs("div",{className:"roadmaps-view__mobile-item-actions",children:[e.jsx("button",{className:"roadmaps-view__mobile-action-btn",onClick:S=>{S.stopPropagation(),N(y)},title:"Export roadmap","aria-label":"Export roadmap","data-testid":`mobile-roadmap-export-${y.id}`,children:e.jsx(it,{size:16})}),e.jsx("button",{className:"roadmaps-view__mobile-action-btn",onClick:S=>{S.stopPropagation(),_(y)},title:"Edit roadmap","aria-label":"Edit roadmap","data-testid":`mobile-roadmap-edit-${y.id}`,children:e.jsx($e,{size:16})}),e.jsx("button",{className:"roadmaps-view__mobile-action-btn roadmaps-view__mobile-action-btn--danger",onClick:S=>{S.stopPropagation(),j(y.id)},title:"Delete roadmap","aria-label":"Delete roadmap","data-testid":`mobile-roadmap-delete-${y.id}`,children:e.jsx(Ve,{size:16})})]})]},y.id))})]})}function ba({roadmapTitle:a,onBack:r,onEdit:d,onDelete:g,onCreate:_}){return e.jsxs("div",{className:"roadmaps-view__mobile-header","data-testid":"roadmaps-view__mobile-header",children:[e.jsx("button",{className:"roadmaps-view__mobile-back-btn",onClick:r,title:"Back to roadmap list","aria-label":"Back to roadmap list","data-testid":"mobile-back-btn",children:e.jsx(zt,{size:20})}),e.jsx("h2",{className:"roadmaps-view__mobile-header-title",children:a}),e.jsxs("div",{className:"roadmaps-view__mobile-header-actions",children:[e.jsx("button",{className:"roadmaps-view__mobile-action-btn",onClick:_,title:"Create roadmap","aria-label":"Create roadmap","data-testid":"mobile-header-create-btn",children:e.jsx(Te,{size:18})}),e.jsx("button",{className:"roadmaps-view__mobile-action-btn",onClick:d,title:"Edit roadmap","aria-label":"Edit roadmap","data-testid":"mobile-header-edit-btn",children:e.jsx($e,{size:18})}),e.jsx("button",{className:"roadmaps-view__mobile-action-btn roadmaps-view__mobile-action-btn--danger",onClick:g,title:"Delete roadmap","aria-label":"Delete roadmap","data-testid":"mobile-header-delete-btn",children:e.jsx(Ve,{size:18})})]})]})}function xa({milestone:a,features:r,onEditMilestone:d,onDeleteMilestone:g,onAddFeature:_,onEditFeature:j,onDeleteFeature:N,milestoneEdit:f,onMilestoneEditChange:E,onMilestoneEditFieldChange:D,onCancelMilestoneEdit:y,onSaveMilestoneEdit:S,featureEdit:O,onFeatureEditChange:Q,onStartFeatureEdit:J,onCancelFeatureEdit:I,onSaveFeatureEdit:le,projectId:fe,addToast:Je,isMilestoneDragging:ve,isMilestoneDropTarget:be,milestoneDropPosition:ae,onMilestoneDragStart:xe,onMilestoneDragEnd:B,onMilestoneDragOver:P,onMilestoneDrop:G,onMilestoneDragLeave:we,isFeatureDragging:L,isFeatureDropTarget:de,featureDropIndex:re,onFeatureDragStart:Z,onFeatureDragEnd:_e,onFeatureDragOver:ce,onFeatureDrop:je,onFeatureDragLeave:M,onFeatureDropOnMilestone:ue,featureSuggestions:ye,isGeneratingFeatureSuggestions:x,onGenerateFeatureSuggestions:me,onAcceptFeatureSuggestion:Ce,onAcceptAllFeatureSuggestions:$,onUpdateFeatureSuggestionDraft:Pe,onClearFeatureSuggestions:ee}){const C=f?.milestoneId===a.id,He=h=>{h.key==="Enter"?(h.preventDefault(),f&&S({title:f.value})):h.key==="Escape"&&y()},Ne=h=>{h.key==="Escape"&&y()},Be=["roadmaps-view__milestone",ve?"roadmaps-view__milestone--dragging":"",be?"roadmaps-view__milestone--drop-target":"",be&&ae==="before"?"roadmaps-view__milestone--drop-before":"",be&&ae==="after"?"roadmaps-view__milestone--drop-after":""].filter(Boolean).join(" "),Ue=["roadmaps-view__feature-list",de?"roadmaps-view__feature-list--drop-target":""].filter(Boolean).join(" ");return e.jsxs("div",{className:Be,draggable:!C,onDragStart:h=>{C||(xe(a.id),h.dataTransfer.setData("text/plain",`milestone:${a.id}`),h.dataTransfer.effectAllowed="move")},onDragEnd:B,onDragOver:h=>{h.dataTransfer.types.includes("text/plain")&&h.dataTransfer.types.includes("text/plain")&&(h.preventDefault(),h.dataTransfer.dropEffect="move",P(a.id))},onDrop:h=>{h.preventDefault(),h.dataTransfer.getData("text/plain")?.startsWith("feature:")||G(a.id)},onDragLeave:we,"data-testid":`milestone-card-${a.id}`,children:[e.jsx("div",{className:"roadmaps-view__milestone-header",children:C&&f?e.jsxs("div",{className:"roadmaps-view__inline-edit",children:[e.jsxs("div",{className:"roadmaps-view__inline-edit-row",children:[e.jsx("span",{className:"roadmaps-view__drag-handle",title:"Drag to reorder","aria-label":"Drag to reorder","data-testid":`milestone-drag-handle-${a.id}`,children:e.jsx(Xe,{size:14})}),e.jsx("input",{type:"text",className:"roadmaps-view__inline-input",value:f.value,onChange:h=>{D("title"),E(h.target.value)},onKeyDown:He,placeholder:"Milestone title",autoFocus:!0,"data-testid":`milestone-title-input-${a.id}`}),e.jsx("button",{className:"roadmaps-view__icon-btn roadmaps-view__icon-btn--success",onClick:()=>S({title:f.value}),"aria-label":"Save milestone title",title:"Save",children:e.jsx(he,{size:14})}),e.jsx("button",{className:"roadmaps-view__icon-btn",onClick:y,"aria-label":"Cancel editing",title:"Cancel",children:e.jsx(oe,{size:14})})]}),e.jsx("textarea",{className:"roadmaps-view__inline-textarea",value:f.field==="description"?f.value:a.description||"",onChange:h=>{D("description"),E(h.target.value)},onKeyDown:Ne,placeholder:"Milestone description (optional)",rows:2,"data-testid":`milestone-desc-input-${a.id}`})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"roadmaps-view__milestone-title-row",children:[e.jsx("span",{className:"roadmaps-view__drag-handle",title:"Drag to reorder","aria-label":"Drag to reorder","data-testid":`milestone-drag-handle-${a.id}`,children:e.jsx(Xe,{size:14})}),e.jsx("h3",{className:"roadmaps-view__milestone-title",children:a.title}),e.jsxs("div",{className:"roadmaps-view__milestone-actions",children:[e.jsx("button",{className:"roadmaps-view__icon-btn",onClick:d,title:"Edit milestone","aria-label":"Edit milestone","data-testid":`milestone-edit-${a.id}`,children:e.jsx($e,{size:14})}),e.jsx("button",{className:"roadmaps-view__icon-btn roadmaps-view__icon-btn--danger",onClick:g,title:"Delete milestone","aria-label":"Delete milestone","data-testid":`milestone-delete-${a.id}`,children:e.jsx(Ve,{size:14})})]})]}),a.description&&e.jsx("p",{className:"roadmaps-view__milestone-desc",children:a.description})]})}),e.jsxs("div",{className:"roadmaps-view__milestone-actions-bar",children:[e.jsxs("button",{className:"roadmaps-view__add-feature-btn",onClick:_,title:"Add feature","aria-label":"Add feature","data-testid":`add-feature-${a.id}`,children:[e.jsx(Te,{size:12}),e.jsx("span",{children:"Add Feature"})]}),e.jsxs("button",{className:"roadmaps-view__suggest-btn",onClick:()=>{me?.()},disabled:x??!1,title:"Generate feature suggestions with AI","aria-label":"Generate feature suggestions","data-testid":`generate-features-${a.id}`,children:[e.jsx(ht,{size:12}),e.jsx("span",{children:x?"Generating...":"AI Suggestions"})]})]}),e.jsxs("div",{className:Ue,onDragOver:h=>{h.preventDefault(),h.dataTransfer.dropEffect="move",h.dataTransfer.getData("text/plain")?.startsWith("feature:")&&ue()},onDrop:h=>{h.preventDefault();const R=h.dataTransfer.getData("text/plain");R?.startsWith("feature:")&&je(R.split(":")[1],r.length)},onDragLeave:M,children:[r.length===0?e.jsx("p",{className:"roadmaps-view__empty-features",children:"No features yet."}):r.map((h,R)=>{const se=O?.featureId===h.id,Ke=L(h.id),Re=k=>{k.key==="Enter"?(k.preventDefault(),O&&le({title:O.value})):k.key==="Escape"&&I()},Ie=["roadmaps-view__feature-item",Ke?"roadmaps-view__feature-item--dragging":"",de&&re===R?"roadmaps-view__feature-item--drop-before":"",de&&re===R+1?"roadmaps-view__feature-item--drop-after":""].filter(Boolean).join(" ");return e.jsx("div",{className:Ie,draggable:!se,onDragStart:k=>{se||(Z(h.id,a.id),k.dataTransfer.setData("text/plain",`feature:${h.id}`),k.dataTransfer.effectAllowed="move")},onDragEnd:_e,onDragOver:k=>{if(k.preventDefault(),k.stopPropagation(),k.dataTransfer.dropEffect="move",k.dataTransfer.getData("text/plain")?.startsWith("feature:")){const te=k.currentTarget.getBoundingClientRect(),U=te.top+te.height/2,ne=k.clientY<U?"before":"after";ce(h.id,ne)}},onDrop:k=>{k.preventDefault(),k.stopPropagation();const pe=k.dataTransfer.getData("text/plain");if(pe?.startsWith("feature:")){const te=pe.split(":")[1],U=k.currentTarget.getBoundingClientRect(),ne=U.top+U.height/2,ze=k.clientY<ne?"before":"after";let K=R;ze==="after"&&(K=R+1),je(te,K)}},onDragLeave:M,"data-testid":`feature-item-${h.id}`,children:se&&O?e.jsx("div",{className:"roadmaps-view__inline-edit roadmaps-view__inline-edit--compact",children:e.jsxs("div",{className:"roadmaps-view__inline-edit-row",children:[e.jsx("span",{className:"roadmaps-view__drag-handle roadmaps-view__drag-handle--feature",title:"Drag to reorder","aria-label":"Drag to reorder","data-testid":`feature-drag-handle-${h.id}`,children:e.jsx(Xe,{size:12})}),e.jsx("input",{type:"text",className:"roadmaps-view__inline-input",value:O.value,onChange:k=>Q(k.target.value),onKeyDown:Re,placeholder:"Feature title",autoFocus:!0,"data-testid":`feature-title-input-${h.id}`}),e.jsx("button",{className:"roadmaps-view__icon-btn roadmaps-view__icon-btn--success",onClick:()=>le({title:O.value}),"aria-label":"Save feature title",title:"Save",children:e.jsx(he,{size:14})}),e.jsx("button",{className:"roadmaps-view__icon-btn",onClick:I,"aria-label":"Cancel editing",title:"Cancel",children:e.jsx(oe,{size:14})})]})}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"roadmaps-view__drag-handle roadmaps-view__drag-handle--feature",title:"Drag to reorder","aria-label":"Drag to reorder","data-testid":`feature-drag-handle-${h.id}`,children:e.jsx(Xe,{size:12})}),e.jsxs("div",{className:"roadmaps-view__feature-content",children:[e.jsx("span",{className:"roadmaps-view__feature-title",children:h.title}),h.description&&e.jsx("p",{className:"roadmaps-view__feature-desc",children:h.description})]}),e.jsxs("div",{className:"roadmaps-view__feature-actions",children:[e.jsx("button",{className:"roadmaps-view__icon-btn",onClick:()=>j(h.id),title:"Edit feature","aria-label":"Edit feature","data-testid":`feature-edit-${h.id}`,children:e.jsx($e,{size:12})}),e.jsx("button",{className:"roadmaps-view__icon-btn roadmaps-view__icon-btn--danger",onClick:()=>N(h.id),title:"Delete feature","aria-label":"Delete feature","data-testid":`feature-delete-${h.id}`,children:e.jsx(Ve,{size:12})})]})]})},h.id)}),ye&&ye.length>0&&e.jsxs("div",{className:"roadmap-suggestion-section",children:[e.jsxs("div",{className:"roadmap-suggestion-header",children:[e.jsx("h4",{className:"roadmap-suggestion-title",children:"AI Feature Suggestions"}),e.jsxs("div",{className:"roadmap-suggestion-actions",children:[e.jsx("button",{className:"roadmap-suggestion-accept-all-btn",onClick:()=>$?.(),title:"Accept all suggestions","aria-label":"Accept all","data-testid":`accept-all-features-${a.id}`,children:"Accept All"}),e.jsx("button",{className:"roadmap-suggestion-clear-btn",onClick:()=>ee?.(),title:"Clear suggestions","aria-label":"Clear","data-testid":`clear-features-${a.id}`,children:"Clear"})]})]}),e.jsx("div",{className:"roadmap-suggestion-list",children:ye.map(h=>e.jsx(wa,{suggestion:h,onUpdateDraft:R=>Pe?.(a.id,h.id,R),onAccept:()=>{Ce?.(a.id,h.id)},testIdPrefix:`feature-suggestion-${a.id}`},h.id))})]})]})]})}function wa({suggestion:a,onUpdateDraft:r,onAccept:d,testIdPrefix:g}){const[_,j]=s.useState(!1),[N,f]=s.useState(a.title),[E,D]=s.useState(a.description||""),y=()=>{f(a.title),D(a.description||""),j(!0)},S=()=>{r({title:N.trim(),description:E.trim()||void 0}),j(!1)},O=()=>{f(a.title),D(a.description||""),j(!1)},Q=()=>{a.title.trim()&&d()},J=a.title.trim().length>0;return _?e.jsx("div",{className:"roadmap-suggestion-card roadmap-suggestion-card--editing",children:e.jsxs("div",{className:"roadmap-suggestion-edit-form",children:[e.jsx("input",{type:"text",className:"roadmap-suggestion-input",value:N,onChange:I=>f(I.target.value),placeholder:"Feature title",autoFocus:!0,"data-testid":`${g}-${a.id}-title-input`}),e.jsx("textarea",{className:"roadmap-suggestion-textarea",value:E,onChange:I=>D(I.target.value),placeholder:"Description (optional)",rows:2,"data-testid":`${g}-${a.id}-desc-input`}),e.jsxs("div",{className:"roadmap-suggestion-edit-actions",children:[e.jsx("button",{className:"roadmap-suggestion-save-btn",onClick:S,disabled:!N.trim(),title:"Save","data-testid":`${g}-${a.id}-save`,children:e.jsx(he,{size:12})}),e.jsx("button",{className:"roadmap-suggestion-cancel-btn",onClick:O,title:"Cancel","data-testid":`${g}-${a.id}-cancel`,children:e.jsx(oe,{size:12})})]})]})}):e.jsxs("div",{className:"roadmap-suggestion-card","data-testid":`${g}-${a.id}`,children:[e.jsxs("div",{className:"roadmap-suggestion-content",children:[e.jsx("span",{className:"roadmap-suggestion-card-title",children:a.title}),a.description&&e.jsx("p",{className:"roadmap-suggestion-card-desc",children:a.description})]}),e.jsxs("div",{className:"roadmap-suggestion-card-actions",children:[e.jsx("button",{className:"roadmap-suggestion-edit-btn",onClick:y,title:"Edit suggestion","aria-label":"Edit","data-testid":`${g}-${a.id}-edit`,children:e.jsx($e,{size:12})}),e.jsx("button",{className:"roadmap-suggestion-accept-btn",onClick:Q,disabled:!J,title:"Accept this suggestion","aria-label":"Accept","data-testid":`${g}-${a.id}-accept`,children:e.jsx(he,{size:12})})]})]})}function gt({suggestion:a,onUpdateDraft:r,onAccept:d,testIdPrefix:g}){const[_,j]=s.useState(!1),[N,f]=s.useState(a.title),[E,D]=s.useState(a.description||""),y=()=>{f(a.title),D(a.description||""),j(!0)},S=()=>{r({title:N.trim(),description:E.trim()||void 0}),j(!1)},O=()=>{f(a.title),D(a.description||""),j(!1)},Q=()=>{a.title.trim()&&d()},J=a.title.trim().length>0;return _?e.jsx("div",{className:"roadmap-suggestion-card roadmap-suggestion-card--editing",children:e.jsxs("div",{className:"roadmap-suggestion-edit-form",children:[e.jsx("input",{type:"text",className:"roadmap-suggestion-input",value:N,onChange:I=>f(I.target.value),placeholder:"Milestone title",autoFocus:!0,"data-testid":`${g}-${a.id}-title-input`}),e.jsx("textarea",{className:"roadmap-suggestion-textarea",value:E,onChange:I=>D(I.target.value),placeholder:"Description (optional)",rows:2,"data-testid":`${g}-${a.id}-desc-input`}),e.jsxs("div",{className:"roadmap-suggestion-edit-actions",children:[e.jsx("button",{className:"roadmap-suggestion-save-btn",onClick:S,disabled:!N.trim(),title:"Save","data-testid":`${g}-${a.id}-save`,children:e.jsx(he,{size:12})}),e.jsx("button",{className:"roadmap-suggestion-cancel-btn",onClick:O,title:"Cancel","data-testid":`${g}-${a.id}-cancel`,children:e.jsx(oe,{size:12})})]})]})}):e.jsxs("div",{className:"roadmap-suggestion-card","data-testid":`${g}-${a.id}`,children:[e.jsxs("div",{className:"roadmap-suggestion-content",children:[e.jsx("span",{className:"roadmap-suggestion-card-title",children:a.title}),a.description&&e.jsx("p",{className:"roadmap-suggestion-card-desc",children:a.description})]}),e.jsxs("div",{className:"roadmap-suggestion-card-actions",children:[e.jsx("button",{className:"roadmap-suggestion-edit-btn",onClick:y,title:"Edit suggestion","aria-label":"Edit","data-testid":`${g}-${a.id}-edit`,children:e.jsx($e,{size:12})}),e.jsx("button",{className:"roadmap-suggestion-accept-btn",onClick:Q,disabled:!J,title:"Accept this suggestion","aria-label":"Accept","data-testid":`${g}-${a.id}-accept`,children:e.jsx(he,{size:12})})]})]})}function ft({onSave:a,onCancel:r}){const[d,g]=s.useState(""),[_,j]=s.useState(""),N=f=>{f.preventDefault(),d.trim()&&a({title:d.trim(),description:_.trim()||void 0})};return e.jsx("div",{className:"roadmaps-view__create-form","data-testid":"create-roadmap-form",children:e.jsxs("form",{onSubmit:N,children:[e.jsx("input",{type:"text",className:"roadmaps-view__inline-input",value:d,onChange:f=>g(f.target.value),placeholder:"Roadmap title",autoFocus:!0,"data-testid":"create-roadmap-title"}),e.jsx("textarea",{className:"roadmaps-view__inline-textarea",value:_,onChange:f=>j(f.target.value),placeholder:"Roadmap description (optional)",rows:2,"data-testid":"create-roadmap-description"}),e.jsxs("div",{className:"roadmaps-view__create-form-actions",children:[e.jsx("button",{type:"submit",className:"roadmaps-view__btn roadmaps-view__btn--primary",disabled:!d.trim(),"data-testid":"create-roadmap-submit",children:"Create"}),e.jsx("button",{type:"button",className:"roadmaps-view__btn",onClick:r,"data-testid":"create-roadmap-cancel",children:"Cancel"})]})]})})}function _a({onSave:a,onCancel:r}){const[d,g]=s.useState(""),[_,j]=s.useState(""),N=f=>{f.preventDefault(),d.trim()&&a({title:d.trim(),description:_.trim()||void 0})};return e.jsx("div",{className:"roadmaps-view__create-form roadmaps-view__create-form--inline","data-testid":"create-milestone-form",children:e.jsxs("form",{onSubmit:N,className:"roadmaps-view__inline-form",children:[e.jsx("input",{type:"text",className:"roadmaps-view__inline-input",value:d,onChange:f=>g(f.target.value),placeholder:"Milestone title",autoFocus:!0,"data-testid":"create-milestone-title"}),e.jsx("textarea",{className:"roadmaps-view__inline-textarea",value:_,onChange:f=>j(f.target.value),placeholder:"Description (optional)",rows:1,"data-testid":"create-milestone-description"}),e.jsxs("div",{className:"roadmaps-view__inline-form-actions",children:[e.jsx("button",{type:"submit",className:"roadmaps-view__icon-btn roadmaps-view__icon-btn--success",disabled:!d.trim(),"aria-label":"Save milestone",title:"Save","data-testid":"create-milestone-submit",children:e.jsx(he,{size:14})}),e.jsx("button",{type:"button",className:"roadmaps-view__icon-btn",onClick:r,"aria-label":"Cancel",title:"Cancel","data-testid":"create-milestone-cancel",children:e.jsx(oe,{size:14})})]})]})})}function ja({onSave:a,onCancel:r}){const[d,g]=s.useState(""),[_,j]=s.useState(""),N=f=>{f.preventDefault(),d.trim()&&a({title:d.trim(),description:_.trim()||void 0})};return e.jsx("div",{className:"roadmaps-view__create-form roadmaps-view__create-form--inline","data-testid":"create-feature-form",children:e.jsxs("form",{onSubmit:N,className:"roadmaps-view__inline-form",children:[e.jsx("input",{type:"text",className:"roadmaps-view__inline-input",value:d,onChange:f=>g(f.target.value),placeholder:"Feature title",autoFocus:!0,"data-testid":"create-feature-title"}),e.jsx("textarea",{className:"roadmaps-view__inline-textarea",value:_,onChange:f=>j(f.target.value),placeholder:"Description (optional)",rows:1,"data-testid":"create-feature-description"}),e.jsxs("div",{className:"roadmaps-view__inline-form-actions",children:[e.jsx("button",{type:"submit",className:"roadmaps-view__icon-btn roadmaps-view__icon-btn--success",disabled:!d.trim(),"aria-label":"Save feature",title:"Save","data-testid":"create-feature-submit",children:e.jsx(he,{size:14})}),e.jsx("button",{type:"button",className:"roadmaps-view__icon-btn",onClick:r,"aria-label":"Cancel",title:"Cancel","data-testid":"create-feature-cancel",children:e.jsx(oe,{size:14})})]})]})})}function ya({projectId:a,addToast:r}){const{confirm:d}=ga(),g=pa()==="mobile",{roadmaps:_,selectedRoadmapId:j,selectedRoadmap:N,milestones:f,featuresByMilestoneId:E,loading:D,error:y,createRoadmap:S,updateRoadmap:O,deleteRoadmap:Q,selectRoadmap:J,createMilestone:I,updateMilestone:le,deleteMilestone:fe,createFeature:Je,updateFeature:ve,deleteFeature:be,reorderMilestones:ae,reorderFeatures:xe,moveFeature:B,milestoneSuggestions:P,isGeneratingSuggestions:G,generateMilestoneSuggestions:we,updateMilestoneSuggestionDraft:L,acceptMilestoneSuggestion:de,acceptAllMilestoneSuggestions:re,clearMilestoneSuggestions:Z,featureSuggestionsByMilestoneId:_e,isGeneratingFeatureSuggestions:ce,generateFeatureSuggestions:je,updateFeatureSuggestionDraft:M,acceptFeatureSuggestion:ue,acceptAllFeatureSuggestions:ye,clearFeatureSuggestions:x,handoffPayload:me,isFetchingHandoff:Ce,handoffError:$,fetchHandoff:Pe,clearHandoff:ee}=ma({projectId:a}),[C,He]=s.useState(!1),[Ne,Be]=s.useState(null),[Ue,h]=s.useState(""),[R,se]=s.useState(""),[Ke,Re]=s.useState(!1),Ie=s.useRef(null);s.useEffect(()=>{Ie.current!==null&&Ie.current!==j&&Re(!1),Ie.current=j},[j]);const[k,pe]=s.useState({roadmapId:null,field:null,value:""}),[te,U]=s.useState({milestoneId:null,field:null,value:""}),[ne,ze]=s.useState({featureId:null,field:null,value:""}),[K,q]=s.useState({type:null,parentId:void 0,title:"",description:""}),[Qe,Ge]=s.useState(!1),[Se,Le]=s.useState({draggingId:null,dropTargetId:null,dropPosition:null}),Ze=s.useCallback(t=>{Le(m=>({...m,draggingId:t}))},[]),ke=s.useCallback(()=>{Le({draggingId:null,dropTargetId:null,dropPosition:null})},[]),et=s.useCallback(t=>{Le(m=>m.draggingId===t?m:{...m,dropTargetId:t,dropPosition:null})},[]),[ge,Ae]=s.useState({draggingId:null,draggingMilestoneId:null,dropTargetMilestoneId:null,dropTargetIndex:null,dropPosition:null}),tt=s.useCallback((t,m)=>{Ae(b=>({...b,draggingId:t,draggingMilestoneId:m}))},[]),n=s.useCallback(()=>{Ae({draggingId:null,draggingMilestoneId:null,dropTargetMilestoneId:null,dropTargetIndex:null,dropPosition:null})},[]),c=s.useCallback((t,m)=>{Ae(b=>{if(b.draggingId===t)return b;const V=(E[b.draggingMilestoneId||""]||[]).findIndex(De=>De.id===t);let Y;return m==="before"?Y=V:Y=V+1,{...b,dropTargetMilestoneId:b.draggingMilestoneId,dropTargetIndex:Y,dropPosition:m}})},[E]),o=s.useCallback(()=>{Ae(t=>({...t,dropTargetMilestoneId:t.draggingMilestoneId,dropTargetIndex:(E[t.draggingMilestoneId||""]||[]).length}))},[E]),i=s.useCallback(async(t,m)=>{const{draggingMilestoneId:b,dropTargetMilestoneId:T}=ge;if(!b){n();return}const V=T||b,Y=E[b]||[],De=Y.find(Me=>Me.id===t);if(!De){n();return}if(b!==V){if(b===V){n();return}try{await B(t,V,m,{onError:Me=>{r(`Failed to move feature: ${Me.message}`,"error")}})}catch{}}else{const Me=[...Y],$t=Me.findIndex(Oe=>Oe.id===t);Me.splice($t,1),Me.splice(m,0,De);const mt=Me.map(Oe=>Oe.id),Rt=Y.map(Oe=>Oe.id);if(mt.join(",")===Rt.join(",")){n();return}try{await xe(b,mt,{onError:Oe=>{r(`Failed to reorder features: ${Oe.message}`,"error")}})}catch{}}n()},[ge,E,xe,B,r,n]),u=s.useCallback(t=>{const m=t.currentTarget.getBoundingClientRect(),b=t.clientX,T=t.clientY;(b<m.left||b>m.right||T<m.top||T>m.bottom)&&Ae(V=>({...V,dropTargetMilestoneId:null,dropTargetIndex:null,dropPosition:null}))},[]),l=s.useCallback(t=>ge.draggingId===t,[ge.draggingId]),v=s.useCallback(async t=>{const{draggingId:m}=Se;if(!m||m===t){ke();return}const b=f.map(De=>De.id),T=b.indexOf(m),V=b.indexOf(t);if(T===-1||V===-1){ke();return}const Y=[...b];if(Y.splice(T,1),Y.splice(V,0,m),Y.join(",")===b.join(",")){ke();return}try{await ae(j,Y,{onError:De=>{r(`Failed to reorder milestones: ${De.message}`,"error")}})}catch{}ke()},[Se,f,j,ae,r,ke]),p=s.useCallback(t=>{const m=t.currentTarget.getBoundingClientRect(),b=t.clientX,T=t.clientY;(b<m.left||b>m.right||T<m.top||T>m.bottom)&&Le(V=>({...V,dropTargetId:null,dropPosition:null}))},[]),w=s.useCallback(t=>{J(t.id),pe({roadmapId:t.id,field:"title",value:t.title})},[J]),H=s.useCallback(()=>{pe({roadmapId:null,field:null,value:""})},[]),Ee=s.useCallback(async t=>{if(k.roadmapId)try{await O(k.roadmapId,t,{onError:m=>r(m.message,"error")}),H()}catch{}},[k.roadmapId,O,H,r]),ie=s.useCallback(async t=>{if(await d({title:"Delete Roadmap",message:"Delete this roadmap? This cannot be undone.",danger:!0}))try{await Q(t,{onError:b=>r(b.message,"error")}),r("Roadmap deleted","success")}catch{}},[Q,r,d]),qe=s.useCallback((t,m)=>{Be(t),h(m),He(!0),ee()},[ee]),F=s.useCallback(()=>{He(!1),Be(null),h(""),ee()},[ee]),W=s.useCallback(()=>{Ne&&Pe(Ne,{onError:t=>r(`Failed to load handoff: ${t.message}`,"error")})},[Ne,Pe,r]),We=s.useCallback(()=>{if(me){const t=JSON.stringify(me,null,2);navigator.clipboard.writeText(t).then(()=>{r("Handoff data copied to clipboard","success")}).catch(()=>{r("Failed to copy to clipboard","error")})}},[me,r]),Ye=s.useCallback(async t=>{try{await S(t,{onError:m=>r(m.message,"error")}),q({type:null,parentId:void 0,title:"",description:""}),r("Roadmap created","success")}catch{}},[S,r]),vt=s.useCallback(t=>{U({milestoneId:t.id,field:"title",value:t.title})},[]),bt=s.useCallback(t=>{U(m=>({...m,value:t}))},[]),xt=s.useCallback(t=>{U(m=>({...m,field:t}))},[]),at=s.useCallback(()=>{U({milestoneId:null,field:null,value:""})},[]),wt=s.useCallback(async t=>{if(te.milestoneId)try{await le(te.milestoneId,t,{onError:m=>r(m.message,"error")}),at()}catch{}},[te.milestoneId,le,at,r]),_t=s.useCallback(async t=>{if(await d({title:"Delete Milestone",message:"Delete this milestone and all its features?",danger:!0}))try{await fe(t,{onError:b=>r(b.message,"error")}),r("Milestone deleted","success")}catch{}},[fe,r,d]),jt=s.useCallback(async t=>{try{await I(t,{onError:m=>r(m.message,"error")}),q({type:null,parentId:void 0,title:"",description:""}),r("Milestone created","success")}catch{}},[I,r]),ot=s.useCallback((t,m,b)=>{ze({featureId:t,field:"title",value:m})},[]),yt=s.useCallback(t=>{ze(m=>({...m,value:t}))},[]),rt=s.useCallback(()=>{ze({featureId:null,field:null,value:""})},[]),Ct=s.useCallback(async t=>{if(ne.featureId)try{await ve(ne.featureId,t,{onError:m=>r(m.message,"error")}),rt()}catch{}},[ne.featureId,ve,rt,r]),Nt=s.useCallback(async t=>{if(await d({title:"Delete Feature",message:"Delete this feature?",danger:!0}))try{await be(t,{onError:b=>r(b.message,"error")}),r("Feature deleted","success")}catch{}},[be,r,d]),lt=s.useCallback(async()=>{if(R.trim())try{await we(R,5,{onError:t=>r(t.message,"error")})}catch{}},[R,we,r]),dt=s.useCallback(async t=>{try{await de(t,{onError:m=>r(m.message,"error")}),r("Milestone added","success")}catch{}},[de,r]),ct=s.useCallback(async()=>{try{await re({onError:t=>r(t.message,"error")}),r(`${P.length} milestones added`,"success"),se("")}catch{}},[re,P.length,r]),ut=s.useCallback(()=>{Z(),se("")},[Z]),St=s.useCallback(async t=>{try{await je(t,{count:5},{onError:m=>r(m.message,"error")})}catch{}},[je,r]),kt=s.useCallback(async(t,m)=>{try{await ue(t,m,{onError:b=>r(b.message,"error")}),r("Feature added","success")}catch{}},[ue,r]),Et=s.useCallback((t,m,b)=>{M(t,m,b)},[M]),Ft=s.useCallback(async t=>{const m=_e[t]||[];try{await ye(t,{onError:b=>r(b.message,"error")}),r(`${m.length} features added`,"success")}catch{}},[ye,_e,r]),Dt=s.useCallback(t=>{x(t)},[x]),Mt=s.useCallback(async(t,m)=>{try{await Je(t,m,{onError:b=>r(b.message,"error")}),q({type:null,parentId:void 0,title:"",description:""}),r("Feature created","success")}catch{}},[Je,r]),Fe=j;return D&&_.length===0?e.jsx("div",{className:"roadmaps-view roadmaps-view--loading",children:e.jsx("div",{className:"roadmaps-view__loading-state",children:"Loading roadmaps..."})}):y&&_.length===0?e.jsx("div",{className:"roadmaps-view roadmaps-view--error",children:e.jsxs("div",{className:"roadmaps-view__error-state",children:[e.jsx("p",{children:"Failed to load roadmaps"}),e.jsx("p",{className:"roadmaps-view__error-msg",children:y.message})]})}):e.jsxs("div",{className:"roadmaps-view",children:[g&&!Fe&&e.jsx(va,{roadmaps:_,selectedRoadmapId:Fe,onSelect:t=>J(t),onCreate:()=>Ge(!0),onEdit:w,onDelete:ie,onExport:t=>qe(t.id,t.title),showCreateForm:Qe,onCancelCreate:()=>Ge(!1),onSaveCreate:async t=>{await Ye(t),Ge(!1)}}),!g&&e.jsxs("aside",{className:"roadmaps-view__sidebar","aria-label":"Roadmaps",children:[e.jsxs("div",{className:"roadmaps-view__sidebar-header",children:[e.jsx("h2",{className:"roadmaps-view__sidebar-title",children:"Roadmaps"}),e.jsx("button",{className:"roadmaps-view__add-btn",onClick:()=>q({type:"roadmap",title:"",description:""}),title:"Create roadmap","aria-label":"Create roadmap","data-testid":"create-roadmap-btn",children:e.jsx(Te,{size:16})})]}),K.type==="roadmap"&&e.jsx(ft,{onSave:Ye,onCancel:()=>q({type:null,parentId:void 0,title:"",description:""})}),e.jsx("div",{className:"roadmaps-view__sidebar-list",children:_.length===0?e.jsx("p",{className:"roadmaps-view__empty-sidebar",children:"No roadmaps yet. Click + to create one."}):_.map(t=>e.jsx(fa,{roadmap:t,isSelected:t.id===Fe,onSelect:()=>J(t.id),onEdit:()=>w(t),onDelete:()=>ie(t.id),onExport:()=>qe(t.id,t.title)},t.id))})]}),e.jsxs("main",{className:"roadmaps-view__main","aria-label":"Roadmap content",children:[g&&Fe&&e.jsx(ba,{roadmapTitle:N?.title||"Untitled Roadmap",onBack:()=>J(null),onEdit:()=>{N&&w(N)},onDelete:()=>ie(Fe),onCreate:()=>Ge(!0)}),Fe?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"roadmaps-view__roadmap-header",children:k.roadmapId===Fe?e.jsx("div",{className:"roadmaps-view__inline-edit",children:e.jsxs("div",{className:"roadmaps-view__inline-edit-row",children:[e.jsx("input",{type:"text",className:"roadmaps-view__inline-input roadmaps-view__inline-input--large",value:k.value,onChange:t=>pe(m=>({...m,value:t.target.value})),onKeyDown:t=>{t.key==="Enter"?Ee({title:k.value}):t.key==="Escape"&&H()},placeholder:"Roadmap title",autoFocus:!0,"data-testid":"roadmap-title-input"}),e.jsx("button",{className:"roadmaps-view__icon-btn roadmaps-view__icon-btn--success",onClick:()=>Ee({title:k.value}),"aria-label":"Save",title:"Save",children:e.jsx(he,{size:16})}),e.jsx("button",{className:"roadmaps-view__icon-btn",onClick:H,"aria-label":"Cancel",title:"Cancel",children:e.jsx(oe,{size:16})})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"roadmaps-view__roadmap-title-row",children:[e.jsx("h1",{className:"roadmaps-view__roadmap-title",children:N?.title||"Untitled Roadmap"}),e.jsxs("div",{className:"roadmaps-view__roadmap-actions",children:[e.jsx("button",{className:"roadmaps-view__icon-btn",onClick:()=>{N&&w(N)},title:"Edit roadmap","aria-label":"Edit roadmap","data-testid":"edit-roadmap-btn",children:e.jsx($e,{size:16})}),e.jsx("button",{className:"roadmaps-view__icon-btn roadmaps-view__icon-btn--danger",onClick:()=>ie(Fe),title:"Delete roadmap","aria-label":"Delete roadmap","data-testid":"delete-roadmap-btn",children:e.jsx(Ve,{size:16})})]})]}),N?.description&&e.jsx("p",{className:"roadmaps-view__roadmap-desc",children:N.description})]})}),g?Ke?e.jsxs("div",{className:"roadmap-suggestion-section",children:[e.jsxs("div",{className:"roadmap-suggestion-header",children:[e.jsx("h3",{className:"roadmap-suggestion-title",children:"Generate Milestone Ideas"}),e.jsx("button",{className:"roadmap-suggestion-collapse-btn",onClick:()=>Re(!1),"aria-label":"Collapse suggestion panel","data-testid":"collapse-suggestion-panel-btn",children:e.jsx(Tt,{size:16})})]}),e.jsxs("div",{className:"roadmap-suggestion-form",children:[e.jsx("textarea",{className:"roadmap-suggestion-input",value:R,onChange:t=>se(t.target.value),placeholder:"Describe your roadmap goal (e.g., 'Build a user authentication system with OAuth, profiles, and admin dashboard')",rows:2,disabled:G||!j,"data-testid":"goal-prompt-input",autoFocus:!0}),e.jsxs("div",{className:"roadmap-suggestion-actions",children:[e.jsx("button",{className:"roadmap-suggestion-generate-btn",onClick:lt,disabled:!R.trim()||G||!j,"data-testid":"generate-suggestions-btn",children:G?"Generating...":"Generate Milestones"}),P.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:"roadmap-suggestion-accept-all-btn",onClick:ct,"data-testid":"accept-all-suggestions-btn",children:["Accept All (",P.length,")"]}),e.jsx("button",{className:"roadmap-suggestion-clear-btn",onClick:ut,title:"Clear suggestions","aria-label":"Clear suggestions","data-testid":"clear-suggestions-btn",children:e.jsx(oe,{size:14})})]})]})]}),P.length>0&&e.jsx("div",{className:"roadmap-suggestion-list",children:P.map(t=>e.jsx(gt,{suggestion:t,onUpdateDraft:m=>L(t.id,m),onAccept:()=>dt(t.id),testIdPrefix:"suggestion"},t.id))})]}):e.jsx("div",{className:"roadmap-suggestion-section",children:e.jsxs("button",{className:"roadmap-suggestion-expand-btn",onClick:()=>Re(!0),disabled:!j,"data-testid":"expand-suggestion-panel-btn",children:[e.jsx(ht,{size:16}),"Generate Milestone Ideas"]})}):e.jsxs("div",{className:"roadmap-suggestion-section",children:[e.jsx("div",{className:"roadmap-suggestion-header",children:e.jsx("h3",{className:"roadmap-suggestion-title",children:"Generate Milestone Ideas"})}),e.jsxs("div",{className:"roadmap-suggestion-form",children:[e.jsx("textarea",{className:"roadmap-suggestion-input",value:R,onChange:t=>se(t.target.value),placeholder:"Describe your roadmap goal (e.g., 'Build a user authentication system with OAuth, profiles, and admin dashboard')",rows:2,disabled:G||!j,"data-testid":"goal-prompt-input"}),e.jsxs("div",{className:"roadmap-suggestion-actions",children:[e.jsx("button",{className:"roadmap-suggestion-generate-btn",onClick:lt,disabled:!R.trim()||G||!j,"data-testid":"generate-suggestions-btn",children:G?"Generating...":"Generate Milestones"}),P.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:"roadmap-suggestion-accept-all-btn",onClick:ct,"data-testid":"accept-all-suggestions-btn",children:["Accept All (",P.length,")"]}),e.jsx("button",{className:"roadmap-suggestion-clear-btn",onClick:ut,title:"Clear suggestions","aria-label":"Clear suggestions","data-testid":"clear-suggestions-btn",children:e.jsx(oe,{size:14})})]})]})]}),P.length>0&&e.jsx("div",{className:"roadmap-suggestion-list",children:P.map(t=>e.jsx(gt,{suggestion:t,onUpdateDraft:m=>L(t.id,m),onAccept:()=>dt(t.id),testIdPrefix:"suggestion"},t.id))})]}),e.jsxs("div",{className:"roadmaps-view__milestone-lanes",children:[K.type==="milestone"&&e.jsx(_a,{onSave:jt,onCancel:()=>q({type:null,parentId:void 0,title:"",description:""})}),f.length===0&&K.type!=="milestone"?e.jsxs("div",{className:"roadmaps-view__empty-milestones",children:[e.jsx("p",{children:"This roadmap has no milestones."}),e.jsxs("button",{className:"roadmaps-view__add-milestone-btn",onClick:()=>q({type:"milestone",title:"",description:""}),"data-testid":"add-milestone-btn-empty",children:[e.jsx(Te,{size:14}),e.jsx("span",{children:"Add Milestone"})]})]}):e.jsxs(e.Fragment,{children:[K.type!=="milestone"&&e.jsxs("button",{className:"roadmaps-view__add-milestone-fab",onClick:()=>q({type:"milestone",title:"",description:""}),"data-testid":"add-milestone-btn",children:[e.jsx(Te,{size:14}),e.jsx("span",{children:"Add Milestone"})]}),f.map(t=>e.jsx(xa,{milestone:t,features:E[t.id]||[],onEditMilestone:()=>vt(t),onDeleteMilestone:()=>_t(t.id),onAddFeature:()=>q({type:"feature",parentId:t.id,title:"",description:""}),onEditFeature:m=>{const b=E[t.id]?.find(T=>T.id===m);b&&ot(m,b.title,b.description)},onDeleteFeature:Nt,milestoneEdit:te,onMilestoneEditChange:bt,onMilestoneEditFieldChange:xt,onCancelMilestoneEdit:at,onSaveMilestoneEdit:wt,featureEdit:ne,onFeatureEditChange:yt,onStartFeatureEdit:ot,onCancelFeatureEdit:rt,onSaveFeatureEdit:Ct,projectId:a,addToast:r,isMilestoneDragging:Se.draggingId===t.id,isMilestoneDropTarget:Se.dropTargetId===t.id,milestoneDropPosition:Se.dropTargetId===t.id?Se.dropPosition:null,onMilestoneDragStart:Ze,onMilestoneDragEnd:ke,onMilestoneDragOver:et,onMilestoneDrop:v,onMilestoneDragLeave:p,isFeatureDragging:l,isFeatureDropTarget:ge.dropTargetMilestoneId===t.id,featureDropIndex:ge.dropTargetMilestoneId===t.id?ge.dropTargetIndex:null,onFeatureDragStart:tt,onFeatureDragEnd:n,onFeatureDragOver:c,onFeatureDrop:i,onFeatureDragLeave:u,onFeatureDropOnMilestone:o,featureSuggestions:_e[t.id],isGeneratingFeatureSuggestions:ce(t.id),onGenerateFeatureSuggestions:()=>St(t.id),onAcceptFeatureSuggestion:m=>kt(t.id,m),onAcceptAllFeatureSuggestions:()=>Ft(t.id),onUpdateFeatureSuggestionDraft:(m,b,T)=>Et(m,b,T),onClearFeatureSuggestions:()=>Dt(t.id)},t.id))]})]})]}):e.jsx("div",{className:"roadmaps-view__empty-main",children:e.jsx("p",{children:"Select a roadmap from the sidebar to view its milestones."})})]}),K.type==="feature"&&K.parentId&&e.jsx("div",{className:"roadmaps-view__feature-create-overlay",children:e.jsx(ja,{onSave:t=>Mt(K.parentId,t),onCancel:()=>q({type:null,parentId:void 0,title:"",description:""})})}),e.jsx(ha,{isOpen:C,onClose:F,roadmapId:Ne||"",roadmapTitle:Ue,handoffPayload:me,isLoading:Ce,error:$,onFetchHandoff:W,onCopyToClipboard:We})]})}function ka({context:a}){return e.jsx(ya,{projectId:a?.projectId,addToast:a?.addToast??(()=>{})})}export{ka as RoadmapDashboardView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.graph-task-node{position:absolute;z-index:1;width:min(100%,var(--graph-task-node-width, calc(var(--space-2xl) * 9)));max-width:var(--graph-task-node-max-width, calc(var(--space-2xl) * 9.5));transition:box-shadow var(--transition-fast),z-index var(--transition-fast),opacity var(--transition-fast),border-color var(--transition-fast);border:var(--btn-border-width) solid transparent;border-radius:var(--radius-sm)}.graph-task-node:hover{box-shadow:var(--shadow-md);z-index:2}.graph-task-node--selected{box-shadow:var(--focus-ring-strong),var(--shadow-md);z-index:2}.graph-task-node--highlighted{box-shadow:0 0 0 var(--btn-border-width) var(--todo),var(--shadow-md);z-index:2}.graph-task-node--dimmed{opacity:.4}.graph-task-node--active{border-color:color-mix(in srgb,var(--in-progress) 50%,transparent);box-shadow:0 0 0 var(--btn-border-width) color-mix(in srgb,var(--in-progress) 45%,transparent),0 0 var(--space-md) color-mix(in srgb,var(--in-progress) 50%,transparent),0 0 var(--space-xl) color-mix(in srgb,var(--in-progress) 20%,transparent);transform:scale(1.01)}.graph-task-node--in-review{border-inline-start:calc(var(--btn-border-width) * 3) solid var(--in-review);border-start-start-radius:var(--radius-md);border-end-start-radius:var(--radius-md)}.graph-task-active-indicator{display:flex;align-items:center;min-height:calc(var(--space-xs) * 5);width:100%;padding-inline:var(--space-sm);background:color-mix(in srgb,var(--in-progress) 85%,transparent);border-radius:var(--radius-sm) var(--radius-sm) 0 0;animation:graph-task-active-pulse calc(var(--transition-normal) * 8) ease-in-out infinite}.graph-task-active-indicator-text{font-family:var(--font-mono);font-size:calc(var(--space-xs) * 2.5);font-weight:600;line-height:1;letter-spacing:.04em;text-transform:uppercase;color:var(--card)}.graph-task-node .card{width:100%;height:100%}.graph-task-node[data-current-step="0"] .card-steps-list .card-step-item:nth-child(1),.graph-task-node[data-current-step="1"] .card-steps-list .card-step-item:nth-child(2),.graph-task-node[data-current-step="2"] .card-steps-list .card-step-item:nth-child(3),.graph-task-node[data-current-step="3"] .card-steps-list .card-step-item:nth-child(4),.graph-task-node[data-current-step="4"] .card-steps-list .card-step-item:nth-child(5),.graph-task-node[data-current-step="5"] .card-steps-list .card-step-item:nth-child(6),.graph-task-node[data-current-step="6"] .card-steps-list .card-step-item:nth-child(7),.graph-task-node[data-current-step="7"] .card-steps-list .card-step-item:nth-child(8),.graph-task-node[data-current-step="8"] .card-steps-list .card-step-item:nth-child(9),.graph-task-node[data-current-step="9"] .card-steps-list .card-step-item:nth-child(10),.graph-task-node[data-current-step="10"] .card-steps-list .card-step-item:nth-child(11),.graph-task-node[data-current-step="11"] .card-steps-list .card-step-item:nth-child(12),.graph-task-node[data-current-step="12"] .card-steps-list .card-step-item:nth-child(13),.graph-task-node[data-current-step="13"] .card-steps-list .card-step-item:nth-child(14),.graph-task-node[data-current-step="14"] .card-steps-list .card-step-item:nth-child(15),.graph-task-node[data-current-step="15"] .card-steps-list .card-step-item:nth-child(16),.graph-task-node[data-current-step="16"] .card-steps-list .card-step-item:nth-child(17),.graph-task-node[data-current-step="17"] .card-steps-list .card-step-item:nth-child(18),.graph-task-node[data-current-step="18"] .card-steps-list .card-step-item:nth-child(19),.graph-task-node[data-current-step="19"] .card-steps-list .card-step-item:nth-child(20){background:color-mix(in srgb,var(--in-progress) 15%,transparent);border-left:calc(var(--btn-border-width) * 2) solid var(--in-progress);padding-left:var(--space-xs);font-weight:500}.graph-task-node[data-current-step="0"] .card-steps-list .card-step-item:nth-child(1) .card-step-dot,.graph-task-node[data-current-step="1"] .card-steps-list .card-step-item:nth-child(2) .card-step-dot,.graph-task-node[data-current-step="2"] .card-steps-list .card-step-item:nth-child(3) .card-step-dot,.graph-task-node[data-current-step="3"] .card-steps-list .card-step-item:nth-child(4) .card-step-dot,.graph-task-node[data-current-step="4"] .card-steps-list .card-step-item:nth-child(5) .card-step-dot,.graph-task-node[data-current-step="5"] .card-steps-list .card-step-item:nth-child(6) .card-step-dot,.graph-task-node[data-current-step="6"] .card-steps-list .card-step-item:nth-child(7) .card-step-dot,.graph-task-node[data-current-step="7"] .card-steps-list .card-step-item:nth-child(8) .card-step-dot,.graph-task-node[data-current-step="8"] .card-steps-list .card-step-item:nth-child(9) .card-step-dot,.graph-task-node[data-current-step="9"] .card-steps-list .card-step-item:nth-child(10) .card-step-dot,.graph-task-node[data-current-step="10"] .card-steps-list .card-step-item:nth-child(11) .card-step-dot,.graph-task-node[data-current-step="11"] .card-steps-list .card-step-item:nth-child(12) .card-step-dot,.graph-task-node[data-current-step="12"] .card-steps-list .card-step-item:nth-child(13) .card-step-dot,.graph-task-node[data-current-step="13"] .card-steps-list .card-step-item:nth-child(14) .card-step-dot,.graph-task-node[data-current-step="14"] .card-steps-list .card-step-item:nth-child(15) .card-step-dot,.graph-task-node[data-current-step="15"] .card-steps-list .card-step-item:nth-child(16) .card-step-dot,.graph-task-node[data-current-step="16"] .card-steps-list .card-step-item:nth-child(17) .card-step-dot,.graph-task-node[data-current-step="17"] .card-steps-list .card-step-item:nth-child(18) .card-step-dot,.graph-task-node[data-current-step="18"] .card-steps-list .card-step-item:nth-child(19) .card-step-dot,.graph-task-node[data-current-step="19"] .card-steps-list .card-step-item:nth-child(20) .card-step-dot{width:var(--space-sm);height:var(--space-sm);animation:graph-task-step-pulse calc(var(--transition-normal) * 10) ease-in-out infinite}@keyframes graph-task-active-pulse{0%,to{background:color-mix(in srgb,var(--in-progress) 85%,transparent)}50%{background:color-mix(in srgb,var(--in-progress) 65%,transparent)}}@keyframes graph-task-step-pulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.2);opacity:.75}}@media(max-width:768px){.graph-task-node{width:min(100%,var(--graph-task-node-mobile-width, calc(var(--space-2xl) * 8)))}.graph-task-node--active{transform:scale(1.005)}.graph-task-active-indicator{min-height:var(--space-xl);padding-inline:var(--space-md)}.graph-task-active-indicator-text{font-size:calc(var(--space-xs) * 2.75)}}.graph-node--highlighted{opacity:1;box-shadow:var(--shadow-glow)}.graph-node--dimmed{opacity:.25;transition:opacity var(--transition-fast)}.graph-edge--highlighted{opacity:1;stroke:var(--todo);stroke-width:var(--space-xs)}.graph-edge--dimmed{opacity:.15;transition:opacity var(--transition-fast)}@media(max-width:768px){.graph-node--dimmed,.graph-edge--dimmed{transition:opacity var(--transition-fast)}}.graph-node--draggable{cursor:grab;touch-action:none}.graph-node--dragging{z-index:3;cursor:grabbing;box-shadow:var(--shadow-lg);transform:scale(1.02);transition:transform var(--transition-fast),box-shadow var(--transition-fast),z-index var(--transition-fast)}.graph-toolbar{position:absolute;right:var(--space-md);bottom:var(--space-md);display:flex;flex-direction:column;gap:var(--space-xs);padding:var(--space-sm);background:var(--surface);border:var(--btn-border-width) solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-md);z-index:10}.graph-toolbar__zoom-label{min-width:3.5ch;color:var(--text-muted);font-family:var(--font-mono);font-size:.75rem;text-align:center}@media(max-width:768px){.graph-toolbar{right:var(--space-sm);bottom:var(--space-sm);padding:var(--space-md)}.graph-toolbar .btn-icon{min-width:calc(var(--space-xs) * 11);min-height:calc(var(--space-xs) * 11)}}.dependency-graph{position:relative;height:100%;padding:var(--space-md)}.dependency-graph__viewport{position:relative;overflow:hidden;height:100%;min-height:calc(var(--space-2xl) * 10);border:var(--btn-border-width) solid var(--border);border-radius:var(--radius-md);background:var(--surface);touch-action:none}.dependency-graph__viewport:focus-visible{box-shadow:var(--focus-ring-strong)}.graph-canvas-transform{position:relative;transform-origin:top left}.graph-canvas-transform--animate{transition:transform var(--transition-normal)}.dependency-graph__nodes-layer{position:relative;z-index:1}.dependency-graph__nodes-layer .graph-task-node{max-width:min(100%,calc(var(--space-2xl) * 9))}.dependency-graph-edges{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}.dependency-graph__empty{color:var(--text-muted);display:flex;align-items:center;justify-content:center;height:100%}@media(max-width:768px){.dependency-graph{padding:var(--space-sm)}}
|