mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
feat(agent-manager): add expand/collapse all button to inline diff panel (#8562)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user