feat: add integrate commits to parental branch section and wired UI

Introduce IntegrateCommitsSection to plan and apply commits from source to target branch
Wire the integration panel into GitView so users can run integrate flow from the current worktree
This commit is contained in:
Bohdan Triapitsyn
2026-01-28 02:10:40 +02:00
parent 415b043326
commit 84e9391871
12 changed files with 932 additions and 16 deletions
+1 -1
View File
@@ -574,7 +574,7 @@ export const useSessionStore = create<SessionStore>()(
}
});
// Check if .openchamber directory exists before trying to list it
// LEGACY_WORKTREES: check if .openchamber directory exists before listing it
// LEGACY_WORKTREES: filesystem scan fallback for legacy <project>/.openchamber/*
const projectEntriesList = await opencodeClient.listLocalDirectory(normalizedProject);
const worktreeDirExists = projectEntriesList.some(
@@ -9,6 +9,7 @@ import type { WorktreeMetadata } from '@/types/worktree';
import { listWorktrees, mapWorktreeToMetadata } from '@/lib/git/worktreeService';
import type { Session } from '@opencode-ai/sdk/v2';
// LEGACY_WORKTREES: legacy worktree root inside project.
const OPENCHAMBER_DIR = '.openchamber';
const resolveProjectDirectory = (currentDirectory: string | null | undefined): string | null => {
+6 -1
View File
@@ -167,6 +167,11 @@ export const useMultiRunStore = create<MultiRunStore>()(
startPoint: startPoint ?? null,
});
const enrichedMetadata = {
...worktreeMetadata,
createdFromBranch: startPoint ?? 'HEAD',
};
// Session title format: groupSlug/provider/model (or groupSlug/provider/model/index for duplicates)
const sessionTitle = count > 1
? `${groupSlug}/${model.providerID}/${model.modelID}/${index}`
@@ -177,7 +182,7 @@ export const useMultiRunStore = create<MultiRunStore>()(
() => opencodeClient.createSession({ title: sessionTitle })
);
useSessionStore.getState().setWorktreeMetadata(session.id, worktreeMetadata);
useSessionStore.getState().setWorktreeMetadata(session.id, enrichedMetadata);
createdRuns.push({
sessionId: session.id,