@shepai/cli 1.123.0 → 1.124.0-pr401.74b2155
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/src/presentation/web/components/common/control-center-drawer/repository-drawer-client.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/control-center-drawer/repository-drawer-client.js +20 -3
- package/dist/src/presentation/web/components/common/feature-node/feature-node.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-node/feature-node.js +14 -6
- package/dist/src/presentation/web/components/common/feature-node/feature-node.stories.d.ts +1 -0
- package/dist/src/presentation/web/components/common/feature-node/feature-node.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-node/feature-node.stories.js +16 -0
- package/dist/src/presentation/web/components/common/repository-node/repository-drawer.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/repository-node/repository-drawer.js +19 -2
- package/dist/src/presentation/web/components/common/repository-node/repository-drawer.stories.d.ts +5 -0
- package/dist/src/presentation/web/components/common/repository-node/repository-drawer.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/repository-node/repository-drawer.stories.js +38 -9
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- 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/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +22 -22
- 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/server-reference-manifest.json +28 -28
- 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/server-reference-manifest.json +28 -28
- 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/server-reference-manifest.json +20 -20
- 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/server-reference-manifest.json +22 -22
- 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/server-reference-manifest.json +28 -28
- 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/server-reference-manifest.json +28 -28
- 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/server-reference-manifest.json +20 -20
- 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/server-reference-manifest.json +20 -20
- 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.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/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/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/server-reference-manifest.json +6 -6
- 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/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/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/chunks/[root-of-the-server]__a402b567._.js +1 -1
- 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]__06fef644._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__14664e9b._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.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]__7cbda1ea._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7cbda1ea._.js.map +1 -1
- 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]__9e8b25ad._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9e8b25ad._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a7de2711._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aed1d6f8._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aed1d6f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ce6057f6._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ce6057f6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_109ee019._.js +3 -0
- package/web/.next/server/chunks/ssr/_109ee019._.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/_2f6f48b8._.js +1 -1
- package/web/.next/server/chunks/ssr/_2f6f48b8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_5d43c3db._.js +3 -0
- package/web/.next/server/chunks/ssr/_5d43c3db._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_a161be0a._.js +3 -0
- package/web/.next/server/chunks/ssr/_a161be0a._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{_960ceb5d._.js → _b86eec90._.js} +2 -2
- package/web/.next/server/chunks/ssr/_b86eec90._.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/{_f1a649e3._.js → _f605354c._.js} +3 -3
- package/web/.next/server/chunks/ssr/_f605354c._.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/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
- package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js.map +1 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_70f6d54e._.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules__pnpm_70f6d54e._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{403f9_next_d6c8d28d._.js → node_modules__pnpm_f9ac7604._.js} +2 -2
- package/web/.next/server/chunks/ssr/node_modules__pnpm_f9ac7604._.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__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_components_bf50c527._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.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/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +34 -34
- package/web/.next/static/chunks/{f0dfeedb263eb906.js → 15e868c5ed24e68d.js} +1 -1
- package/web/.next/static/chunks/1dd878b6feb55d2e.js +1 -0
- package/web/.next/static/chunks/44f74b62f897f41c.css +1 -0
- package/web/.next/static/chunks/{310be54600c8ce20.js → 683f1449a7acbe69.js} +2 -2
- package/web/.next/static/chunks/{9821072252ddb89a.js → 8f09849a5cb49bc8.js} +1 -1
- package/web/.next/static/chunks/{64d063449c3be0ec.js → 94861aa7270facbd.js} +1 -1
- package/web/.next/static/chunks/a09c0c629f88ee12.js +1 -0
- package/web/.next/static/chunks/{878643f90bc6360f.js → a7231c3b616020d8.js} +2 -2
- package/web/.next/static/chunks/c4e46fbe479ebd88.js +11 -0
- package/web/.next/static/chunks/e39cee9f73d1fda2.js +1 -0
- package/web/.next/static/chunks/efb06f2eab920f11.js +1 -0
- package/web/.next/static/chunks/{3f6c44cbad751310.js → fb8b8be474a3e2b5.js} +1 -1
- package/web/.next/static/chunks/{4443ee9c7733399b.js → ffcc006639ba2fd8.js} +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_d6c8d28d._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_960ceb5d._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_e9703421._.js +0 -3
- package/web/.next/server/chunks/ssr/_e9703421._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_f1a649e3._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_fd4c574b._.js +0 -3
- package/web/.next/server/chunks/ssr/_fd4c574b._.js.map +0 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_bc66dcc6._.js +0 -3
- package/web/.next/server/chunks/ssr/node_modules__pnpm_bc66dcc6._.js.map +0 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_db779ef4._.js +0 -3
- package/web/.next/server/chunks/ssr/src_presentation_web_db779ef4._.js.map +0 -1
- package/web/.next/static/chunks/373e10090c6410c4.js +0 -11
- package/web/.next/static/chunks/3925626b99dcd57a.css +0 -1
- package/web/.next/static/chunks/694718e5449b3150.js +0 -1
- package/web/.next/static/chunks/94af5be1ccf8842e.js +0 -1
- package/web/.next/static/chunks/e418898e8e02f50a.js +0 -1
- package/web/.next/static/chunks/eb9841ec4d80af01.js +0 -1
- /package/web/.next/static/{gBTe97SiNDA2hbG9dbfpb → FEBom5Y7caLa2hXBqPiA-}/_buildManifest.js +0 -0
- /package/web/.next/static/{gBTe97SiNDA2hbG9dbfpb → FEBom5Y7caLa2hXBqPiA-}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{gBTe97SiNDA2hbG9dbfpb → FEBom5Y7caLa2hXBqPiA-}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-drawer-client.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/control-center-drawer/repository-drawer-client.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"repository-drawer-client.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/control-center-drawer/repository-drawer-client.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAcD,wBAAgB,sBAAsB,CAAC,EAAE,IAAI,EAAE,EAAE,2BAA2B,2CAoL3E"}
|
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import { useRouter, usePathname } from 'next/navigation';
|
|
5
|
-
import { Code2, Terminal, FolderOpen } from 'lucide-react';
|
|
5
|
+
import { Code2, Terminal, FolderOpen, GitBranch, GitCommitHorizontal, User, ArrowDown, Clock, } from 'lucide-react';
|
|
6
6
|
import { BaseDrawer } from '../../common/base-drawer/index.js';
|
|
7
7
|
import { ActionButton } from '../../common/action-button/index.js';
|
|
8
8
|
import { DrawerTitle, DrawerDescription } from '../../ui/drawer.js';
|
|
9
9
|
import { Separator } from '../../ui/separator.js';
|
|
10
|
+
import { Badge } from '../../ui/badge.js';
|
|
10
11
|
import { useRepositoryActions } from '../../common/repository-node/use-repository-actions.js';
|
|
11
12
|
import { useFeatureFlags } from '../../../hooks/feature-flags-context.js';
|
|
13
|
+
function formatRelativeTime(epochMs) {
|
|
14
|
+
const diff = Date.now() - epochMs;
|
|
15
|
+
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
|
|
16
|
+
if (days === 0)
|
|
17
|
+
return 'Today';
|
|
18
|
+
if (days === 1)
|
|
19
|
+
return 'Yesterday';
|
|
20
|
+
if (days < 30)
|
|
21
|
+
return `${days} days ago`;
|
|
22
|
+
const months = Math.floor(days / 30);
|
|
23
|
+
if (months < 12)
|
|
24
|
+
return `${months} month${months > 1 ? 's' : ''} ago`;
|
|
25
|
+
const years = Math.floor(months / 12);
|
|
26
|
+
return `${years} year${years > 1 ? 's' : ''} ago`;
|
|
27
|
+
}
|
|
12
28
|
export function RepositoryDrawerClient({ data }) {
|
|
13
29
|
const featureFlags = useFeatureFlags();
|
|
14
30
|
const router = useRouter();
|
|
@@ -26,5 +42,6 @@ export function RepositoryDrawerClient({ data }) {
|
|
|
26
42
|
}
|
|
27
43
|
: undefined;
|
|
28
44
|
const header = (_jsxs("div", { "data-testid": "repository-drawer-header", children: [_jsx(DrawerTitle, { children: data.name }), data.repositoryPath ? (_jsx(DrawerDescription, { className: "truncate font-mono text-xs", children: data.repositoryPath })) : null] }));
|
|
29
|
-
|
|
45
|
+
const hasGitInfo = !!(data.branch ?? data.commitMessage);
|
|
46
|
+
return (_jsx(BaseDrawer, { open: isOpen, onClose: onClose, size: "md", modal: false, header: header, deployTarget: featureFlags.envDeploy ? repoDeployTarget : undefined, "data-testid": "repository-drawer", children: _jsxs("div", { className: "flex flex-1 flex-col overflow-y-auto", children: [hasGitInfo ? (_jsxs(_Fragment, { children: [_jsx(Separator, {}), _jsxs("div", { className: "flex flex-col gap-3 p-4", "data-testid": "repository-drawer-git-section", children: [_jsx("div", { className: "text-muted-foreground text-xs font-semibold tracking-wider", children: "GIT STATUS" }), _jsxs("div", { className: "flex flex-col gap-2", children: [data.branch ? (_jsxs("div", { className: "flex items-center justify-between gap-2", "data-testid": "repository-drawer-branch-row", children: [_jsxs("div", { className: "text-muted-foreground flex items-center gap-2 text-sm", children: [_jsx(GitBranch, { className: "h-4 w-4 shrink-0" }), _jsx("span", { className: "text-foreground font-medium", children: "Branch" })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Badge, { variant: "secondary", className: "font-mono text-xs", "data-testid": "repository-drawer-branch", children: data.branch }), data.behindCount != null && data.behindCount > 0 ? (_jsxs(Badge, { variant: "outline", className: "border-amber-500/40 bg-amber-50 text-xs text-amber-600 dark:bg-amber-900/20 dark:text-amber-400", "data-testid": "repository-drawer-behind", children: [_jsx(ArrowDown, { className: "mr-1 h-3 w-3" }), data.behindCount, " behind"] })) : null] })] })) : null, data.commitMessage ? (_jsx("div", { className: "bg-muted/50 rounded-lg p-3", "data-testid": "repository-drawer-commit-section", children: _jsxs("div", { className: "flex items-start gap-2", children: [_jsx(GitCommitHorizontal, { className: "text-muted-foreground mt-0.5 h-4 w-4 shrink-0" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-foreground text-sm leading-snug font-medium", "data-testid": "repository-drawer-commit-message", children: data.commitMessage }), data.committer ? (_jsxs("div", { className: "text-muted-foreground mt-1 flex items-center gap-1 text-xs", children: [_jsx(User, { className: "h-3 w-3 shrink-0" }), _jsx("span", { "data-testid": "repository-drawer-committer", children: data.committer })] })) : null] })] }) })) : null] })] })] })) : null, data.repositoryPath ? (_jsxs(_Fragment, { children: [_jsx(Separator, {}), _jsxs("div", { className: "flex flex-col gap-3 p-4", children: [_jsx("div", { className: "text-muted-foreground text-xs font-semibold tracking-wider", children: "OPEN WITH" }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(ActionButton, { label: "Open in IDE", onClick: repoActions.openInIde, loading: repoActions.ideLoading, error: !!repoActions.ideError, icon: Code2, variant: "outline", size: "sm" }), _jsx(ActionButton, { label: "Open in Shell", onClick: repoActions.openInShell, loading: repoActions.shellLoading, error: !!repoActions.shellError, icon: Terminal, variant: "outline", size: "sm" }), _jsx(ActionButton, { label: "Open Folder", onClick: repoActions.openFolder, loading: repoActions.folderLoading, error: !!repoActions.folderError, icon: FolderOpen, variant: "outline", size: "sm" })] })] })] })) : null, data.createdAt ? (_jsxs(_Fragment, { children: [_jsx(Separator, {}), _jsxs("div", { className: "flex flex-col gap-3 p-4", "data-testid": "repository-drawer-metadata", children: [_jsx("div", { className: "text-muted-foreground text-xs font-semibold tracking-wider", children: "INFO" }), _jsxs("div", { className: "flex items-center justify-between text-sm", children: [_jsxs("div", { className: "text-muted-foreground flex items-center gap-2", children: [_jsx(Clock, { className: "h-4 w-4 shrink-0" }), _jsx("span", { children: "Added" })] }), _jsx("span", { className: "text-foreground text-xs", title: new Date(data.createdAt).toLocaleString(), "data-testid": "repository-drawer-created-at", children: formatRelativeTime(data.createdAt) })] })] })] })) : null] }) }));
|
|
30
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-node.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-node/feature-node.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AA6DnE,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,
|
|
1
|
+
{"version":3,"file":"feature-node.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-node/feature-node.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AA6DnE,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,2CAiWA"}
|
|
@@ -80,16 +80,24 @@ export function FeatureNode({ data, selected, }) {
|
|
|
80
80
|
? 'BLOCKED'
|
|
81
81
|
: data.state === 'pending'
|
|
82
82
|
? 'PENDING'
|
|
83
|
-
: lifecycleDisplayLabels[data.lifecycle] }), _jsxs("div", { className: "flex items-center gap-0.5", children: [data.
|
|
83
|
+
: lifecycleDisplayLabels[data.lifecycle] }), _jsxs("div", { className: "flex items-center gap-0.5", children: [data.deployment ? (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", "aria-label": data.deployment.status === DeploymentState.Booting
|
|
84
|
+
? 'Deploying'
|
|
85
|
+
: 'Open dev server', "data-testid": "feature-node-deployment-indicator", onClick: (e) => {
|
|
86
|
+
e.stopPropagation();
|
|
87
|
+
if (data.deployment?.status === DeploymentState.Ready &&
|
|
88
|
+
data.deployment.url) {
|
|
89
|
+
window.open(data.deployment.url, '_blank', 'noopener,noreferrer');
|
|
90
|
+
}
|
|
91
|
+
}, className: cn('nodrag -mt-1 p-1', data.deployment.status === DeploymentState.Ready && data.deployment.url
|
|
92
|
+
? 'cursor-pointer opacity-80 transition-opacity hover:opacity-100'
|
|
93
|
+
: 'cursor-default'), children: data.deployment.status === DeploymentState.Booting ? (_jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin text-blue-500" })) : (_jsx(Globe, { className: "h-3.5 w-3.5 text-green-600" })) }) }), _jsx(TooltipContent, { side: "bottom", children: data.deployment.status === DeploymentState.Booting
|
|
94
|
+
? 'Deploying...'
|
|
95
|
+
: (data.deployment.url ?? 'Live') })] }) })) : null, data.fastMode ? (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("span", { "data-testid": "feature-node-fast-mode-badge", className: "-mt-1 p-1", children: _jsx(Zap, { className: "h-3.5 w-3.5 text-amber-500" }) }) }), _jsx(TooltipContent, { side: "bottom", children: "Fast Mode" })] }) })) : null, data.agentType ? (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", "aria-label": agentTypeLabels[data.agentType] ?? data.agentType, "data-testid": "feature-node-agent-badge", onClick: (e) => {
|
|
84
96
|
e.stopPropagation();
|
|
85
97
|
data.onSettings?.();
|
|
86
98
|
}, className: cn('nodrag -mt-1 -mr-1 p-1', data.onSettings
|
|
87
99
|
? 'cursor-pointer opacity-80 transition-opacity hover:opacity-100'
|
|
88
|
-
: 'cursor-default'), children: _jsx(AgentIcon, { agentType: data.agentType, className: "h-3.5 w-3.5" }) }) }), _jsxs(TooltipContent, { side: "bottom", children: [_jsx("span", { className: "font-medium", children: agentTypeLabels[data.agentType] ?? data.agentType }), data.modelId ? (_jsxs("span", { className: "ml-1 opacity-70", children: ["\u00B7 ", getModelMeta(data.modelId).displayName || data.modelId] })) : null] })] }) })) : null] })] }), _jsx("h3", { className: "mt-1 truncate text-sm font-bold", children: data.name }), data.description ? (_jsx("p", { "data-testid": "feature-node-description", className: "text-muted-foreground mt-0.5 truncate text-xs", children: data.description })) : null, data.
|
|
89
|
-
? 'bg-blue-50 text-blue-700'
|
|
90
|
-
: 'bg-green-50 text-green-700'), children: [data.deployment.status === DeploymentState.Booting ? (_jsx(Loader2, { className: "h-3 w-3 animate-spin" })) : (_jsx(Globe, { className: "h-3 w-3" })), _jsx("span", { className: "truncate", children: data.deployment.status === DeploymentState.Booting
|
|
91
|
-
? 'Deploying...'
|
|
92
|
-
: (data.deployment.url ?? 'Live') })] })) : null, _jsx("div", { className: "mt-auto pt-2", children: data.state === 'deleting' ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "mt-1.5 flex items-center gap-1.5 text-xs", children: [_jsx(Trash2, { className: "h-3.5 w-3.5 shrink-0 text-gray-400" }), _jsx("span", { className: "text-muted-foreground", children: "Deleting\u2026" })] }), _jsx("div", { "data-testid": "feature-node-progress-bar", className: "bg-muted mt-1.5 h-1 w-full overflow-hidden rounded-full", children: _jsx("div", { className: "motion-safe:animate-indeterminate-progress bg-foreground/30 h-full w-1/3 rounded-full" }) })] })) : data.state === 'creating' ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "mt-1.5 flex items-center gap-1.5 text-xs", children: [_jsx(Icon, { className: "h-3.5 w-3.5 shrink-0 animate-spin" }), _jsx("span", { className: "text-muted-foreground", children: getBadgeText(data) })] }), _jsx("div", { "data-testid": "feature-node-progress-bar", className: "bg-muted mt-1.5 h-1 w-full overflow-hidden rounded-full", children: _jsx("div", { className: "motion-safe:animate-indeterminate-progress bg-foreground/30 h-full w-1/3 rounded-full" }) })] })) : data.state === 'running' ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "mt-1.5 flex items-center gap-1.5 text-xs", children: [_jsx(AgentIcon, { agentType: data.agentType, className: "h-3.5 w-3.5 shrink-0" }), _jsx("span", { className: "text-muted-foreground", children: getBadgeText(data) })] }), _jsx("div", { "data-testid": "feature-node-progress-bar", className: "bg-muted mt-1.5 h-1 w-full overflow-hidden rounded-full", children: _jsx("div", { className: "animate-indeterminate-progress bg-foreground/30 h-full w-1/3 rounded-full" }) })] })) : config.showProgressBar ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "text-muted-foreground flex items-center justify-end text-[10px]", children: _jsxs("span", { children: [data.progress, "%"] }) }), _jsx("div", { "data-testid": "feature-node-progress-bar", className: "bg-muted mt-1.5 h-1 w-full overflow-hidden rounded-full", children: _jsx("div", { className: cn('h-full rounded-full transition-all', config.progressClass), style: { width: `${data.progress}%` } }) })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "text-muted-foreground flex items-center justify-between text-[10px]", children: [_jsx("span", { children: data.featureId }), (data.worktreePath ?? data.repositoryPath) ? (_jsx(FeatureSessionsDropdown, { repositoryPath: data.worktreePath ?? data.repositoryPath })) : null] }), _jsxs("div", { className: "mt-1.5 flex items-center gap-1.5", children: [_jsxs("div", { "data-testid": "feature-node-badge", className: (() => {
|
|
100
|
+
: 'cursor-default'), children: _jsx(AgentIcon, { agentType: data.agentType, className: "h-3.5 w-3.5" }) }) }), _jsxs(TooltipContent, { side: "bottom", children: [_jsx("span", { className: "font-medium", children: agentTypeLabels[data.agentType] ?? data.agentType }), data.modelId ? (_jsxs("span", { className: "ml-1 opacity-70", children: ["\u00B7 ", getModelMeta(data.modelId).displayName || data.modelId] })) : null] })] }) })) : null] })] }), _jsx("h3", { className: "mt-1 truncate text-sm font-bold", children: data.name }), data.description ? (_jsx("p", { "data-testid": "feature-node-description", className: "text-muted-foreground mt-0.5 truncate text-xs", children: data.description })) : null, _jsx("div", { className: "mt-auto pt-2", children: data.state === 'deleting' ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "mt-1.5 flex items-center gap-1.5 text-xs", children: [_jsx(Trash2, { className: "h-3.5 w-3.5 shrink-0 text-gray-400" }), _jsx("span", { className: "text-muted-foreground", children: "Deleting\u2026" })] }), _jsx("div", { "data-testid": "feature-node-progress-bar", className: "bg-muted mt-1.5 h-1 w-full overflow-hidden rounded-full", children: _jsx("div", { className: "motion-safe:animate-indeterminate-progress bg-foreground/30 h-full w-1/3 rounded-full" }) })] })) : data.state === 'creating' ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "mt-1.5 flex items-center gap-1.5 text-xs", children: [_jsx(Icon, { className: "h-3.5 w-3.5 shrink-0 animate-spin" }), _jsx("span", { className: "text-muted-foreground", children: getBadgeText(data) })] }), _jsx("div", { "data-testid": "feature-node-progress-bar", className: "bg-muted mt-1.5 h-1 w-full overflow-hidden rounded-full", children: _jsx("div", { className: "motion-safe:animate-indeterminate-progress bg-foreground/30 h-full w-1/3 rounded-full" }) })] })) : data.state === 'running' ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "mt-1.5 flex items-center gap-1.5 text-xs", children: [_jsx(AgentIcon, { agentType: data.agentType, className: "h-3.5 w-3.5 shrink-0" }), _jsx("span", { className: "text-muted-foreground", children: getBadgeText(data) })] }), _jsx("div", { "data-testid": "feature-node-progress-bar", className: "bg-muted mt-1.5 h-1 w-full overflow-hidden rounded-full", children: _jsx("div", { className: "animate-indeterminate-progress bg-foreground/30 h-full w-1/3 rounded-full" }) })] })) : config.showProgressBar ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "text-muted-foreground flex items-center justify-end text-[10px]", children: _jsxs("span", { children: [data.progress, "%"] }) }), _jsx("div", { "data-testid": "feature-node-progress-bar", className: "bg-muted mt-1.5 h-1 w-full overflow-hidden rounded-full", children: _jsx("div", { className: cn('h-full rounded-full transition-all', config.progressClass), style: { width: `${data.progress}%` } }) })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "text-muted-foreground flex items-center justify-between text-[10px]", children: [_jsx("span", { children: data.featureId }), (data.worktreePath ?? data.repositoryPath) ? (_jsx(FeatureSessionsDropdown, { repositoryPath: data.worktreePath ?? data.repositoryPath })) : null] }), _jsxs("div", { className: "mt-1.5 flex items-center gap-1.5", children: [_jsxs("div", { "data-testid": "feature-node-badge", className: (() => {
|
|
93
101
|
const override = getActionRequiredBadgeClasses(data);
|
|
94
102
|
return cn('flex min-w-0 flex-1 items-center justify-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-medium', override?.badgeBgClass ?? config.badgeBgClass, override?.badgeClass ?? config.badgeClass);
|
|
95
103
|
})(), children: [(() => {
|
|
@@ -22,6 +22,7 @@ export declare const FastModeDone: Story;
|
|
|
22
22
|
export declare const DeploymentBooting: Story;
|
|
23
23
|
export declare const DeploymentReady: Story;
|
|
24
24
|
export declare const DeploymentReadyNoUrl: Story;
|
|
25
|
+
export declare const DeploymentWithFastModeAndAgent: Story;
|
|
25
26
|
export declare const Interactive: Story;
|
|
26
27
|
export declare const Pending: Story;
|
|
27
28
|
export declare const PendingWithStart: Story;
|
package/dist/src/presentation/web/components/common/feature-node/feature-node.stories.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-node.stories.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-node/feature-node.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,KAAK,EACV,eAAe,EAIhB,MAAM,6BAA6B,CAAC;AAiCrC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,eAAe,CAc/B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;AAEvC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AA0HF,eAAO,MAAM,SAAS,EAAE,KAQvB,CAAC;AAYF,eAAO,MAAM,aAAa,EAAE,KAqB3B,CAAC;AA2EF,eAAO,MAAM,aAAa,EAAE,KAQ3B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAMxB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAOzB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAW7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAW9B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAUtB,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KAUvC,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAUtB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAW9B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAY5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAW9B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAatB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAc1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAY/B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAa7B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAYlC,CAAC;AA4EF,eAAO,MAAM,WAAW,EAAE,KAOzB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAW9B,CAAC"}
|
|
1
|
+
{"version":3,"file":"feature-node.stories.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-node/feature-node.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,KAAK,EACV,eAAe,EAIhB,MAAM,6BAA6B,CAAC;AAiCrC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,eAAe,CAc/B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;AAEvC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AA0HF,eAAO,MAAM,SAAS,EAAE,KAQvB,CAAC;AAYF,eAAO,MAAM,aAAa,EAAE,KAqB3B,CAAC;AA2EF,eAAO,MAAM,aAAa,EAAE,KAQ3B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAMxB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAOzB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAW7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAW9B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAUtB,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KAUvC,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAUtB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAW9B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAY5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAW9B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAatB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAc1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAY/B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAa7B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAYlC,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,KAe5C,CAAC;AA4EF,eAAO,MAAM,WAAW,EAAE,KAOzB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAW9B,CAAC"}
|
|
@@ -424,6 +424,22 @@ export const DeploymentReadyNoUrl = {
|
|
|
424
424
|
},
|
|
425
425
|
render: (args) => _jsx(FeatureNodeCanvas, { data: args }),
|
|
426
426
|
};
|
|
427
|
+
export const DeploymentWithFastModeAndAgent = {
|
|
428
|
+
args: {
|
|
429
|
+
name: 'Full Stack App',
|
|
430
|
+
description: 'Next.js app with all inline icons',
|
|
431
|
+
featureId: '#d4',
|
|
432
|
+
lifecycle: 'deploy',
|
|
433
|
+
state: 'done',
|
|
434
|
+
progress: 100,
|
|
435
|
+
runtime: '22m',
|
|
436
|
+
fastMode: true,
|
|
437
|
+
agentType: 'claude-code',
|
|
438
|
+
modelId: 'claude-sonnet-4-6',
|
|
439
|
+
deployment: { status: DeploymentState.Ready, url: 'http://localhost:3000' },
|
|
440
|
+
},
|
|
441
|
+
render: (args) => _jsx(FeatureNodeCanvas, { data: args }),
|
|
442
|
+
};
|
|
427
443
|
const interactiveInitialNodes = [
|
|
428
444
|
{
|
|
429
445
|
id: 'node-1',
|
package/dist/src/presentation/web/components/common/repository-node/repository-drawer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-drawer.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/repository-node/repository-drawer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"repository-drawer.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/repository-node/repository-drawer.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGnE,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAChC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAcD,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,qBAAqB,2CAsLxE"}
|
|
@@ -1,22 +1,39 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
|
-
import { Code2, Terminal, FolderOpen } from 'lucide-react';
|
|
4
|
+
import { Code2, Terminal, FolderOpen, GitBranch, GitCommitHorizontal, User, ArrowDown, Clock, } from 'lucide-react';
|
|
5
5
|
import { BaseDrawer } from '../../common/base-drawer/index.js';
|
|
6
6
|
import { DrawerTitle, DrawerDescription } from '../../ui/drawer.js';
|
|
7
7
|
import { Separator } from '../../ui/separator.js';
|
|
8
|
+
import { Badge } from '../../ui/badge.js';
|
|
8
9
|
import { ActionButton } from '../../common/action-button/index.js';
|
|
9
10
|
import { useRepositoryActions } from './use-repository-actions.js';
|
|
11
|
+
function formatRelativeTime(epochMs) {
|
|
12
|
+
const diff = Date.now() - epochMs;
|
|
13
|
+
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
|
|
14
|
+
if (days === 0)
|
|
15
|
+
return 'Today';
|
|
16
|
+
if (days === 1)
|
|
17
|
+
return 'Yesterday';
|
|
18
|
+
if (days < 30)
|
|
19
|
+
return `${days} days ago`;
|
|
20
|
+
const months = Math.floor(days / 30);
|
|
21
|
+
if (months < 12)
|
|
22
|
+
return `${months} month${months > 1 ? 's' : ''} ago`;
|
|
23
|
+
const years = Math.floor(months / 12);
|
|
24
|
+
return `${years} year${years > 1 ? 's' : ''} ago`;
|
|
25
|
+
}
|
|
10
26
|
export function RepositoryDrawer({ data, onClose }) {
|
|
11
27
|
const handleClose = useCallback(() => {
|
|
12
28
|
onClose();
|
|
13
29
|
}, [onClose]);
|
|
14
30
|
const actions = useRepositoryActions(data?.repositoryPath ? { repositoryPath: data.repositoryPath } : null);
|
|
31
|
+
const hasGitInfo = !!(data?.branch ?? data?.commitMessage);
|
|
15
32
|
return (_jsx(BaseDrawer, { open: data !== null, onClose: handleClose, size: "md", modal: false, "data-testid": "repository-drawer", deployTarget: data?.repositoryPath
|
|
16
33
|
? {
|
|
17
34
|
targetId: data.repositoryPath,
|
|
18
35
|
targetType: 'repository',
|
|
19
36
|
repositoryPath: data.repositoryPath,
|
|
20
37
|
}
|
|
21
|
-
: undefined, header: data ? (_jsxs("div", { "data-testid": "repository-drawer-header", children: [_jsx(DrawerTitle, { children: data.name }), data.repositoryPath ? (_jsx(DrawerDescription, { className: "truncate font-mono text-xs", children: data.repositoryPath })) : null] })) : undefined, children: data
|
|
38
|
+
: undefined, header: data ? (_jsxs("div", { "data-testid": "repository-drawer-header", children: [_jsx(DrawerTitle, { children: data.name }), data.repositoryPath ? (_jsx(DrawerDescription, { className: "truncate font-mono text-xs", children: data.repositoryPath })) : null] })) : undefined, children: data ? (_jsxs("div", { className: "flex flex-1 flex-col overflow-y-auto", children: [hasGitInfo ? (_jsxs(_Fragment, { children: [_jsx(Separator, {}), _jsxs("div", { className: "flex flex-col gap-3 p-4", "data-testid": "repository-drawer-git-section", children: [_jsx("div", { className: "text-muted-foreground text-xs font-semibold tracking-wider", children: "GIT STATUS" }), _jsxs("div", { className: "flex flex-col gap-2", children: [data.branch ? (_jsxs("div", { className: "flex items-center justify-between gap-2", "data-testid": "repository-drawer-branch-row", children: [_jsxs("div", { className: "text-muted-foreground flex items-center gap-2 text-sm", children: [_jsx(GitBranch, { className: "h-4 w-4 shrink-0" }), _jsx("span", { className: "text-foreground font-medium", children: "Branch" })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Badge, { variant: "secondary", className: "font-mono text-xs", "data-testid": "repository-drawer-branch", children: data.branch }), data.behindCount != null && data.behindCount > 0 ? (_jsxs(Badge, { variant: "outline", className: "border-amber-500/40 bg-amber-50 text-xs text-amber-600 dark:bg-amber-900/20 dark:text-amber-400", "data-testid": "repository-drawer-behind", children: [_jsx(ArrowDown, { className: "mr-1 h-3 w-3" }), data.behindCount, " behind"] })) : null] })] })) : null, data.commitMessage ? (_jsx("div", { className: "bg-muted/50 rounded-lg p-3", "data-testid": "repository-drawer-commit-section", children: _jsxs("div", { className: "flex items-start gap-2", children: [_jsx(GitCommitHorizontal, { className: "text-muted-foreground mt-0.5 h-4 w-4 shrink-0" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-foreground text-sm leading-snug font-medium", "data-testid": "repository-drawer-commit-message", children: data.commitMessage }), data.committer ? (_jsxs("div", { className: "text-muted-foreground mt-1 flex items-center gap-1 text-xs", children: [_jsx(User, { className: "h-3 w-3 shrink-0" }), _jsx("span", { "data-testid": "repository-drawer-committer", children: data.committer })] })) : null] })] }) })) : null] })] })] })) : null, data.repositoryPath ? (_jsxs(_Fragment, { children: [_jsx(Separator, {}), _jsxs("div", { className: "flex flex-col gap-3 p-4", children: [_jsx("div", { className: "text-muted-foreground text-xs font-semibold tracking-wider", children: "OPEN WITH" }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(ActionButton, { label: "Open in IDE", onClick: actions.openInIde, loading: actions.ideLoading, error: !!actions.ideError, icon: Code2, variant: "outline", size: "sm" }), _jsx(ActionButton, { label: "Open in Shell", onClick: actions.openInShell, loading: actions.shellLoading, error: !!actions.shellError, icon: Terminal, variant: "outline", size: "sm" }), _jsx(ActionButton, { label: "Open Folder", onClick: actions.openFolder, loading: actions.folderLoading, error: !!actions.folderError, icon: FolderOpen, variant: "outline", size: "sm" })] })] })] })) : null, data.createdAt ? (_jsxs(_Fragment, { children: [_jsx(Separator, {}), _jsxs("div", { className: "flex flex-col gap-3 p-4", "data-testid": "repository-drawer-metadata", children: [_jsx("div", { className: "text-muted-foreground text-xs font-semibold tracking-wider", children: "INFO" }), _jsxs("div", { className: "flex items-center justify-between text-sm", children: [_jsxs("div", { className: "text-muted-foreground flex items-center gap-2", children: [_jsx(Clock, { className: "h-4 w-4 shrink-0" }), _jsx("span", { children: "Added" })] }), _jsx("span", { className: "text-foreground text-xs", title: new Date(data.createdAt).toLocaleString(), "data-testid": "repository-drawer-created-at", children: formatRelativeTime(data.createdAt) })] })] })] })) : null] })) : null }));
|
|
22
39
|
}
|
package/dist/src/presentation/web/components/common/repository-node/repository-drawer.stories.d.ts
CHANGED
|
@@ -3,7 +3,12 @@ import { RepositoryDrawer } from './repository-drawer.js';
|
|
|
3
3
|
declare const meta: Meta<typeof RepositoryDrawer>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof RepositoryDrawer>;
|
|
6
|
+
/** Basic drawer — no git info, just path and actions. */
|
|
6
7
|
export declare const Default: Story;
|
|
8
|
+
/** Full enriched drawer — branch, commit, committer, behind count, metadata. */
|
|
9
|
+
export declare const WithGitInfo: Story;
|
|
10
|
+
/** On default branch — no behind count shown. */
|
|
11
|
+
export declare const OnDefaultBranch: Story;
|
|
7
12
|
export declare const LongPath: Story;
|
|
8
13
|
export declare const WithoutPath: Story;
|
|
9
14
|
/** Repository drawer rendered inside a full-page context — starts open. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-drawer.stories.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/repository-node/repository-drawer.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAOvC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,gBAAgB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"repository-drawer.stories.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/repository-node/repository-drawer.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAOvC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAgE/C,yDAAyD;AACzD,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,WAAW,EAAE,KAEzB,CAAC;AAEF,iDAAiD;AACjD,eAAO,MAAM,eAAe,EAAE,KAE7B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAUtB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAIzB,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC"}
|
package/dist/src/presentation/web/components/common/repository-node/repository-drawer.stories.js
CHANGED
|
@@ -16,30 +16,59 @@ const repoData = {
|
|
|
16
16
|
name: 'shep-ai/cli',
|
|
17
17
|
repositoryPath: '/home/user/shep-ai/cli',
|
|
18
18
|
};
|
|
19
|
+
const enrichedRepoData = {
|
|
20
|
+
id: 'repo-2',
|
|
21
|
+
name: 'shep-ai/cli',
|
|
22
|
+
repositoryPath: '/home/user/shep-ai/cli',
|
|
23
|
+
branch: 'feat/repo-tab-redesign',
|
|
24
|
+
commitMessage: 'feat(web): redesign repository drawer with git info',
|
|
25
|
+
committer: 'Jane Doe',
|
|
26
|
+
behindCount: 3,
|
|
27
|
+
createdAt: Date.now() - 1000 * 60 * 60 * 24 * 5, // 5 days ago
|
|
28
|
+
};
|
|
29
|
+
const onDefaultBranchData = {
|
|
30
|
+
id: 'repo-3',
|
|
31
|
+
name: 'my-org/my-project',
|
|
32
|
+
repositoryPath: '/home/user/my-org/my-project',
|
|
33
|
+
branch: 'main',
|
|
34
|
+
commitMessage: 'chore: bump dependencies to latest versions',
|
|
35
|
+
committer: 'John Smith',
|
|
36
|
+
behindCount: null,
|
|
37
|
+
createdAt: Date.now() - 1000 * 60 * 60 * 24 * 30, // 1 month ago
|
|
38
|
+
};
|
|
19
39
|
function DrawerTrigger({ data, label }) {
|
|
20
40
|
const [selected, setSelected] = useState(null);
|
|
21
41
|
return (_jsxs("div", { className: "flex h-screen items-start p-4", children: [_jsx(Button, { variant: "outline", onClick: () => setSelected(data), children: label }), _jsx(RepositoryDrawer, { data: selected, onClose: () => setSelected(null) })] }));
|
|
22
42
|
}
|
|
43
|
+
/* ---------------------------------------------------------------------------
|
|
44
|
+
* Shell template — full page context, starts open (matches ReviewDrawerShell pattern)
|
|
45
|
+
* ------------------------------------------------------------------------- */
|
|
46
|
+
function RepositoryDrawerShellTemplate({ data }) {
|
|
47
|
+
const [selected, setSelected] = useState(data);
|
|
48
|
+
return (_jsxs("div", { style: { height: '100vh', background: '#f8fafc', padding: '2rem' }, children: [_jsx("button", { type: "button", onClick: () => setSelected(data), style: { padding: '8px 16px', border: '1px solid #ccc', borderRadius: '6px' }, children: "Open Drawer" }), _jsx(RepositoryDrawer, { data: selected, onClose: () => setSelected(null) })] }));
|
|
49
|
+
}
|
|
50
|
+
/** Basic drawer — no git info, just path and actions. */
|
|
23
51
|
export const Default = {
|
|
24
52
|
render: () => _jsx(RepositoryDrawerShellTemplate, { data: repoData }),
|
|
25
53
|
};
|
|
54
|
+
/** Full enriched drawer — branch, commit, committer, behind count, metadata. */
|
|
55
|
+
export const WithGitInfo = {
|
|
56
|
+
render: () => _jsx(RepositoryDrawerShellTemplate, { data: enrichedRepoData }),
|
|
57
|
+
};
|
|
58
|
+
/** On default branch — no behind count shown. */
|
|
59
|
+
export const OnDefaultBranch = {
|
|
60
|
+
render: () => _jsx(RepositoryDrawerShellTemplate, { data: onDefaultBranchData }),
|
|
61
|
+
};
|
|
26
62
|
export const LongPath = {
|
|
27
63
|
render: () => (_jsx(DrawerTrigger, { data: {
|
|
28
|
-
...
|
|
64
|
+
...enrichedRepoData,
|
|
29
65
|
repositoryPath: '/home/user/projects/company/some-very-long-path/shep-ai/cli',
|
|
30
66
|
}, label: "Open Long Path" })),
|
|
31
67
|
};
|
|
32
68
|
export const WithoutPath = {
|
|
33
69
|
render: () => (_jsx(DrawerTrigger, { data: { ...repoData, repositoryPath: undefined }, label: "Open Without Path" })),
|
|
34
70
|
};
|
|
35
|
-
/* ---------------------------------------------------------------------------
|
|
36
|
-
* Shell template — full page context, starts open (matches ReviewDrawerShell pattern)
|
|
37
|
-
* ------------------------------------------------------------------------- */
|
|
38
|
-
function RepositoryDrawerShellTemplate({ data }) {
|
|
39
|
-
const [selected, setSelected] = useState(data);
|
|
40
|
-
return (_jsxs("div", { style: { height: '100vh', background: '#f8fafc', padding: '2rem' }, children: [_jsx("button", { type: "button", onClick: () => setSelected(data), style: { padding: '8px 16px', border: '1px solid #ccc', borderRadius: '6px' }, children: "Open Drawer" }), _jsx(RepositoryDrawer, { data: selected, onClose: () => setSelected(null) })] }));
|
|
41
|
-
}
|
|
42
71
|
/** Repository drawer rendered inside a full-page context — starts open. */
|
|
43
72
|
export const InDrawer = {
|
|
44
|
-
render: () => _jsx(RepositoryDrawerShellTemplate, { data:
|
|
73
|
+
render: () => _jsx(RepositoryDrawerShellTemplate, { data: enrichedRepoData }),
|
|
45
74
|
};
|