@shepai/cli 1.122.2 → 1.123.0-pr394.80f3f1f
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/dist/packages/core/src/application/ports/output/repositories/feature-repository.interface.d.ts +11 -0
- package/dist/packages/core/src/application/ports/output/repositories/feature-repository.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/services/worktree-service.interface.d.ts +25 -0
- package/dist/packages/core/src/application/ports/output/services/worktree-service.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/adopt-branch.use-case.d.ts +40 -0
- package/dist/packages/core/src/application/use-cases/features/adopt-branch.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/features/adopt-branch.use-case.js +146 -0
- package/dist/packages/core/src/application/use-cases/features/branch-name-utils.d.ts +33 -0
- package/dist/packages/core/src/application/use-cases/features/branch-name-utils.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/features/branch-name-utils.js +77 -0
- package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.js +5 -0
- package/dist/packages/core/src/infrastructure/repositories/sqlite-feature.repository.d.ts +1 -0
- package/dist/packages/core/src/infrastructure/repositories/sqlite-feature.repository.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/repositories/sqlite-feature.repository.js +8 -0
- package/dist/packages/core/src/infrastructure/services/git/worktree.service.d.ts +2 -0
- package/dist/packages/core/src/infrastructure/services/git/worktree.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/git/worktree.service.js +39 -0
- package/dist/src/presentation/cli/commands/feat/adopt.command.d.ts +14 -0
- package/dist/src/presentation/cli/commands/feat/adopt.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/feat/adopt.command.js +43 -0
- package/dist/src/presentation/cli/commands/feat/index.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/index.js +3 -1
- package/dist/src/presentation/web/app/(dashboard)/@drawer/adopt/page.d.ts +10 -0
- package/dist/src/presentation/web/app/(dashboard)/@drawer/adopt/page.d.ts.map +1 -0
- package/dist/src/presentation/web/app/(dashboard)/@drawer/adopt/page.js +22 -0
- package/dist/src/presentation/web/app/(dashboard)/get-graph-data.d.ts +6 -0
- package/dist/src/presentation/web/app/(dashboard)/get-graph-data.d.ts.map +1 -1
- package/dist/src/presentation/web/app/(dashboard)/get-graph-data.js +60 -0
- package/dist/src/presentation/web/app/actions/adopt-branch.d.ts +11 -0
- package/dist/src/presentation/web/app/actions/adopt-branch.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/adopt-branch.js +20 -0
- package/dist/src/presentation/web/app/actions/get-feature-phase-timings.d.ts +2 -0
- package/dist/src/presentation/web/app/actions/get-feature-phase-timings.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/get-feature-phase-timings.js +2 -0
- package/dist/src/presentation/web/app/actions/list-branches.d.ts +6 -0
- package/dist/src/presentation/web/app/actions/list-branches.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/list-branches.js +18 -0
- package/dist/src/presentation/web/app/build-graph-nodes.d.ts +7 -0
- package/dist/src/presentation/web/app/build-graph-nodes.d.ts.map +1 -1
- package/dist/src/presentation/web/app/build-graph-nodes.js +7 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.d.ts +13 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.js +69 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.stories.d.ts +35 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.stories.js +135 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-drawer-client.d.ts +5 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-drawer-client.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-drawer-client.js +69 -0
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.js +20 -9
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/activity-tab.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/activity-tab.js +130 -31
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.js +13 -0
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/use-tab-data-fetch.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/use-tab-data-fetch.js +18 -9
- package/dist/src/presentation/web/components/common/repository-node/repository-node-config.d.ts +8 -0
- package/dist/src/presentation/web/components/common/repository-node/repository-node-config.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/repository-node/repository-node.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/repository-node/repository-node.js +6 -6
- package/dist/src/presentation/web/components/common/repository-node/repository-node.stories.d.ts +2 -0
- package/dist/src/presentation/web/components/common/repository-node/repository-node.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/repository-node/repository-node.stories.js +107 -17
- package/dist/src/presentation/web/components/features/control-center/control-center-empty-state.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/control-center/control-center-empty-state.js +18 -18
- package/dist/src/presentation/web/components/features/control-center/control-center-inner.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/control-center/control-center-inner.js +31 -17
- package/dist/src/presentation/web/components/features/control-center/welcome-agent-setup.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/control-center/welcome-agent-setup.js +29 -22
- package/dist/src/presentation/web/components/features/features-canvas/features-canvas.js +1 -1
- package/dist/src/presentation/web/components/layouts/app-shell/app-shell.d.ts.map +1 -1
- package/dist/src/presentation/web/components/layouts/app-shell/app-shell.js +14 -5
- package/dist/src/presentation/web/hooks/sidebar-features-context.d.ts +2 -0
- package/dist/src/presentation/web/hooks/sidebar-features-context.d.ts.map +1 -1
- package/dist/src/presentation/web/hooks/sidebar-features-context.js +2 -1
- package/dist/src/presentation/web/lib/layout-with-dagre.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/app-path-routes-manifest.json +1 -0
- package/web/.next/build-manifest.json +4 -4
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +3 -3
- package/web/.next/required-server-files.json +3 -3
- package/web/.next/routes-manifest.json +6 -0
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/app-paths-manifest.json +3 -0
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/build-manifest.json +18 -0
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/next-font-manifest.json +6 -0
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/react-loadable-manifest.json +1 -0
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +335 -0
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +20 -0
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.map +5 -0
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -0
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +2 -0
- package/web/.next/server/app/(dashboard)/@drawer/create/page/build-manifest.json +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +22 -22
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/build-manifest.json +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/build-manifest.json +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/build-manifest.json +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +20 -20
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/build-manifest.json +2 -2
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +22 -22
- package/web/.next/server/app/(dashboard)/create/page.js +2 -2
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/build-manifest.json +2 -2
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +3 -3
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/build-manifest.json +2 -2
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +3 -3
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/build-manifest.json +2 -2
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +20 -20
- package/web/.next/server/app/(dashboard)/page.js +2 -2
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/build-manifest.json +2 -2
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +20 -20
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +2 -2
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error/page/build-manifest.json +2 -2
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/build-manifest.json +2 -2
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
- package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
- package/web/.next/server/app/api/graph-data/route.js +1 -1
- package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
- package/web/.next/server/app/settings/page/build-manifest.json +2 -2
- package/web/.next/server/app/settings/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/build-manifest.json +2 -2
- package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/skills/page.js +4 -4
- package/web/.next/server/app/skills/page.js.nft.json +1 -1
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/build-manifest.json +2 -2
- package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/tools/page.js.nft.json +1 -1
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/build-manifest.json +2 -2
- package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/version/page.js.nft.json +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app-paths-manifest.json +1 -0
- package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js +1 -1
- package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__dcd4f847._.js +3 -0
- package/web/.next/server/chunks/{[root-of-the-server]__42b7ab55._.js.map → [root-of-the-server]__dcd4f847._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_31ea46d3._.js +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_c9d9b4d7._.js +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_client_components_94d75bc3._.js +3 -0
- package/web/.next/server/chunks/ssr/403f9_next_dist_client_components_94d75bc3._.js.map +1 -0
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_cfc9281c.js +3 -0
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_cfc9281c.js.map +1 -0
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_f30d0343.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_f30d0343.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_9f1775bb.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_9f1775bb.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__02c84e6b._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__02c84e6b._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__06fef644._.js +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__a022445f._.js → [root-of-the-server]__14664e9b._.js} +3 -3
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__a022445f._.js.map → [root-of-the-server]__14664e9b._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4993a47c._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4993a47c._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6677a82c._.js +3 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__b724df9e._.js.map → [root-of-the-server]__6677a82c._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__8e3bf5d7._.js → [root-of-the-server]__7cbda1ea._.js} +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7cbda1ea._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8c553503._.js +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__2698e9f4._.js → [root-of-the-server]__9e8b25ad._.js} +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9e8b25ad._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a7de2711._.js +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__c07f9f79._.js → [root-of-the-server]__aed1d6f8._.js} +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aed1d6f8._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__c605a375._.js → [root-of-the-server]__ce6057f6._.js} +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ce6057f6._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e2227c0f._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e2227c0f._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f0589cc3._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f0589cc3._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_037585d1._.js +3 -0
- package/web/.next/server/chunks/ssr/_037585d1._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_0a97d643._.js +3 -0
- package/web/.next/server/chunks/ssr/_0a97d643._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_19a2fb35._.js +3 -0
- package/web/.next/server/chunks/ssr/_19a2fb35._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_2f6f48b8._.js +1 -1
- package/web/.next/server/chunks/ssr/_2f6f48b8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_4093a637._.js +5 -0
- package/web/.next/server/chunks/ssr/_4093a637._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_583a83fb._.js +3 -0
- package/web/.next/server/chunks/ssr/_583a83fb._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{_42caff2c._.js → _60922fc4._.js} +2 -2
- package/web/.next/server/chunks/ssr/_60922fc4._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_9f56cf8f._.js +3 -0
- package/web/.next/server/chunks/ssr/_9f56cf8f._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_a187fd7e._.js +3 -0
- package/web/.next/server/chunks/ssr/_a187fd7e._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_a5aa6371._.js +9 -0
- package/web/.next/server/chunks/ssr/_a5aa6371._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_a9f57758._.js +3 -0
- package/web/.next/server/chunks/ssr/_a9f57758._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
- package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_d5206f22._.js +4 -0
- package/web/.next/server/chunks/ssr/_d5206f22._.js.map +1 -0
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/f7870_sonner_dist_index_mjs_dbf63824._.js +3 -0
- package/web/.next/server/chunks/ssr/f7870_sonner_dist_index_mjs_dbf63824._.js.map +1 -0
- package/web/.next/server/chunks/ssr/node_modules__pnpm_026172d1._.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules__pnpm_026172d1._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_5f039db1._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_5f039db1._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_7a78701e._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_7a78701e._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_2a52b697.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_2a52b697.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_c4337169._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_c4337169._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/middleware-build-manifest.js +2 -2
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +204 -34
- package/web/.next/static/chunks/{ff81a9dd7b7bc56f.js → 14d6411c627ccc15.js} +3 -3
- package/web/.next/static/chunks/26110def6c1641a5.js +1 -0
- package/web/.next/static/chunks/2dade33cf8b0e03e.js +1 -0
- package/web/.next/static/chunks/3e3e9c6552a6574f.css +1 -0
- package/web/.next/static/chunks/44e35ac2426a1bd0.js +1 -0
- package/web/.next/static/chunks/6295f27fe47da052.js +1 -0
- package/web/.next/static/chunks/8080c842b0358904.js +1 -0
- package/web/.next/static/chunks/{ed3a602003bcb31b.js → 89aac43287d73b02.js} +1 -1
- package/web/.next/static/chunks/8c50a0b7a7d9a4d5.js +1 -0
- package/web/.next/static/chunks/9fe8af38605fa69a.js +1 -0
- package/web/.next/static/chunks/a73b4cc8c0548c91.js +1 -0
- package/web/.next/static/chunks/a8ba3f3e2b0f87aa.js +1 -0
- package/web/.next/static/chunks/ac7251026c1e2cdf.js +1 -0
- package/web/.next/static/chunks/{0110425f3a60fc18.js → b626e6ad69805e9a.js} +2 -2
- package/web/.next/static/chunks/d04de4be30ab78ca.js +3 -0
- package/web/.next/static/chunks/{f464a486bd88502d.js → e1de6b08082f5365.js} +1 -1
- package/web/.next/static/chunks/{6339d1c357e7fea3.js → e413cc49d94d7093.js} +2 -2
- package/web/.next/static/chunks/{17d618a2fb4e9a11.js → fc45997b8b835378.js} +1 -1
- package/web/.next/static/chunks/{turbopack-426d9bc2450816ba.js → turbopack-080e470ea902d0ba.js} +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__42b7ab55._.js +0 -3
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_d0119342._.js +0 -3
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_d0119342._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2698e9f4._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__52485955._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__52485955._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8e3bf5d7._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9f155c0e._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9f155c0e._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b724df9e._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c07f9f79._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c605a375._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0dc2cfd3._.js +0 -3
- package/web/.next/server/chunks/ssr/_0dc2cfd3._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_3a4c94e3._.js +0 -3
- package/web/.next/server/chunks/ssr/_3a4c94e3._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_42caff2c._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_6d26a08f._.js +0 -3
- package/web/.next/server/chunks/ssr/_6d26a08f._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_75f4ccb3._.js +0 -3
- package/web/.next/server/chunks/ssr/_75f4ccb3._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_9ac70f88._.js +0 -5
- package/web/.next/server/chunks/ssr/_9ac70f88._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_9b7b1c2b._.js +0 -3
- package/web/.next/server/chunks/ssr/_9b7b1c2b._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_ecfef26e._.js +0 -3
- package/web/.next/server/chunks/ssr/_ecfef26e._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_f1a649e3._.js +0 -9
- package/web/.next/server/chunks/ssr/_f1a649e3._.js.map +0 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_b59e4b16._.js +0 -3
- package/web/.next/server/chunks/ssr/node_modules__pnpm_b59e4b16._.js.map +0 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +0 -3
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js.map +0 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +0 -3
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js.map +0 -1
- package/web/.next/static/chunks/0d2af96e64960ef5.css +0 -1
- package/web/.next/static/chunks/12f3ae6b693c8baf.js +0 -1
- package/web/.next/static/chunks/303a1217006489b9.js +0 -1
- package/web/.next/static/chunks/4562ee849ea13c3a.js +0 -1
- package/web/.next/static/chunks/52b56677c842e45f.js +0 -3
- package/web/.next/static/chunks/83fed73369b40eaf.js +0 -1
- package/web/.next/static/chunks/845d8e58a91014e6.js +0 -1
- package/web/.next/static/chunks/8e5bdf9fb945ae6a.js +0 -1
- package/web/.next/static/chunks/96eeeb28e06de78c.js +0 -1
- package/web/.next/static/chunks/be0d245d0e672d44.js +0 -1
- package/web/.next/static/chunks/e6c0bf49bcd5d0fb.js +0 -1
- /package/web/.next/static/{DIjy_LTLHBNoz5RRTRhBy → -FOfzDf8kOTPigHYVlPm4}/_buildManifest.js +0 -0
- /package/web/.next/static/{DIjy_LTLHBNoz5RRTRhBy → -FOfzDf8kOTPigHYVlPm4}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{DIjy_LTLHBNoz5RRTRhBy → -FOfzDf8kOTPigHYVlPm4}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { resolve } from '../../../../lib/server-container.js';
|
|
3
|
+
import { AdoptDrawerClient } from '../../../../components/common/control-center-drawer/adopt-drawer-client.js';
|
|
4
|
+
/** Skip static pre-rendering since we need runtime DI container. */
|
|
5
|
+
export const dynamic = 'force-dynamic';
|
|
6
|
+
export default async function AdoptDrawerPage({ searchParams }) {
|
|
7
|
+
const { repo } = await searchParams;
|
|
8
|
+
let repositoryPath = repo ?? '';
|
|
9
|
+
if (!repositoryPath) {
|
|
10
|
+
try {
|
|
11
|
+
const listRepos = resolve('ListRepositoriesUseCase');
|
|
12
|
+
const repositories = await listRepos.execute();
|
|
13
|
+
if (repositories.length > 0) {
|
|
14
|
+
repositoryPath = repositories[0].path;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
// Fall through with empty path — server action will validate
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return _jsx(AdoptDrawerClient, { repositoryPath: repositoryPath });
|
|
22
|
+
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type { CanvasNodeType } from '../../components/features/features-canvas/index.js';
|
|
2
2
|
import type { Edge } from '@xyflow/react';
|
|
3
|
+
export interface RepoGitInfo {
|
|
4
|
+
branch: string;
|
|
5
|
+
commitMessage: string;
|
|
6
|
+
committer: string;
|
|
7
|
+
behindCount: number | null;
|
|
8
|
+
}
|
|
3
9
|
export declare function getGraphData(): Promise<{
|
|
4
10
|
nodes: CanvasNodeType[];
|
|
5
11
|
edges: Edge[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-graph-data.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/(dashboard)/get-graph-data.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-graph-data.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/(dashboard)/get-graph-data.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAE5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAI1C,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAoDD,wBAAsB,YAAY,IAAI,OAAO,CAAC;IAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IAAC,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,CAAC,CAyDxF"}
|
|
@@ -1,12 +1,71 @@
|
|
|
1
|
+
import { execFile as execFileCb } from 'node:child_process';
|
|
2
|
+
import { promisify } from 'node:util';
|
|
1
3
|
import { resolve } from '../../lib/server-container.js';
|
|
2
4
|
import { getSettings } from '../../../../../packages/core/src/infrastructure/services/settings.service.js';
|
|
3
5
|
import { layoutWithDagre, CANVAS_LAYOUT_DEFAULTS } from '../../lib/layout-with-dagre.js';
|
|
4
6
|
import { buildGraphNodes } from '../build-graph-nodes.js';
|
|
7
|
+
const execFileAsync = promisify(execFileCb);
|
|
8
|
+
async function gitCommand(cwd, args) {
|
|
9
|
+
try {
|
|
10
|
+
const { stdout } = await execFileAsync('git', args, { cwd });
|
|
11
|
+
return stdout.trim();
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
async function fetchRepoGitInfo(repo) {
|
|
18
|
+
try {
|
|
19
|
+
const [currentBranch, commitMessage, committer] = await Promise.all([
|
|
20
|
+
gitCommand(repo.path, ['symbolic-ref', '--short', 'HEAD']),
|
|
21
|
+
gitCommand(repo.path, ['log', '-1', '--format=%s']),
|
|
22
|
+
gitCommand(repo.path, ['log', '-1', '--format=%an']),
|
|
23
|
+
]);
|
|
24
|
+
if (!currentBranch)
|
|
25
|
+
return null;
|
|
26
|
+
// Try to determine the default branch to compute behind count
|
|
27
|
+
let behindCount = null;
|
|
28
|
+
const defaultBranch = await gitCommand(repo.path, [
|
|
29
|
+
'symbolic-ref',
|
|
30
|
+
'--short',
|
|
31
|
+
'refs/remotes/origin/HEAD',
|
|
32
|
+
]).then((ref) => ref?.replace('origin/', '') ?? null);
|
|
33
|
+
if (defaultBranch && currentBranch !== defaultBranch) {
|
|
34
|
+
const behind = await gitCommand(repo.path, [
|
|
35
|
+
'rev-list',
|
|
36
|
+
'--count',
|
|
37
|
+
`${currentBranch}..origin/${defaultBranch}`,
|
|
38
|
+
]);
|
|
39
|
+
behindCount = behind !== null ? parseInt(behind, 10) : null;
|
|
40
|
+
if (isNaN(behindCount))
|
|
41
|
+
behindCount = null;
|
|
42
|
+
}
|
|
43
|
+
else if (!defaultBranch || currentBranch === defaultBranch) {
|
|
44
|
+
behindCount = 0;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
branch: currentBranch,
|
|
48
|
+
commitMessage: commitMessage ?? 'unknown',
|
|
49
|
+
committer: committer ?? 'unknown',
|
|
50
|
+
behindCount,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
5
57
|
export async function getGraphData() {
|
|
6
58
|
const listFeatures = resolve('ListFeaturesUseCase');
|
|
7
59
|
const listRepos = resolve('ListRepositoriesUseCase');
|
|
8
60
|
const agentRunRepo = resolve('IAgentRunRepository');
|
|
9
61
|
const [features, repositories] = await Promise.all([listFeatures.execute(), listRepos.execute()]);
|
|
62
|
+
// Fetch git info (branch, commit, behind count) for each repository
|
|
63
|
+
const repoGitInfoMap = new Map();
|
|
64
|
+
await Promise.all(repositories.map(async (repo) => {
|
|
65
|
+
const info = await fetchRepoGitInfo(repo);
|
|
66
|
+
if (info)
|
|
67
|
+
repoGitInfoMap.set(repo.path, info);
|
|
68
|
+
}));
|
|
10
69
|
// PR/CI status is kept fresh by PrSyncWatcher (30s background poll).
|
|
11
70
|
// No live GitHub calls here — use cached DB values for fast response.
|
|
12
71
|
const featuresWithRuns = await Promise.all(features.map(async (feature) => {
|
|
@@ -18,6 +77,7 @@ export async function getGraphData() {
|
|
|
18
77
|
enableEvidence: workflow.enableEvidence,
|
|
19
78
|
commitEvidence: workflow.commitEvidence,
|
|
20
79
|
ciWatchEnabled: workflow.ciWatchEnabled,
|
|
80
|
+
repoGitInfo: repoGitInfoMap,
|
|
21
81
|
});
|
|
22
82
|
// Enrich feature nodes with deployment status
|
|
23
83
|
let deploymentService = null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Feature } from '../../../../../packages/core/src/domain/generated/output.js';
|
|
2
|
+
interface AdoptBranchInput {
|
|
3
|
+
branchName: string;
|
|
4
|
+
repositoryPath: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function adoptBranch(input: AdoptBranchInput): Promise<{
|
|
7
|
+
feature?: Feature;
|
|
8
|
+
error?: string;
|
|
9
|
+
}>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=adopt-branch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adopt-branch.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/adopt-branch.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAEpE,UAAU,gBAAgB;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,wBAAsB,WAAW,CAC/B,KAAK,EAAE,gBAAgB,GACtB,OAAO,CAAC;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAkBhD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
import { resolve } from '../../lib/server-container.js';
|
|
3
|
+
export async function adoptBranch(input) {
|
|
4
|
+
const { branchName, repositoryPath } = input;
|
|
5
|
+
if (!branchName?.trim()) {
|
|
6
|
+
return { error: 'Branch name is required' };
|
|
7
|
+
}
|
|
8
|
+
if (!repositoryPath?.trim()) {
|
|
9
|
+
return { error: 'Repository path is required' };
|
|
10
|
+
}
|
|
11
|
+
try {
|
|
12
|
+
const useCase = resolve('AdoptBranchUseCase');
|
|
13
|
+
const result = await useCase.execute({ branchName, repositoryPath });
|
|
14
|
+
return { feature: result.feature };
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
const message = error instanceof Error ? error.message : 'Failed to adopt branch';
|
|
18
|
+
return { error: message };
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-feature-phase-timings.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/get-feature-phase-timings.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"get-feature-phase-timings.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/get-feature-phase-timings.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,KAAK,qBAAqB,GACtB;IAAE,OAAO,EAAE,eAAe,EAAE,CAAC;IAAC,iBAAiB,EAAE,qBAAqB,EAAE,CAAA;CAAE,GAC1E;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtB,wBAAsB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAsC9F"}
|
|
@@ -22,6 +22,8 @@ export async function getFeaturePhaseTimings(featureId) {
|
|
|
22
22
|
costUsd: t.costUsd != null ? Number(t.costUsd) : undefined,
|
|
23
23
|
numTurns: t.numTurns ?? undefined,
|
|
24
24
|
durationApiMs: t.durationApiMs != null ? Number(t.durationApiMs) : undefined,
|
|
25
|
+
exitCode: t.exitCode ?? undefined,
|
|
26
|
+
errorMessage: t.errorMessage ?? undefined,
|
|
25
27
|
}));
|
|
26
28
|
// Read rejection feedback from spec.yaml
|
|
27
29
|
const rejectionFeedback = await readRejectionFeedback(featureId);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server action that returns all branch names (local + remote) for a repository.
|
|
3
|
+
* Used by the adopt branch drawer to populate the branch combobox.
|
|
4
|
+
*/
|
|
5
|
+
export declare function listBranches(repositoryPath: string): Promise<string[]>;
|
|
6
|
+
//# sourceMappingURL=list-branches.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-branches.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/list-branches.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAsB,YAAY,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAW5E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
import { resolve } from '../../lib/server-container.js';
|
|
3
|
+
/**
|
|
4
|
+
* Server action that returns all branch names (local + remote) for a repository.
|
|
5
|
+
* Used by the adopt branch drawer to populate the branch combobox.
|
|
6
|
+
*/
|
|
7
|
+
export async function listBranches(repositoryPath) {
|
|
8
|
+
if (!repositoryPath?.trim()) {
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
try {
|
|
12
|
+
const worktreeService = resolve('IWorktreeService');
|
|
13
|
+
return await worktreeService.listBranches(repositoryPath);
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -20,6 +20,13 @@ export interface BuildGraphNodesOptions {
|
|
|
20
20
|
commitEvidence?: boolean;
|
|
21
21
|
/** Whether CI watch/fix loop is enabled (global workflow setting) */
|
|
22
22
|
ciWatchEnabled?: boolean;
|
|
23
|
+
/** Git info (branch, commit message, committer, behind count) keyed by repository path */
|
|
24
|
+
repoGitInfo?: Map<string, {
|
|
25
|
+
branch: string;
|
|
26
|
+
commitMessage: string;
|
|
27
|
+
committer: string;
|
|
28
|
+
behindCount: number | null;
|
|
29
|
+
}>;
|
|
23
30
|
}
|
|
24
31
|
export declare function buildGraphNodes(repositories: Repository[], featuresWithRuns: FeatureWithRun[], options?: BuildGraphNodesOptions): {
|
|
25
32
|
nodes: CanvasNodeType[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-graph-nodes.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/web/app/build-graph-nodes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAS1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAU1C,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,QAAQ,GAAG,IAAI,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,sBAAsB;IACrC,uEAAuE;IACvE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,6EAA6E;IAC7E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"build-graph-nodes.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/web/app/build-graph-nodes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAS1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAU1C,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,QAAQ,GAAG,IAAI,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,sBAAsB;IACrC,uEAAuE;IACvE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,6EAA6E;IAC7E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,0FAA0F;IAC1F,WAAW,CAAC,EAAE,GAAG,CACf,MAAM,EACN;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CACzF,CAAC;CACH;AAED,wBAAgB,eAAe,CAC7B,YAAY,EAAE,UAAU,EAAE,EAC1B,gBAAgB,EAAE,cAAc,EAAE,EAClC,OAAO,CAAC,EAAE,sBAAsB,GAC/B;IAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IAAC,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,CAkG5C"}
|
|
@@ -31,6 +31,7 @@ export function buildGraphNodes(repositories, featuresWithRuns, options) {
|
|
|
31
31
|
const normalizedRepoPath = normalizePath(repo.path);
|
|
32
32
|
coveredPaths.add(normalizedRepoPath);
|
|
33
33
|
const repoNodeId = `repo-${repo.id}`;
|
|
34
|
+
const gitInfo = options?.repoGitInfo?.get(repo.path);
|
|
34
35
|
nodes.push({
|
|
35
36
|
id: repoNodeId,
|
|
36
37
|
type: 'repositoryNode',
|
|
@@ -40,6 +41,12 @@ export function buildGraphNodes(repositories, featuresWithRuns, options) {
|
|
|
40
41
|
repositoryPath: normalizedRepoPath,
|
|
41
42
|
id: repo.id,
|
|
42
43
|
createdAt: repo.createdAt instanceof Date ? repo.createdAt.getTime() : Number(repo.createdAt),
|
|
44
|
+
...(gitInfo && {
|
|
45
|
+
branch: gitInfo.branch,
|
|
46
|
+
commitMessage: gitInfo.commitMessage,
|
|
47
|
+
committer: gitInfo.committer,
|
|
48
|
+
behindCount: gitInfo.behindCount,
|
|
49
|
+
}),
|
|
43
50
|
},
|
|
44
51
|
});
|
|
45
52
|
const repoFeatures = featuresByRepo[normalizedRepoPath] ?? [];
|
package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface AdoptBranchDrawerProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
onSubmit: (branchName: string) => void;
|
|
5
|
+
isSubmitting?: boolean;
|
|
6
|
+
error?: string;
|
|
7
|
+
/** Available branch names for the combobox dropdown */
|
|
8
|
+
branches?: string[];
|
|
9
|
+
/** Whether branches are still loading */
|
|
10
|
+
branchesLoading?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function AdoptBranchDrawer({ open, onClose, onSubmit, isSubmitting, error, branches, branchesLoading, }: AdoptBranchDrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=adopt-branch-drawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adopt-branch-drawer.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.tsx"],"names":[],"mappings":"AAmBA,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,yCAAyC;IACzC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,YAAoB,EACpB,KAAK,EACL,QAAa,EACb,eAAuB,GACxB,EAAE,sBAAsB,2CAgNxB"}
|
package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useCallback, useEffect, useRef } from 'react';
|
|
4
|
+
import { Check, ChevronsUpDown, GitBranch, Loader2 } from 'lucide-react';
|
|
5
|
+
import { BaseDrawer } from '../../common/base-drawer/index.js';
|
|
6
|
+
import { DrawerTitle, DrawerDescription } from '../../ui/drawer.js';
|
|
7
|
+
import { Button } from '../../ui/button.js';
|
|
8
|
+
import { Label } from '../../ui/label.js';
|
|
9
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from '../../ui/command.js';
|
|
10
|
+
import { Popover, PopoverContent, PopoverTrigger } from '../../ui/popover.js';
|
|
11
|
+
import { cn } from '../../../lib/utils.js';
|
|
12
|
+
export function AdoptBranchDrawer({ open, onClose, onSubmit, isSubmitting = false, error, branches = [], branchesLoading = false, }) {
|
|
13
|
+
const [branchName, setBranchName] = useState('');
|
|
14
|
+
const [comboboxOpen, setComboboxOpen] = useState(false);
|
|
15
|
+
const [inputValue, setInputValue] = useState('');
|
|
16
|
+
const inputRef = useRef(null);
|
|
17
|
+
// Reset state when drawer closes
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (!open) {
|
|
20
|
+
setBranchName('');
|
|
21
|
+
setInputValue('');
|
|
22
|
+
setComboboxOpen(false);
|
|
23
|
+
}
|
|
24
|
+
}, [open]);
|
|
25
|
+
const handleSubmit = useCallback((e) => {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
const trimmed = branchName.trim();
|
|
28
|
+
if (!trimmed || isSubmitting)
|
|
29
|
+
return;
|
|
30
|
+
onSubmit(trimmed);
|
|
31
|
+
}, [branchName, isSubmitting, onSubmit]);
|
|
32
|
+
const handleClose = useCallback(() => {
|
|
33
|
+
setBranchName('');
|
|
34
|
+
setInputValue('');
|
|
35
|
+
onClose();
|
|
36
|
+
}, [onClose]);
|
|
37
|
+
const handleSelect = useCallback((branch) => {
|
|
38
|
+
setBranchName(branch);
|
|
39
|
+
setInputValue(branch);
|
|
40
|
+
setComboboxOpen(false);
|
|
41
|
+
}, []);
|
|
42
|
+
const handleInputChange = useCallback((e) => {
|
|
43
|
+
setInputValue(e.target.value);
|
|
44
|
+
if (!comboboxOpen)
|
|
45
|
+
setComboboxOpen(true);
|
|
46
|
+
}, [comboboxOpen]);
|
|
47
|
+
const handleInputKeyDown = useCallback((e) => {
|
|
48
|
+
if (e.key === 'Enter') {
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
const trimmed = inputValue.trim();
|
|
51
|
+
if (trimmed) {
|
|
52
|
+
setBranchName(trimmed);
|
|
53
|
+
setComboboxOpen(false);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (e.key === 'Escape') {
|
|
57
|
+
setComboboxOpen(false);
|
|
58
|
+
setInputValue(branchName);
|
|
59
|
+
}
|
|
60
|
+
}, [inputValue, branchName]);
|
|
61
|
+
const filteredBranches = branches.filter((b) => b.toLowerCase().includes(inputValue.toLowerCase()));
|
|
62
|
+
const isDisabled = !branchName.trim() || isSubmitting;
|
|
63
|
+
const header = (_jsxs("div", { children: [_jsxs(DrawerTitle, { className: "flex items-center gap-2", children: [_jsx(GitBranch, { className: "h-4 w-4" }), "Adopt Branch"] }), _jsx(DrawerDescription, { className: "text-muted-foreground text-sm", children: "Import an existing git branch into Shep's feature tracking" })] }));
|
|
64
|
+
return (_jsx(BaseDrawer, { open: open, onClose: handleClose, size: "sm", modal: false, header: header, "data-testid": "adopt-branch-drawer", children: _jsxs("form", { onSubmit: handleSubmit, className: "flex flex-1 flex-col", children: [_jsx("div", { className: "flex-1 overflow-y-auto p-4", children: _jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { htmlFor: "branch-name", children: "Branch name" }), _jsxs(Popover, { open: comboboxOpen, onOpenChange: setComboboxOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", role: "combobox", "aria-expanded": comboboxOpen, disabled: isSubmitting, className: "w-full justify-between font-normal", "data-testid": "adopt-branch-input", children: [_jsx("span", { className: "truncate", children: branchesLoading ? 'Loading branches...' : branchName || 'Select a branch...' }), _jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })] }) }), _jsx(PopoverContent, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: _jsxs(Command, { children: [_jsx(CommandInput, { ref: inputRef, placeholder: "Search branches...", value: inputValue, onChange: handleInputChange, onKeyDown: handleInputKeyDown, "data-testid": "adopt-branch-search" }), _jsxs(CommandList, { children: [!branchesLoading && filteredBranches.length === 0 && (_jsx(CommandEmpty, { children: branches.length === 0
|
|
65
|
+
? 'No branches found.'
|
|
66
|
+
: inputValue
|
|
67
|
+
? 'No match — press Enter to use this value.'
|
|
68
|
+
: 'No branches available.' })), branchesLoading ? (_jsx(CommandEmpty, { children: _jsx(Loader2, { className: "mx-auto h-4 w-4 animate-spin" }) })) : null, filteredBranches.length > 0 && (_jsx(CommandGroup, { children: filteredBranches.map((branch) => (_jsxs(CommandItem, { selected: branch === branchName, onClick: () => handleSelect(branch), children: [_jsx(Check, { className: cn('mr-2 h-4 w-4', branch === branchName ? 'opacity-100' : 'opacity-0') }), _jsx(GitBranch, { className: "mr-2 h-3 w-3 opacity-50" }), branch] }, branch))) }))] })] }) })] }), _jsx("p", { className: "text-muted-foreground text-xs", children: "Select a branch from the dropdown or type to search. Local and remote branches are shown." })] }), error ? (_jsx("p", { className: "text-destructive text-sm", "data-testid": "adopt-branch-error", children: error })) : null] }) }), _jsx("div", { className: "border-t p-4", children: _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { type: "button", variant: "outline", onClick: handleClose, disabled: isSubmitting, className: "flex-1", children: "Cancel" }), _jsx(Button, { type: "submit", disabled: isDisabled, className: "flex-1", "data-testid": "adopt-branch-submit", children: isSubmitting ? (_jsxs(_Fragment, { children: [_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), "Adopting..."] })) : ('Adopt Branch') })] }) })] }) }));
|
|
69
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { AdoptBranchDrawer } from './adopt-branch-drawer.js';
|
|
3
|
+
/**
|
|
4
|
+
* **AdoptBranchDrawer** is a right-side sliding drawer for importing an
|
|
5
|
+
* existing git branch into Shep's feature tracking system.
|
|
6
|
+
*
|
|
7
|
+
* ### Form
|
|
8
|
+
* - **Branch name** (required) — combobox with search for selecting a branch
|
|
9
|
+
* - **Adopt Branch** button — disabled when no branch is selected or submitting
|
|
10
|
+
* - **Cancel** button — closes the drawer
|
|
11
|
+
*
|
|
12
|
+
* ### States
|
|
13
|
+
* - Default: no branch selected, submit disabled
|
|
14
|
+
* - Loading branches: combobox shows loading spinner
|
|
15
|
+
* - Loading submit: button shows spinner
|
|
16
|
+
* - Error: error message shown below combobox
|
|
17
|
+
*/
|
|
18
|
+
declare const meta: Meta<typeof AdoptBranchDrawer>;
|
|
19
|
+
export default meta;
|
|
20
|
+
type Story = StoryObj<typeof AdoptBranchDrawer>;
|
|
21
|
+
/** Default — click the trigger button to open the adopt branch drawer with branch combobox. */
|
|
22
|
+
export declare const Default: Story;
|
|
23
|
+
/** Pre-opened drawer with branch combobox for quick visual inspection. */
|
|
24
|
+
export declare const PreOpened: Story;
|
|
25
|
+
/** Branches loading state — combobox shows "Loading branches..." */
|
|
26
|
+
export declare const BranchesLoading: Story;
|
|
27
|
+
/** Loading state — submit in progress, button shows spinner. */
|
|
28
|
+
export declare const Loading: Story;
|
|
29
|
+
/** Error state — error message visible below combobox. */
|
|
30
|
+
export declare const WithError: Story;
|
|
31
|
+
/** No branches available — empty state in the combobox dropdown. */
|
|
32
|
+
export declare const NoBranches: Story;
|
|
33
|
+
/** Adopt branch drawer rendered inside a full-page context — starts open. */
|
|
34
|
+
export declare const InDrawer: Story;
|
|
35
|
+
//# sourceMappingURL=adopt-branch-drawer.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adopt-branch-drawer.stories.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAO1D;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,iBAAiB,CAgBxC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAqEhD,+FAA+F;AAC/F,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,SAAS,EAAE,KAMvB,CAAC;AAEF,oEAAoE;AACpE,eAAO,MAAM,eAAe,EAAE,KAM7B,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,SAAS,EAAE,KAWvB,CAAC;AAEF,oEAAoE;AACpE,eAAO,MAAM,UAAU,EAAE,KAMxB,CAAC;AAkCF,6EAA6E;AAC7E,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { within, userEvent, fn } from '@storybook/test';
|
|
4
|
+
import { AdoptBranchDrawer } from './adopt-branch-drawer.js';
|
|
5
|
+
import { Button } from '../../ui/button.js';
|
|
6
|
+
/* ---------------------------------------------------------------------------
|
|
7
|
+
* Meta
|
|
8
|
+
* ------------------------------------------------------------------------- */
|
|
9
|
+
/**
|
|
10
|
+
* **AdoptBranchDrawer** is a right-side sliding drawer for importing an
|
|
11
|
+
* existing git branch into Shep's feature tracking system.
|
|
12
|
+
*
|
|
13
|
+
* ### Form
|
|
14
|
+
* - **Branch name** (required) — combobox with search for selecting a branch
|
|
15
|
+
* - **Adopt Branch** button — disabled when no branch is selected or submitting
|
|
16
|
+
* - **Cancel** button — closes the drawer
|
|
17
|
+
*
|
|
18
|
+
* ### States
|
|
19
|
+
* - Default: no branch selected, submit disabled
|
|
20
|
+
* - Loading branches: combobox shows loading spinner
|
|
21
|
+
* - Loading submit: button shows spinner
|
|
22
|
+
* - Error: error message shown below combobox
|
|
23
|
+
*/
|
|
24
|
+
const meta = {
|
|
25
|
+
title: 'Drawers/Feature/AdoptBranchDrawer',
|
|
26
|
+
component: AdoptBranchDrawer,
|
|
27
|
+
tags: ['autodocs'],
|
|
28
|
+
parameters: {
|
|
29
|
+
layout: 'fullscreen',
|
|
30
|
+
},
|
|
31
|
+
argTypes: {
|
|
32
|
+
open: { control: 'boolean', description: 'Controls drawer visibility' },
|
|
33
|
+
onClose: { description: 'Called when the drawer is dismissed' },
|
|
34
|
+
onSubmit: { description: 'Called with the branch name when the form is submitted' },
|
|
35
|
+
isSubmitting: { control: 'boolean', description: 'Shows loading state' },
|
|
36
|
+
error: { control: 'text', description: 'Error message to display' },
|
|
37
|
+
branches: { description: 'Available branch names for the combobox dropdown' },
|
|
38
|
+
branchesLoading: { control: 'boolean', description: 'Whether branches are loading' },
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
export default meta;
|
|
42
|
+
/* ---------------------------------------------------------------------------
|
|
43
|
+
* Shared data
|
|
44
|
+
* ------------------------------------------------------------------------- */
|
|
45
|
+
const logSubmit = fn().mockName('onSubmit');
|
|
46
|
+
const logClose = fn().mockName('onClose');
|
|
47
|
+
const sampleBranches = [
|
|
48
|
+
'feat/user-auth',
|
|
49
|
+
'feat/dashboard-redesign',
|
|
50
|
+
'fix/login-bug',
|
|
51
|
+
'fix/memory-leak',
|
|
52
|
+
'chore/update-deps',
|
|
53
|
+
'refactor/api-layer',
|
|
54
|
+
'docs/readme-update',
|
|
55
|
+
'release/v2.0',
|
|
56
|
+
'hotfix/critical-fix',
|
|
57
|
+
'develop',
|
|
58
|
+
];
|
|
59
|
+
/* ---------------------------------------------------------------------------
|
|
60
|
+
* Trigger wrapper
|
|
61
|
+
* ------------------------------------------------------------------------- */
|
|
62
|
+
function AdoptDrawerTrigger({ label = 'Open Adopt Branch', isSubmitting = false, error, branches = sampleBranches, branchesLoading = false, }) {
|
|
63
|
+
const [open, setOpen] = useState(false);
|
|
64
|
+
return (_jsxs("div", { className: "flex h-screen items-start p-4", children: [_jsx(Button, { variant: "outline", onClick: () => setOpen(true), children: label }), _jsx(AdoptBranchDrawer, { open: open, onClose: () => {
|
|
65
|
+
setOpen(false);
|
|
66
|
+
logClose();
|
|
67
|
+
}, onSubmit: (branchName) => {
|
|
68
|
+
logSubmit(branchName);
|
|
69
|
+
setOpen(false);
|
|
70
|
+
}, isSubmitting: isSubmitting, error: error, branches: branches, branchesLoading: branchesLoading })] }));
|
|
71
|
+
}
|
|
72
|
+
/* ---------------------------------------------------------------------------
|
|
73
|
+
* Stories
|
|
74
|
+
* ------------------------------------------------------------------------- */
|
|
75
|
+
/** Default — click the trigger button to open the adopt branch drawer with branch combobox. */
|
|
76
|
+
export const Default = {
|
|
77
|
+
render: () => _jsx(AdoptDrawerTrigger, {}),
|
|
78
|
+
};
|
|
79
|
+
/** Pre-opened drawer with branch combobox for quick visual inspection. */
|
|
80
|
+
export const PreOpened = {
|
|
81
|
+
render: () => _jsx(AdoptDrawerTrigger, { label: "Open Drawer" }),
|
|
82
|
+
play: async ({ canvasElement }) => {
|
|
83
|
+
const canvas = within(canvasElement);
|
|
84
|
+
await userEvent.click(canvas.getByRole('button', { name: 'Open Drawer' }));
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
/** Branches loading state — combobox shows "Loading branches..." */
|
|
88
|
+
export const BranchesLoading = {
|
|
89
|
+
render: () => _jsx(AdoptDrawerTrigger, { label: "Open (Loading Branches)", branchesLoading: true }),
|
|
90
|
+
play: async ({ canvasElement }) => {
|
|
91
|
+
const canvas = within(canvasElement);
|
|
92
|
+
await userEvent.click(canvas.getByRole('button', { name: 'Open (Loading Branches)' }));
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
/** Loading state — submit in progress, button shows spinner. */
|
|
96
|
+
export const Loading = {
|
|
97
|
+
render: () => _jsx(AdoptDrawerTrigger, { label: "Open (Loading)", isSubmitting: true }),
|
|
98
|
+
play: async ({ canvasElement }) => {
|
|
99
|
+
const canvas = within(canvasElement);
|
|
100
|
+
await userEvent.click(canvas.getByRole('button', { name: 'Open (Loading)' }));
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
/** Error state — error message visible below combobox. */
|
|
104
|
+
export const WithError = {
|
|
105
|
+
render: () => (_jsx(AdoptDrawerTrigger, { label: "Open (Error)", error: 'Branch "main" cannot be adopted. The main branch should not be tracked as a feature.' })),
|
|
106
|
+
play: async ({ canvasElement }) => {
|
|
107
|
+
const canvas = within(canvasElement);
|
|
108
|
+
await userEvent.click(canvas.getByRole('button', { name: 'Open (Error)' }));
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
/** No branches available — empty state in the combobox dropdown. */
|
|
112
|
+
export const NoBranches = {
|
|
113
|
+
render: () => _jsx(AdoptDrawerTrigger, { label: "Open (No Branches)", branches: [] }),
|
|
114
|
+
play: async ({ canvasElement }) => {
|
|
115
|
+
const canvas = within(canvasElement);
|
|
116
|
+
await userEvent.click(canvas.getByRole('button', { name: 'Open (No Branches)' }));
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
/* ---------------------------------------------------------------------------
|
|
120
|
+
* Shell template — starts open in full-page context
|
|
121
|
+
* ------------------------------------------------------------------------- */
|
|
122
|
+
function AdoptDrawerShellTemplate() {
|
|
123
|
+
const [open, setOpen] = useState(true);
|
|
124
|
+
return (_jsxs("div", { style: { height: '100vh', background: '#f8fafc', padding: '2rem' }, children: [_jsx("button", { type: "button", onClick: () => setOpen(true), style: { padding: '8px 16px', border: '1px solid #ccc', borderRadius: '6px' }, children: "Open Drawer" }), _jsx(AdoptBranchDrawer, { open: open, onClose: () => {
|
|
125
|
+
setOpen(false);
|
|
126
|
+
logClose();
|
|
127
|
+
}, onSubmit: (branchName) => {
|
|
128
|
+
logSubmit(branchName);
|
|
129
|
+
setOpen(false);
|
|
130
|
+
}, branches: sampleBranches })] }));
|
|
131
|
+
}
|
|
132
|
+
/** Adopt branch drawer rendered inside a full-page context — starts open. */
|
|
133
|
+
export const InDrawer = {
|
|
134
|
+
render: () => _jsx(AdoptDrawerShellTemplate, {}),
|
|
135
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adopt-drawer-client.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/control-center-drawer/adopt-drawer-client.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,cAAc,EAAE,EAAE,sBAAsB,2CAmF3E"}
|
package/dist/src/presentation/web/components/common/control-center-drawer/adopt-drawer-client.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useCallback, useEffect } from 'react';
|
|
4
|
+
import { useRouter, usePathname } from 'next/navigation';
|
|
5
|
+
import { toast } from 'sonner';
|
|
6
|
+
import { adoptBranch } from '../../../app/actions/adopt-branch.js';
|
|
7
|
+
import { listBranches } from '../../../app/actions/list-branches.js';
|
|
8
|
+
import { AdoptBranchDrawer } from './adopt-branch-drawer.js';
|
|
9
|
+
export function AdoptDrawerClient({ repositoryPath }) {
|
|
10
|
+
const router = useRouter();
|
|
11
|
+
const pathname = usePathname();
|
|
12
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
13
|
+
const [error, setError] = useState();
|
|
14
|
+
const [branches, setBranches] = useState([]);
|
|
15
|
+
const [branchesLoading, setBranchesLoading] = useState(false);
|
|
16
|
+
const isOnAdoptRoute = pathname.startsWith('/adopt');
|
|
17
|
+
const isOpen = !isSubmitting && isOnAdoptRoute;
|
|
18
|
+
// Reset isSubmitting once the route has actually changed away from /adopt
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (!isOnAdoptRoute && isSubmitting) {
|
|
21
|
+
setIsSubmitting(false);
|
|
22
|
+
}
|
|
23
|
+
}, [isOnAdoptRoute, isSubmitting]);
|
|
24
|
+
// Clear error when drawer reopens
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (isOnAdoptRoute) {
|
|
27
|
+
setError(undefined);
|
|
28
|
+
}
|
|
29
|
+
}, [isOnAdoptRoute]);
|
|
30
|
+
// Fetch branches when drawer opens
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (isOnAdoptRoute && repositoryPath) {
|
|
33
|
+
setBranchesLoading(true);
|
|
34
|
+
listBranches(repositoryPath)
|
|
35
|
+
.then(setBranches)
|
|
36
|
+
.catch(() => setBranches([]))
|
|
37
|
+
.finally(() => setBranchesLoading(false));
|
|
38
|
+
}
|
|
39
|
+
}, [isOnAdoptRoute, repositoryPath]);
|
|
40
|
+
const onClose = useCallback(() => {
|
|
41
|
+
router.push('/');
|
|
42
|
+
}, [router]);
|
|
43
|
+
const onSubmit = useCallback((branchName) => {
|
|
44
|
+
setError(undefined);
|
|
45
|
+
setIsSubmitting(true);
|
|
46
|
+
router.push('/');
|
|
47
|
+
adoptBranch({ branchName, repositoryPath })
|
|
48
|
+
.then((result) => {
|
|
49
|
+
if (result.error) {
|
|
50
|
+
toast.error(result.error);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
window.dispatchEvent(new CustomEvent('shep:feature-created', {
|
|
54
|
+
detail: {
|
|
55
|
+
featureId: result.feature.id,
|
|
56
|
+
name: result.feature.name,
|
|
57
|
+
description: result.feature.description,
|
|
58
|
+
repositoryPath: result.feature.repositoryPath,
|
|
59
|
+
},
|
|
60
|
+
}));
|
|
61
|
+
toast.success(`Branch adopted as "${result.feature.name}"`);
|
|
62
|
+
})
|
|
63
|
+
.catch(() => {
|
|
64
|
+
toast.error('Failed to adopt branch');
|
|
65
|
+
setIsSubmitting(false);
|
|
66
|
+
});
|
|
67
|
+
}, [router, repositoryPath]);
|
|
68
|
+
return (_jsx(AdoptBranchDrawer, { open: isOpen, onClose: onClose, onSubmit: onSubmit, isSubmitting: isSubmitting, error: error, branches: branches, branchesLoading: branchesLoading }));
|
|
69
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-create-drawer.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAO5E,YAAY,EAAE,cAAc,EAAE,MAAM,0DAA0D,CAAC;AAE/F,uFAAuF;AACvF,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,0DAA0D;AAC1D,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,iEAAiE;AACjE,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE;QACb,QAAQ,EAAE,OAAO,CAAC;QAClB,SAAS,EAAE,OAAO,CAAC;QACnB,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC;IACF,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,IAAI,EAAE,OAAO,CAAC;IACd,yEAAyE;IACzE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA+ED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC/C,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,qEAAqE;IACrE,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACjC,+EAA+E;IAC/E,YAAY,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAClC,kGAAkG;IAClG,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8CAA8C;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,cAAc,EACd,YAAoB,EACpB,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,GACnB,EAAE,wBAAwB,
|
|
1
|
+
{"version":3,"file":"feature-create-drawer.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAO5E,YAAY,EAAE,cAAc,EAAE,MAAM,0DAA0D,CAAC;AAE/F,uFAAuF;AACvF,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,0DAA0D;AAC1D,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,iEAAiE;AACjE,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE;QACb,QAAQ,EAAE,OAAO,CAAC;QAClB,SAAS,EAAE,OAAO,CAAC;QACnB,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC;IACF,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,IAAI,EAAE,OAAO,CAAC;IACd,yEAAyE;IACzE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA+ED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC/C,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,qEAAqE;IACrE,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACjC,+EAA+E;IAC/E,YAAY,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAClC,kGAAkG;IAClG,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8CAA8C;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,cAAc,EACd,YAAoB,EACpB,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,GACnB,EAAE,wBAAwB,2CAwzB1B;AAmJD,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC7C,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,eAAe,EACf,QAAQ,GACT,EAAE,uBAAuB,2CA8JzB"}
|