+ {#if stackId && selection?.irc && ircChannel}
+
+ {:else if stackId && selection?.branchName && selection?.codegen}
+
controller.closePreview()} />
+ {:else}
+ {@const commit = commitQuery?.response}
+ {@const dzCommit: DzCommitData | undefined = commit
+ ? {
+ id: commit.id,
+ isRemote: isUpstreamCommit(commit),
+ isIntegrated:
+ isLocalAndRemoteCommit(commit) && commit.state.type === "Integrated",
+ hasConflicts: isLocalAndRemoteCommit(commit) && commit.hasConflicts,
+ }
+ : undefined}
+ {@const { amendHandler, squashHandler, hunkHandler } =
+ controller.isCommitView && dzCommit
+ ? createCommitDropHandlers({
+ projectId: controller.projectId,
+ stackId: controller.stackId,
+ commit: dzCommit,
+ runHooks: $runHooks,
+ okWithForce: true,
+ onCommitIdChange: (newId) => {
+ if (stackId && branchName && selection) {
+ const previewOpen = selection.previewOpen ?? true;
+ controller.laneState.selection.set({
+ branchName,
+ commitId: newId,
+ previewOpen,
+ });
+ }
+ },
+ })
+ : { amendHandler: undefined, squashHandler: undefined, hunkHandler: undefined }}
+ {#if branchName && commitId}
+
+ {#snippet overlay({ hovered, activated, handler })}
+ {@const label =
+ handler instanceof AmendCommitWithChangeDzHandler ||
+ handler instanceof AmendCommitWithHunkDzHandler
+ ? "Amend"
+ : "Squash"}
+
+ {/snippet}
+
+ controller.closePreview()}
+ onpopout={() => controller.openFloatingDiff()}
+ />
+ {#if commitFiles}
+ {@const commitResult = commitFiles?.result}
+ {#if commitResult}
+
+ {#snippet children(commit)}
+
+ {/snippet}
+
+ {/if}
+ {/if}
+
+
+ {:else if branchName}
+ {@const changesQuery = stackService.branchChanges({
+ projectId: controller.projectId,
+ stackId: controller.stackId,
+ branch: branchName,
+ })}
+
+ controller.closePreview()}
+ rounded
+ onpopout={() => controller.openFloatingDiff()}
+ />
+
+ {#snippet children(result)}
+
+ {/snippet}
+
+
+ {:else if focusedFileStore}
+ controller.closePreview()}
+ startIndex={focusedFileStore ? get(focusedFileStore)?.index : undefined}
+ {onVisibleChange}
+ />
+ {/if}
+ {/if}
+
+
+
+{#if detailsEl}
+
+
+
+
+
+
{
+ dropzoneActivated = activated;
+ }}
+ onDropzoneHovered={(hovered) => {
+ dropzoneHovered = hovered;
+ }}
+ onFileClick={(index) => {
+ controller.selection.set(undefined);
+ controller.jumpToIndex(index);
+ }}
+ >
+ {#snippet emptyPlaceholder()}
+ {#if !controller.isCommitting}
+
+
+ Drop files to stage or commit directly
+
+
+ {/if}
+ {/snippet}
+
+
+
+ {#if startCommitVisible.current || controller.isCommitting}
+ {#if !controller.isCommitting}
+
+
+
+ {:else if controller.isCommitting}
+
+ {/if}
+ {/if}
+
+
+ {#if ircEnabled && topBranchName}
+
+ {/if}
+
+
+
+
+
diff --git a/apps/desktop/src/components/StackView.svelte b/apps/desktop/src/components/StackView.svelte
index 19803d262b3..51c8a74e327 100644
--- a/apps/desktop/src/components/StackView.svelte
+++ b/apps/desktop/src/components/StackView.svelte
@@ -1,63 +1,25 @@
{
@@ -464,13 +187,12 @@
},
options: {
threshold: 0.5,
- root: lanesScrollableEl,
},
}}
use:focusable={{
onKeydown: (event) => {
- if (event.key === "Escape" && isDetailsViewOpen) {
- onclosePreview();
+ if (event.key === "Escape" && isDetailsOpen) {
+ controller.closePreview();
event.preventDefault();
event.stopPropagation();
return true;
@@ -479,7 +201,7 @@
}}
>
{#snippet loading()}
@@ -491,124 +213,30 @@
(active = value) }}
+ use:focusable={{
+ vertical: true,
+ onActive: (value) => (controller.active = value),
+ }}
bind:this={stackViewEl}
>
-
-
-
-
-
-
-
{
- dropzoneActivated = activated;
- }}
- onDropzoneHovered={(hovered) => {
- dropzoneHovered = hovered;
- }}
- onFileClick={(index) => {
- // Clear one selection when you modify the other.
- laneState?.selection.set(undefined);
- multiDiffView?.jumpToIndex(index);
- }}
- >
- {#snippet emptyPlaceholder()}
- {#if !isCommitting}
-
-
- Drop files to stage or commit directly
-
-
- {/if}
- {/snippet}
-
-
-
- {#if startCommitVisible.current || isCommitting}
- {#if !isCommitting}
-
-
-
- {:else if isCommitting}
-
- {/if}
- {/if}
-
-
- {#if ircEnabled && topBranchName}
-
- {/if}
-
-
{
- // Clear one selection when you modify the other.
- idSelection.clear({ type: "worktree", stackId: stableStackId });
- }}
- onFileClick={(index) => {
- multiDiffView?.jumpToIndex(index);
- }}
- {visibleRange}
- />
-
+
{#if stackViewEl}
{
- // Update the persisted stack width when panel1 resizer changes
persistedStackWidth.set(newWidth);
}}
/>
@@ -616,227 +244,19 @@
-
- {#if isDetailsViewOpen}
- {@const selection = laneState.selection.current}
-
- {#if stableStackId && selection?.irc && ircChannel}
-
- {:else if stableStackId && selection?.branchName && selection?.codegen}
-
{
- mcpConfigModal?.open();
- }}
- {onAbort}
- {initialPrompt}
- events={events.response || []}
- permissionRequests={permissionRequests.response || []}
- onSubmit={sendMessage}
- onChange={(prompt) => messageSender?.setPrompt(prompt)}
- sessionId={sessionIdQuery.response}
- {isStackActive}
- {hasRulesToClear}
- projectRegistered={claudeConfig.projectRegistered}
- onRetryConfig={async () => {
- await claudeCodeService.fetchClaudeConfig({ projectId }, { forceRefetch: true });
- }}
- onAnswerQuestion={handleAnswerQuestion}
- />
- {:else}
- {@const commit = commitQuery?.response}
- {@const dzCommit: DzCommitData | undefined = commit
- ? {
- id: commit.id,
- isRemote: isUpstreamCommit(commit),
- isIntegrated:
- isLocalAndRemoteCommit(commit) && commit.state.type === 'Integrated',
- hasConflicts: isLocalAndRemoteCommit(commit) && commit.hasConflicts
- }
- : undefined}
- {@const { amendHandler, squashHandler, hunkHandler } =
- isCommitView && dzCommit
- ? createCommitDropHandlers({
- projectId: stableProjectId,
- stackId: stableStackId,
- stackService,
- hooksService,
- uiState,
- commit: dzCommit,
- runHooks: $runHooks,
- okWithForce: true,
- onCommitIdChange: (newId) => {
- if (stableStackId && branchName && selection) {
- const previewOpen = selection.previewOpen ?? true;
- uiState
- .lane(stableStackId)
- .selection.set({ branchName, commitId: newId, previewOpen });
- }
- },
- })
- : { amendHandler: undefined, squashHandler: undefined, hunkHandler: undefined }}
- {#if branchName && commitId}
-
- {#snippet overlay({ hovered, activated, handler })}
- {@const label =
- handler instanceof AmendCommitWithChangeDzHandler ||
- handler instanceof AmendCommitWithHunkDzHandler
- ? "Amend"
- : "Squash"}
-
- {/snippet}
-
- multiDiffView?.openFloatingDiff()}
- />
- {#if commitFiles}
- {@const commitResult = commitFiles?.result}
- {#if commitResult}
-
- {#snippet children(commit)}
-
- {/snippet}
-
- {/if}
- {/if}
-
-
- {:else if branchName}
- {@const changesQuery = stackService.branchChanges({
- projectId: stableProjectId,
- stackId: stableStackId,
- branch: branchName,
- })}
-
-
- multiDiffView?.openFloatingDiff()}
- />
-
- {#snippet children(result)}
-
- {/snippet}
-
-
- {:else if $activeLastAdded}
-
- {/if}
- {/if}
-
-
-
- {#if compactDiv}
-
- {/if}
+
+ {#if isDetailsOpen}
+
{/if}
{/snippet}
-