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
5 changes: 5 additions & 0 deletions .changeset/show-edit-approval-line-numbers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Show line numbers in edit approval diffs, including compact sidebar views.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/kilo-ui/src/components/diff.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 12 additions & 0 deletions packages/kilo-vscode/tests/permission-diff.spec.ts
Original file line number Diff line number Diff line change
@@ -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()
})
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Loading