fix(vscode): show line numbers in edit approval diffs

This commit is contained in:
marius-kilocode
2026-06-17 13:06:47 +02:00
parent e9894141c5
commit 14cb3dfd04
4 changed files with 21 additions and 2 deletions
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---
Show line numbers in edit approval diffs, including compact sidebar views.
+1 -1
View File
@@ -223,7 +223,7 @@ export function Diff<T>(props: DiffProps<T>) {
}
const perf = large() ? { ...base, ...largeOptions } : base
if (!mobile()) return perf
if (!mobile() || props.disableLineNumbers === false) return perf
return {
...perf,
@@ -0,0 +1,12 @@
import { expect, test } from "@playwright/test"
const STORY_ID = "composite-webview--permission-dock-edit"
const GLOBALS = "colorScheme:dark;theme:kilo-vscode;vscodeTheme:dark-modern"
test("edit approval diff shows line numbers in compact viewer", async ({ page }) => {
await page.setViewportSize({ width: 420, height: 720 })
await page.goto(`/iframe.html?id=${STORY_ID}&viewMode=story&globals=${GLOBALS}`, { waitUntil: "load" })
const number = page.locator('[data-slot="permission-diff-content"] [data-column-number]').first()
await expect(number).toBeVisible()
})
@@ -76,7 +76,9 @@ export const PermissionDiff: Component<PermissionDiffProps> = (props) => {
when={view()}
fallback={<div data-slot="permission-diff-empty">Diff preview unavailable for this file.</div>}
>
{(v) => <Diff fileDiff={v().fileDiff} diffStyle="unified" hunkSeparators="simple" />}
{(v) => (
<Diff fileDiff={v().fileDiff} diffStyle="unified" hunkSeparators="simple" disableLineNumbers={false} />
)}
</Show>
</div>
</div>