@shepai/cli 1.101.1 → 1.101.2-pr296.eaa08e7
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/infrastructure/repositories/sqlite-repository.repository.js +1 -1
- package/dist/src/presentation/web/app/api/agent-events/route.d.ts.map +1 -1
- package/dist/src/presentation/web/app/api/agent-events/route.js +7 -2
- package/dist/src/presentation/web/app/build-graph-nodes.d.ts.map +1 -1
- package/dist/src/presentation/web/app/build-graph-nodes.js +6 -1
- package/dist/src/presentation/web/components/common/repository-node/repository-node-config.d.ts +2 -0
- package/dist/src/presentation/web/components/common/repository-node/repository-node-config.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/control-center/use-control-center-state.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/control-center/use-control-center-state.js +7 -1
- package/dist/src/presentation/web/hooks/use-graph-state.d.ts.map +1 -1
- package/dist/src/presentation/web/hooks/use-graph-state.js +24 -0
- package/dist/src/presentation/web/lib/derive-graph.d.ts.map +1 -1
- package/dist/src/presentation/web/lib/derive-graph.js +9 -2
- package/dist/src/presentation/web/lib/layout-with-dagre.d.ts +2 -2
- package/dist/src/presentation/web/lib/layout-with-dagre.d.ts.map +1 -1
- package/dist/src/presentation/web/lib/layout-with-dagre.js +34 -35
- 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 +20 -20
- 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 +25 -25
- 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 +25 -25
- 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 +18 -18
- 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 +20 -20
- 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 +25 -25
- 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 +25 -25
- 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 +18 -18
- 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 +18 -18
- 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_client-reference-manifest.js +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +5 -5
- 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_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_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_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_4d623b8e.js +1 -1
- package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_4d623b8e.js.map +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_c757eb00.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_c757eb00.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_7eb49631.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_7eb49631.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0b6bb4ae._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0b6bb4ae._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__24dd0927._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5d87af2e._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6a82177d._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6a82177d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__89e8a5cc._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ec9a1550._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ec9a1550._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f8932d55._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f8932d55._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js.map +1 -1
- 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/{_a71a214c._.js → _23f357f4._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_a71a214c._.js.map → _23f357f4._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_6e08ce21._.js +1 -1
- package/web/.next/server/chunks/ssr/_6e08ce21._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_8dacd1e7._.js +1 -1
- package/web/.next/server/chunks/ssr/_8dacd1e7._.js.map +1 -1
- 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/{_a4809c63._.js → _df3d70ea._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_a4809c63._.js.map → _df3d70ea._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_e2b3790e._.js → _fa12eedc._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_e2b3790e._.js.map → _fa12eedc._.js.map} +1 -1
- 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/src_presentation_web_3c53a23d._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_3c53a23d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_befd865a.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_befd865a.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_app_(dashboard)_get-graph-data_ts_b018483e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_(dashboard)_get-graph-data_ts_b018483e._.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_de814675._.js +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_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/chunks/ssr/src_presentation_web_ec8c7a4f._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_ec8c7a4f._.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 +30 -30
- package/web/.next/static/chunks/11d8fda1ec0bbea3.js +1 -0
- package/web/.next/static/chunks/{1a5e3b6ce431e740.js → 35c748481bdf2881.js} +2 -2
- package/web/.next/static/chunks/{0a2448451d734be0.js → 3c9bd1867e8105e6.js} +1 -1
- package/web/.next/static/chunks/{3abc20f8097a5aee.js → 83d33de8ad6ce6f8.js} +1 -1
- package/web/.next/static/chunks/{8973b9ec73f4bb86.js → 94faf0b1ca78aea8.js} +1 -1
- package/web/.next/static/chunks/{a46c51efe1c957c9.js → bc91048c4dcee562.js} +1 -1
- package/web/.next/static/chunks/{0639ce0a2347d886.js → c1a3bd34f0379725.js} +1 -1
- package/web/.next/static/chunks/{dd026ec520c1f2fc.js → c1e7a93e1a6e5b1e.js} +1 -1
- package/web/.next/static/chunks/{a7bddf19d135b976.js → d517927fd4726845.js} +1 -1
- package/web/.next/static/chunks/fab1d45fdc6e98b6.js +1 -0
- package/web/.next/static/chunks/{0c703c64afd43ef2.js → fed2903602f8c6c4.js} +2 -2
- package/web/.next/static/chunks/57a0bdac3a48ea32.js +0 -1
- package/web/.next/static/chunks/8cb3809188350912.js +0 -1
- /package/web/.next/static/{rKUKX7asiNPagVDGB3TC1 → Ko8yjftjBxQGKlrbqIGnz}/_buildManifest.js +0 -0
- /package/web/.next/static/{rKUKX7asiNPagVDGB3TC1 → Ko8yjftjBxQGKlrbqIGnz}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{rKUKX7asiNPagVDGB3TC1 → Ko8yjftjBxQGKlrbqIGnz}/_ssgManifest.js +0 -0
|
@@ -41,7 +41,7 @@ let SQLiteRepositoryRepository = class SQLiteRepositoryRepository {
|
|
|
41
41
|
return row ? fromDatabase(row) : null;
|
|
42
42
|
}
|
|
43
43
|
async list() {
|
|
44
|
-
const stmt = this.db.prepare('SELECT * FROM repositories WHERE deleted_at IS NULL ORDER BY
|
|
44
|
+
const stmt = this.db.prepare('SELECT * FROM repositories WHERE deleted_at IS NULL ORDER BY created_at ASC');
|
|
45
45
|
const rows = stmt.all();
|
|
46
46
|
return rows.map(fromDatabase);
|
|
47
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/app/api/agent-events/route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAgBH,eAAO,MAAM,OAAO,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/app/api/agent-events/route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAgBH,eAAO,MAAM,OAAO,kBAAkB,CAAC;AAmEvC,wBAAgB,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,QAAQ,CAqP9C"}
|
|
@@ -133,6 +133,7 @@ export function GET(request) {
|
|
|
133
133
|
lifecycle: feature.lifecycle,
|
|
134
134
|
completedPhases,
|
|
135
135
|
featureName: feature.name,
|
|
136
|
+
prStatus: feature.pr?.status,
|
|
136
137
|
prMergeable: feature.pr?.mergeable,
|
|
137
138
|
prCiStatus: feature.pr?.ciStatus,
|
|
138
139
|
});
|
|
@@ -188,10 +189,14 @@ export function GET(request) {
|
|
|
188
189
|
});
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
|
-
// Check for PR data changes (mergeable / CI status)
|
|
192
|
+
// Check for PR data changes (status / mergeable / CI status)
|
|
193
|
+
const curPrStatus = feature.pr?.status;
|
|
192
194
|
const curMergeable = feature.pr?.mergeable;
|
|
193
195
|
const curCiStatus = feature.pr?.ciStatus;
|
|
194
|
-
if (
|
|
196
|
+
if (curPrStatus !== prev.prStatus ||
|
|
197
|
+
curMergeable !== prev.prMergeable ||
|
|
198
|
+
curCiStatus !== prev.prCiStatus) {
|
|
199
|
+
prev.prStatus = curPrStatus;
|
|
195
200
|
prev.prMergeable = curMergeable;
|
|
196
201
|
prev.prCiStatus = curCiStatus;
|
|
197
202
|
const nodeName = LIFECYCLE_TO_NODE[feature.lifecycle] ?? 'merge';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-graph-nodes.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/web/app/build-graph-nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAM1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAG1C,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,QAAQ,GAAG,IAAI,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,UAAU,EAAE,EAC1B,gBAAgB,EAAE,cAAc,EAAE,GACjC;IAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IAAC,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"build-graph-nodes.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/web/app/build-graph-nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAM1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAG1C,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,QAAQ,GAAG,IAAI,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,UAAU,EAAE,EAC1B,gBAAgB,EAAE,cAAc,EAAE,GACjC;IAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IAAC,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,CAuE5C"}
|
|
@@ -29,7 +29,12 @@ export function buildGraphNodes(repositories, featuresWithRuns) {
|
|
|
29
29
|
id: repoNodeId,
|
|
30
30
|
type: 'repositoryNode',
|
|
31
31
|
position: { x: 0, y: 0 },
|
|
32
|
-
data: {
|
|
32
|
+
data: {
|
|
33
|
+
name: repo.name,
|
|
34
|
+
repositoryPath: repo.path,
|
|
35
|
+
id: repo.id,
|
|
36
|
+
createdAt: repo.createdAt instanceof Date ? repo.createdAt.getTime() : Number(repo.createdAt),
|
|
37
|
+
},
|
|
33
38
|
});
|
|
34
39
|
const repoFeatures = featuresByRepo[repo.path] ?? [];
|
|
35
40
|
appendFeatureNodes(repoFeatures, repoNodeId, featuresWithRuns, nodes, edges, repo.name);
|
package/dist/src/presentation/web/components/common/repository-node/repository-node-config.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export interface RepositoryNodeData {
|
|
|
7
7
|
name: string;
|
|
8
8
|
/** Absolute path to the repository root, used for IDE/shell actions */
|
|
9
9
|
repositoryPath?: string;
|
|
10
|
+
/** Creation timestamp (epoch ms) — used for stable vertical ordering. */
|
|
11
|
+
createdAt?: number;
|
|
10
12
|
onClick?: () => void;
|
|
11
13
|
onAdd?: () => void;
|
|
12
14
|
onDelete?: (repositoryId: string) => void;
|
package/dist/src/presentation/web/components/common/repository-node/repository-node-config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-node-config.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/repository-node/repository-node-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,MAAM,WAAW,kBAAkB;IACjC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,qEAAqE;IACrE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"repository-node-config.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/repository-node/repository-node-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,MAAM,WAAW,kBAAkB;IACjC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,qEAAqE;IACrE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-control-center-state.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/features/control-center/use-control-center-state.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAC;AAcjC,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAM7E,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,aAAa,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,cAAc,CAAC,EAAE,KAAK,IAAI,CAAC;IAC/D,aAAa,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAChD,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/E,YAAY,EAAE,CAAC,SAAS,EAAE,eAAe,KAAK,IAAI,CAAC;IACnD,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACpE,sBAAsB,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,iBAAiB,EAAE,CACjB,YAAY,EAAE,MAAM,GAAG,IAAI,EAC3B,YAAY,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,EACvC,QAAQ,CAAC,EAAE,MAAM,KACd,MAAM,CAAC;IACZ,wDAAwD;IACxD,wBAAwB,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACxE,gDAAgD;IAChD,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAC;IACtE,0EAA0E;IAC1E,YAAY,EAAE,CAAC,SAAS,EAAE,cAAc,KAAK,IAAI,CAAC;CACnD;AAQD,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,cAAc,EAAE,EAC9B,YAAY,EAAE,IAAI,EAAE,GACnB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"use-control-center-state.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/features/control-center/use-control-center-state.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qC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nC,YAAY,EAAE,cAAc,EAAE,EAC9B,YAAY,EAAE,IAAI,EAAE,GACnB,kBAAkB,CAmapB"}
|
package/dist/src/presentation/web/components/features/control-center/use-control-center-state.js
CHANGED
|
@@ -318,7 +318,12 @@ export function useControlCenterState(initialNodes, initialEdges) {
|
|
|
318
318
|
.replace(/[\\/]+$/, '')
|
|
319
319
|
.split(/[\\/]/)
|
|
320
320
|
.pop() ?? path;
|
|
321
|
-
addRepositoryToMap(tempId, {
|
|
321
|
+
addRepositoryToMap(tempId, {
|
|
322
|
+
name: repoName,
|
|
323
|
+
repositoryPath: path,
|
|
324
|
+
id: tempId,
|
|
325
|
+
createdAt: Date.now(),
|
|
326
|
+
});
|
|
322
327
|
addRepository({ path, name: repoName })
|
|
323
328
|
.then((result) => {
|
|
324
329
|
if (result.error) {
|
|
@@ -332,6 +337,7 @@ export function useControlCenterState(initialNodes, initialEdges) {
|
|
|
332
337
|
name: repo.name,
|
|
333
338
|
repositoryPath: repo.path,
|
|
334
339
|
id: repo.id,
|
|
340
|
+
createdAt: repo.createdAt instanceof Date ? repo.createdAt.getTime() : Number(repo.createdAt),
|
|
335
341
|
});
|
|
336
342
|
createSound.play();
|
|
337
343
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-graph-state.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/web/hooks/use-graph-state.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAY,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE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|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
+
// Anchor new layout to previous positions so the graph doesn't drift.
|
|
94
|
+
// Find the first surviving node (exists in both old and new layouts) and
|
|
95
|
+
// shift the entire new layout by the delta between its old and new position.
|
|
96
|
+
const prevPositions = layoutCacheRef.current.positions;
|
|
97
|
+
if (prevPositions.size > 0) {
|
|
98
|
+
let dx = 0;
|
|
99
|
+
let dy = 0;
|
|
100
|
+
for (const [id, newPos] of positions) {
|
|
101
|
+
const oldPos = prevPositions.get(id);
|
|
102
|
+
if (oldPos) {
|
|
103
|
+
dx = oldPos.position.x - newPos.position.x;
|
|
104
|
+
dy = oldPos.position.y - newPos.position.y;
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (dx !== 0 || dy !== 0) {
|
|
109
|
+
for (const pos of positions.values()) {
|
|
110
|
+
pos.position = { x: pos.position.x + dx, y: pos.position.y + dy };
|
|
111
|
+
}
|
|
112
|
+
for (const node of result.nodes) {
|
|
113
|
+
node.position = { x: node.position.x + dx, y: node.position.y + dy };
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
93
117
|
layoutCacheRef.current = { key: topologyKey, positions };
|
|
94
118
|
return result;
|
|
95
119
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive-graph.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/web/lib/derive-graph.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,qDAAqD;AACrD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EA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AAE,cAAc,GACzB;IAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IAAC,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,CAgI5C"}
|
|
@@ -41,8 +41,15 @@ export function deriveGraph(featureMap, repoMap, pendingMap, callbacks) {
|
|
|
41
41
|
virtualRepos.set(repositoryPath, virtualId);
|
|
42
42
|
return virtualId;
|
|
43
43
|
}
|
|
44
|
-
// Add repo nodes (real ones)
|
|
45
|
-
|
|
44
|
+
// Add repo nodes (real ones) — sorted by createdAt for stable vertical order.
|
|
45
|
+
// The server-side layoutWithDagre may reorder the node array (connected vs
|
|
46
|
+
// disconnected split), so we cannot rely on Map insertion order alone.
|
|
47
|
+
const sortedRepoEntries = [...repoMap.entries()].sort((a, b) => {
|
|
48
|
+
const aTime = a[1].data.createdAt ?? 0;
|
|
49
|
+
const bTime = b[1].data.createdAt ?? 0;
|
|
50
|
+
return aTime - bTime;
|
|
51
|
+
});
|
|
52
|
+
for (const [nodeId, entry] of sortedRepoEntries) {
|
|
46
53
|
const data = {
|
|
47
54
|
...entry.data,
|
|
48
55
|
...(callbacks?.onRepositoryAdd && {
|
|
@@ -19,8 +19,8 @@ export declare const CANVAS_LAYOUT_DEFAULTS: LayoutOptions;
|
|
|
19
19
|
* Compute an automatic hierarchical layout for React Flow nodes and edges
|
|
20
20
|
* using Dagre. Returns new node/edge arrays — never mutates the originals.
|
|
21
21
|
*
|
|
22
|
-
* Disconnected nodes (no edges) are
|
|
23
|
-
*
|
|
22
|
+
* Disconnected nodes (no edges) are interleaved with connected root trees
|
|
23
|
+
* in their original input order, preserving the caller's sort (e.g. createdAt).
|
|
24
24
|
*/
|
|
25
25
|
export declare function layoutWithDagre<N extends Node>(nodes: N[], edges: Edge[], opts?: LayoutOptions): {
|
|
26
26
|
nodes: N[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-with-dagre.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/web/lib/layout-with-dagre.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAExD,MAAM,WAAW,aAAa;IAC5B,iEAAiE;IACjE,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,+DAA+D;AAC/D,eAAO,MAAM,sBAAsB,EAAE,aAIpC,CAAC;AAkCF;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,IAAI,EAC5C,KAAK,EAAE,CAAC,EAAE,EACV,KAAK,EAAE,IAAI,EAAE,EACb,IAAI,GAAE,aAAkB,GACvB;IAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAAC,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"layout-with-dagre.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/web/lib/layout-with-dagre.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAExD,MAAM,WAAW,aAAa;IAC5B,iEAAiE;IACjE,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,+DAA+D;AAC/D,eAAO,MAAM,sBAAsB,EAAE,aAIpC,CAAC;AAkCF;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,IAAI,EAC5C,KAAK,EAAE,CAAC,EAAE,EACV,KAAK,EAAE,IAAI,EAAE,EACb,IAAI,GAAE,aAAkB,GACvB;IAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAAC,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,CAqL/B"}
|
|
@@ -35,8 +35,8 @@ function getHandlePositions(direction) {
|
|
|
35
35
|
* Compute an automatic hierarchical layout for React Flow nodes and edges
|
|
36
36
|
* using Dagre. Returns new node/edge arrays — never mutates the originals.
|
|
37
37
|
*
|
|
38
|
-
* Disconnected nodes (no edges) are
|
|
39
|
-
*
|
|
38
|
+
* Disconnected nodes (no edges) are interleaved with connected root trees
|
|
39
|
+
* in their original input order, preserving the caller's sort (e.g. createdAt).
|
|
40
40
|
*/
|
|
41
41
|
export function layoutWithDagre(nodes, edges, opts = {}) {
|
|
42
42
|
const { direction = 'TB', nodeSize = { width: 172, height: 36 }, ranksep = 80, nodesep = 30, } = opts;
|
|
@@ -75,6 +75,23 @@ export function layoutWithDagre(nodes, edges, opts = {}) {
|
|
|
75
75
|
const size = getNodeSize(node, nodeSize);
|
|
76
76
|
centerMap.set(node.id, { cx: dagreNode.x, cy: dagreNode.y, w: size.width, h: size.height });
|
|
77
77
|
}
|
|
78
|
+
// Add disconnected nodes to centerMap so they participate in root positioning.
|
|
79
|
+
// Use the same primary-axis position as connected roots (rank 0) so they align
|
|
80
|
+
// visually with repos that have features attached.
|
|
81
|
+
let rootPrimaryAxis = 0;
|
|
82
|
+
for (const c of centerMap.values()) {
|
|
83
|
+
rootPrimaryAxis = isHorizontal ? c.cx : c.cy;
|
|
84
|
+
break; // Use the first connected node's primary position
|
|
85
|
+
}
|
|
86
|
+
for (const node of disconnectedNodes) {
|
|
87
|
+
const size = getNodeSize(node, nodeSize);
|
|
88
|
+
centerMap.set(node.id, {
|
|
89
|
+
cx: isHorizontal ? rootPrimaryAxis : 0,
|
|
90
|
+
cy: isHorizontal ? 0 : rootPrimaryAxis,
|
|
91
|
+
w: size.width,
|
|
92
|
+
h: size.height,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
78
95
|
// ── Proper tree layout for the secondary axis ──
|
|
79
96
|
// Dagre gives us correct primary-axis (rank/X) positions but its secondary-
|
|
80
97
|
// axis (Y) positioning doesn't respect our tree structure well. Replace it
|
|
@@ -94,21 +111,24 @@ export function layoutWithDagre(nodes, edges, opts = {}) {
|
|
|
94
111
|
}
|
|
95
112
|
// Sort children by input order (preserves caller's ordering, e.g. createdAt)
|
|
96
113
|
const inputIndex = new Map();
|
|
97
|
-
for (let i = 0; i <
|
|
98
|
-
inputIndex.set(
|
|
114
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
115
|
+
inputIndex.set(nodes[i].id, i);
|
|
99
116
|
}
|
|
100
117
|
for (const [, kids] of childrenOf) {
|
|
101
118
|
kids.sort((a, b) => (inputIndex.get(a) ?? 0) - (inputIndex.get(b) ?? 0));
|
|
102
119
|
}
|
|
103
|
-
// Find tree roots
|
|
120
|
+
// Find tree roots: connected nodes that are not children of another node
|
|
104
121
|
const childSet = new Set();
|
|
105
122
|
for (const ids of childrenOf.values()) {
|
|
106
123
|
for (const id of ids)
|
|
107
124
|
childSet.add(id);
|
|
108
125
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
126
|
+
const connectedRoots = [...connectedIds].filter((id) => centerMap.has(id) && !childSet.has(id));
|
|
127
|
+
// Merge connected roots and disconnected nodes, sorted by input order
|
|
128
|
+
// so repos maintain their original creation-time ordering regardless of
|
|
129
|
+
// whether they have features attached.
|
|
130
|
+
const allRoots = [...connectedRoots, ...disconnectedNodes.map((n) => n.id)];
|
|
131
|
+
allRoots.sort((a, b) => (inputIndex.get(a) ?? 0) - (inputIndex.get(b) ?? 0));
|
|
112
132
|
// Bottom-up: compute the total secondary-axis span each subtree needs
|
|
113
133
|
const subtreeSpan = new Map();
|
|
114
134
|
function computeSpan(nodeId) {
|
|
@@ -130,7 +150,7 @@ export function layoutWithDagre(nodes, edges, opts = {}) {
|
|
|
130
150
|
subtreeSpan.set(nodeId, span);
|
|
131
151
|
return span;
|
|
132
152
|
}
|
|
133
|
-
for (const root of
|
|
153
|
+
for (const root of allRoots)
|
|
134
154
|
computeSpan(root);
|
|
135
155
|
// Top-down: position each node on the secondary axis, centering parent
|
|
136
156
|
// on its children block. For 1-to-1 edges the child gets the same
|
|
@@ -160,17 +180,19 @@ export function layoutWithDagre(nodes, edges, opts = {}) {
|
|
|
160
180
|
cursor += kidSpan + nodesep;
|
|
161
181
|
}
|
|
162
182
|
}
|
|
163
|
-
// Position
|
|
183
|
+
// Position all root trees (connected and disconnected) in input order.
|
|
164
184
|
let rootCursor = 0;
|
|
165
|
-
for (const root of
|
|
185
|
+
for (const root of allRoots) {
|
|
166
186
|
const span = subtreeSpan.get(root) ?? 0;
|
|
167
187
|
positionTree(root, rootCursor + span / 2);
|
|
168
188
|
rootCursor += span + nodesep;
|
|
169
189
|
}
|
|
170
190
|
// Build result array converting center-coords to React Flow top-left
|
|
171
191
|
const result = [];
|
|
172
|
-
for (const node of
|
|
192
|
+
for (const node of nodes) {
|
|
173
193
|
const c = centerMap.get(node.id);
|
|
194
|
+
if (!c)
|
|
195
|
+
continue;
|
|
174
196
|
result.push({
|
|
175
197
|
...node,
|
|
176
198
|
targetPosition,
|
|
@@ -178,28 +200,5 @@ export function layoutWithDagre(nodes, edges, opts = {}) {
|
|
|
178
200
|
position: { x: c.cx - c.w / 2, y: c.cy - c.h / 2 },
|
|
179
201
|
});
|
|
180
202
|
}
|
|
181
|
-
// Place disconnected nodes after the laid-out graph so they don't overlap
|
|
182
|
-
if (disconnectedNodes.length > 0) {
|
|
183
|
-
let maxY = 0;
|
|
184
|
-
let minX = Infinity;
|
|
185
|
-
for (const n of result) {
|
|
186
|
-
const size = getNodeSize(n, nodeSize);
|
|
187
|
-
maxY = Math.max(maxY, n.position.y + size.height);
|
|
188
|
-
minX = Math.min(minX, n.position.x);
|
|
189
|
-
}
|
|
190
|
-
// When no graph nodes exist (all disconnected), default to origin
|
|
191
|
-
if (minX === Infinity)
|
|
192
|
-
minX = 0;
|
|
193
|
-
for (let i = 0; i < disconnectedNodes.length; i++) {
|
|
194
|
-
const node = disconnectedNodes[i];
|
|
195
|
-
const size = getNodeSize(node, nodeSize);
|
|
196
|
-
result.push({
|
|
197
|
-
...node,
|
|
198
|
-
targetPosition,
|
|
199
|
-
sourcePosition,
|
|
200
|
-
position: { x: minX, y: maxY + 30 + i * (size.height + 20) },
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
203
|
return { nodes: result, edges: [...edges] };
|
|
205
204
|
}
|