mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-29 03:32:08 +08:00
fix(vscode): show line numbers in edit approval diffs
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"kilo-code": patch
|
||||
---
|
||||
|
||||
Show line numbers in edit approval diffs, including compact sidebar views.
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user