feat(agent-manager): add expand/collapse all button to inline diff panel (#8562)

This commit is contained in:
Marius
2026-04-08 10:49:23 +02:00
committed by GitHub
parent 1922952c59
commit 49cabd99c3
@@ -307,6 +307,11 @@ export const DiffPanel: Component<DiffPanelProps> = (props) => {
sendAllToChat()
}
const handleExpandAll = () => {
const allOpen = open().length === props.diffs.length
setOpen(allOpen ? [] : props.diffs.map((d) => d.file))
}
const totals = createMemo(() => ({
files: props.diffs.length,
additions: props.diffs.reduce((sum, diff) => sum + diff.additions, 0),
@@ -354,6 +359,28 @@ export const DiffPanel: Component<DiffPanelProps> = (props) => {
</Show>
</div>
<div class="am-diff-header-actions">
<Show when={props.diffs.length > 0}>
<Tooltip
value={
open().length === props.diffs.length
? t("ui.sessionReview.collapseAll")
: t("ui.sessionReview.expandAll")
}
placement="bottom"
>
<IconButton
icon="chevron-grabber-vertical"
size="small"
variant="ghost"
label={
open().length === props.diffs.length
? t("ui.sessionReview.collapseAll")
: t("ui.sessionReview.expandAll")
}
onClick={handleExpandAll}
/>
</Tooltip>
</Show>
<Show when={props.onExpand}>
<Tooltip value={t("command.review.toggle")} placement="bottom">
<IconButton