Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/tidy-worktree-finish.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"kilo-code": patch
---

Show a filled checkbox and crossed-out title, then collapse the worktree card only after successful deletion. Respect reduced motion and require the explicit Delete? button to confirm deletion instead of a card click.
Remove deleted worktree cards with a smoother exit: the row acknowledges the click immediately, the title is crossed out from left to right, and the card is swept away in about a third of a second, only after successful deletion. Respect reduced motion and require the explicit Delete? button to confirm deletion instead of a card click.
5 changes: 3 additions & 2 deletions packages/kilo-vscode/tests/fixtures/worktree-finish.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,13 @@ for (const id of ["legacy", "project-two"]) {
const completed = root.querySelector(".am-worktree-completed")!
assert.ok(completed, `${id}: retain success in either event order`)
assert.equal(completed.querySelector(".am-worktree-branch")!.textContent, "Test task")
assert.ok(completed.querySelector(".am-worktree-finish-box [data-component=icon]"))
assert.ok(completed.querySelector(".am-wt-name"), `${id}: strike the removed title`)
assert.equal(completed.querySelector(".am-worktree-finish-box"), null, "no checkbox on a worktree card")
assert.equal(completed.querySelector("[data-sidebar-id]"), null)
assert.ok(completed.querySelector(".am-worktree-item")!.hasAttribute("inert"))
assert.equal(completed.querySelector("[role=status]")!.textContent, "Test task: Deleted")
assert.equal(root.querySelector('[data-sidebar-id="wt-sibling"]')!.closest(".am-worktree-completed"), null)
root.querySelector(".am-worktree-finish-box")!.dispatchEvent(new window.Event("animationend", { bubbles: true }))
completed.querySelector(".am-worktree-item")!.dispatchEvent(new window.Event("animationend", { bubbles: true }))
assert.ok(root.querySelector(".am-worktree-completed"), "ignore child animation events")
root.querySelector(".am-worktree-exit")!.dispatchEvent(new window.Event("animationend", { bubbles: true }))
assert.equal(root.querySelector(".am-worktree-completed"), null, "release after collapse")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ export const WorktreeItem: Component<WorktreeItemProps> = (props) => {
}}
title={t("agentManager.worktree.doubleClickRename")}
>
{props.label}
{/* Inner span keeps the finish strikethrough tight to the text. */}
<span class="am-wt-name">{props.label}</span>
</span>
}
>
Expand Down Expand Up @@ -367,11 +368,6 @@ export const WorktreeItem: Component<WorktreeItemProps> = (props) => {
</Button>
</Show>
<div class="am-wt-hover-actions">
<Show when={props.completed}>
<span class="am-worktree-finish-box" aria-hidden="true">
<Icon name="check-small" size="small" />
</span>
</Show>
<Show
when={props.shortcut !== undefined && props.shortcut >= 2 && props.shortcut <= MAX_SHORTCUT}
>
Expand Down
95 changes: 71 additions & 24 deletions packages/kilo-vscode/webview-ui/agent-manager/agent-manager.css
Original file line number Diff line number Diff line change
Expand Up @@ -734,37 +734,50 @@ html[data-theme="kilo-vscode"]
min-width: 0;
}

/*
* The card leaves, it is not ticked off. The row acknowledges the click with an
* instant neutral wash, the title dims behind a quick strike, then the card is
* swept out while the list closes the gap. Transform, opacity, and one small
* repaint only, so a click still feels immediate.
*/
.am-worktree-completed {
--am-finish-color: var(--icon-success-base, var(--vscode-testing-iconPassed, #73c991));
/* Monochrome on purpose: deletion borrows the list's own greys, never an accent hue. */
--am-finish-line: var(--text-weaker, var(--vscode-disabledForeground));
--am-finish-tint: var(--surface-base-hover, var(--vscode-list-hoverBackground));
--am-finish-hold: 170ms;
--am-finish-collapse: 190ms;
pointer-events: none;
animation: am-worktree-collapse 1000ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
animation: am-worktree-collapse var(--am-finish-collapse) cubic-bezier(0.3, 0, 0.2, 1) var(--am-finish-hold) forwards;
}

.am-worktree-completed .am-worktree-exit-content {
overflow: hidden;
animation: am-worktree-sweep var(--am-finish-collapse) cubic-bezier(0.3, 0, 0.2, 1) var(--am-finish-hold) forwards;
}

.am-worktree-completed .am-worktree-branch {
text-decoration: line-through;
text-decoration-color: var(--am-finish-color);
.am-worktree-completed .am-worktree-item {
animation: am-worktree-finish-tint 340ms ease-out;
}

.am-worktree-completed .am-wt-hover-actions {
position: relative;
opacity: 1;
visibility: visible;
/*
* A leaving card carries no controls and no pending metadata. Skeletons in
* particular would keep pulsing for attention on a row that is already gone.
*/
.am-worktree-completed .am-wt-hover-actions,
.am-worktree-completed .am-worktree-delete-hint,
.am-worktree-completed .am-worktree-stats-skeleton,
.am-worktree-completed .am-pr-badge-skeleton {
display: none;
}

.am-worktree-finish-box {
display: inline-flex;
align-items: center;
justify-content: center;
background: var(--am-finish-color);
width: 12px;
height: 12px;
border: 1px solid var(--am-finish-color);
border-radius: 3px;
color: var(--surface-base, var(--vscode-editor-background));
/* The strike grows from the left as the title dims, so the row reads as removed. */
.am-worktree-completed .am-wt-name {
background-image: linear-gradient(var(--am-finish-line), var(--am-finish-line));
background-repeat: no-repeat;
background-position: 0 calc(50% - 1px);
background-size: 100% 1px;
color: var(--text-weaker);
animation: am-worktree-strike 160ms cubic-bezier(0.22, 0.9, 0.24, 1) 20ms both;
}

.am-worktree-completion-status {
Expand All @@ -776,21 +789,55 @@ html[data-theme="kilo-vscode"]
}

@keyframes am-worktree-collapse {
0%,
60% {
from {
grid-template-rows: 1fr;
opacity: 1;
}
100% {
to {
grid-template-rows: 0fr;
}
}

@keyframes am-worktree-sweep {
from {
transform: translateX(0);
opacity: 1;
}
to {
transform: translateX(10px);
opacity: 0;
}
}

@keyframes am-worktree-finish-tint {
from {
background: color-mix(in srgb, var(--am-finish-tint) 100%, transparent);
}
to {
background: color-mix(in srgb, var(--am-finish-tint) 0%, transparent);
}
}

@keyframes am-worktree-strike {
from {
background-size: 0 1px;
color: var(--text-base);
}
to {
background-size: 100% 1px;
color: var(--text-weaker);
}
}

@media (prefers-reduced-motion: reduce) {
.am-worktree-completed {
animation-duration: 1ms;
animation-delay: 600ms;
animation-delay: 200ms;
}

.am-worktree-completed .am-worktree-exit-content,
.am-worktree-completed .am-worktree-item,
.am-worktree-completed .am-wt-name {
animation: none;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function createWorktreeCompletion(
// Fallback for hidden webviews or interrupted CSS animations.
timers.set(
worktree.id,
setTimeout(() => release(worktree.id), 1400),
setTimeout(() => release(worktree.id), 900),
)
}),
)
Expand Down
Loading