GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(app): support current review data · anomalyco/opencode@e97a955

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages
    • app
      • e2e/regression
        • review-line-comment.spec.ts
        • review-state-persistence.spec.ts
      • src
        • pages/session
          • file-tabs.tsx
          • review-tab.tsx
          • session-side-panel.tsx
          • v2
            • review-diff-kinds.ts
            • review-panel-v2.tsx
        • utils
          • diffs.test.ts
          • diffs.ts
    • session-ui/src
      • components
        • session-diff.ts
        • session-review.tsx
        • session-turn.tsx
      • context
        • data.tsx
      • v2/components
        • session-review-file-preview-v2.tsx
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/app/e2e/regression/review-line-comment.spec.ts‎

Copy file name to clipboardExpand all lines: packages/app/e2e/regression/review-line-comment.spec.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ async function openReview(page: Page) {
143143

144144
await page.goto(`/${base64Encode(directory)}/session/${sessionID}`)
145145
await expectSessionTitle(page, title)
146-
const diffResponse = page.waitForResponse((response) => new URL(response.url()).pathname === "/vcs/diff")
146+
const diffResponse = page.waitForResponse((response) => new URL(response.url()).pathname === "/api/vcs/diff")
147147
await page.getByRole("tab", { name: "Changes" }).click()
148-
expect(await (await diffResponse).json()).toHaveLength(1)
148+
expect((await (await diffResponse).json()).data).toHaveLength(1)
149149

150150
const review = page.locator('[data-component="session-review"]')
151151
await expectAppVisible(review)
Collapse file

‎packages/app/e2e/regression/review-state-persistence.spec.ts‎

Copy file name to clipboardExpand all lines: packages/app/e2e/regression/review-state-persistence.spec.ts
+8-6Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,20 @@ async function setup(page: Page) {
9292
route.fulfill({
9393
status: 200,
9494
contentType: "application/json",
95-
body: JSON.stringify({ branch: "feature", default_branch: "dev" }),
95+
body: JSON.stringify({ location: { directory }, data: { branch: "feature", defaultBranch: "dev" } }),
9696
}),
9797
)
9898
await page.route("**/vcs/diff**", (route) =>
9999
route.fulfill({
100100
status: 200,
101101
contentType: "application/json",
102-
body: JSON.stringify(
103-
new URL(route.request().url()).searchParams.get("mode") === "branch"
104-
? [diff("src/alpha.ts"), diff("src/beta.ts")]
105-
: [diff("src/alpha.ts"), diff("src/gamma.ts")],
106-
),
102+
body: JSON.stringify({
103+
location: { directory },
104+
data:
105+
new URL(route.request().url()).searchParams.get("mode") === "branch"
106+
? [diff("src/alpha.ts"), diff("src/beta.ts")]
107+
: [diff("src/alpha.ts"), diff("src/gamma.ts")],
108+
}),
107109
}),
108110
)
109111
await page.addInitScript(
Collapse file

‎packages/app/src/pages/session/file-tabs.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/pages/session/file-tabs.tsx
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ export function SessionFileView(props: SessionFileViewProps) {
235235
const source = props.diff
236236
if (!source) return
237237
const loaded = loadedDiff()
238-
return normalize(loaded?.source === source && loaded.version === props.diffVersion ? loaded.value : source)
238+
return normalize(loaded && loaded.source === source && loaded.version === props.diffVersion ? loaded.value : source)
239239
})
240240

241241
return (
Collapse file

‎packages/app/src/pages/session/review-tab.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/pages/session/review-tab.tsx
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { createEffect, onCleanup, type JSX } from "solid-js"
22
import { makeEventListener } from "@solid-primitives/event-listener"
33
import type { SnapshotFileDiff, VcsFileDiff } from "@opencode-ai/sdk/v2"
4+
import type { FileDiffInfo } from "@opencode-ai/client/promise"
45
import { SessionReview } from "@opencode-ai/session-ui/session-review"
56
import type {
67
SessionReviewCommentActions,
@@ -14,7 +15,7 @@ import type { LineComment } from "@/context/comments"
1415

1516
export type DiffStyle = "unified" | "split"
1617

17-
type ReviewDiff = SnapshotFileDiff | VcsFileDiff
18+
type ReviewDiff = FileDiffInfo | SnapshotFileDiff | VcsFileDiff
1819

1920
export interface SessionReviewTabProps {
2021
title?: JSX.Element
Collapse file

‎packages/app/src/pages/session/session-side-panel.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/pages/session/session-side-panel.tsx
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { IconButtonV2 } from "@opencode-ai/ui/v2/icon-button-v2"
2424
import { KeybindV2 } from "@opencode-ai/ui/v2/keybind-v2"
2525
import { TooltipV2 } from "@opencode-ai/ui/v2/tooltip-v2"
2626
import type { SnapshotFileDiff, VcsFileDiff } from "@opencode-ai/sdk/v2"
27+
import type { FileDiffInfo } from "@opencode-ai/client/promise"
2728
import { ConstrainDragYAxis, getDraggableId } from "@/utils/solid-dnd"
2829
import { useDialog } from "@opencode-ai/ui/context/dialog"
2930

@@ -56,15 +57,16 @@ import { setSessionHandoff } from "@/pages/session/handoff"
5657
import { useSessionLayout } from "@/pages/session/session-layout"
5758
import { SessionFileBrowserTab, type SessionFileBrowserState } from "@/pages/session/v2/session-file-browser-tab"
5859

59-
type RenderDiff = (SnapshotFileDiff & { file: string }) | VcsFileDiff
60+
type ReviewDiff = FileDiffInfo | SnapshotFileDiff | VcsFileDiff
61+
type RenderDiff = FileDiffInfo | (SnapshotFileDiff & { file: string }) | VcsFileDiff
6062

61-
function renderDiff(value: SnapshotFileDiff | VcsFileDiff): value is RenderDiff {
63+
function renderDiff(value: ReviewDiff): value is RenderDiff {
6264
return typeof value.file === "string"
6365
}
6466

6567
export function SessionSidePanel(props: {
6668
canReview: () => boolean
67-
diffs: () => (SnapshotFileDiff | VcsFileDiff)[]
69+
diffs: () => ReviewDiff[]
6870
diffsReady: () => boolean
6971
empty: () => string
7072
hasReview: () => boolean
Collapse file

‎packages/app/src/pages/session/v2/review-diff-kinds.ts‎

Copy file name to clipboardExpand all lines: packages/app/src/pages/session/v2/review-diff-kinds.ts
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import type { SnapshotFileDiff, VcsFileDiff } from "@opencode-ai/sdk/v2"
2+
import type { FileDiffInfo } from "@opencode-ai/client/promise"
23
import type { Kind } from "@/components/file-tree-v2"
34
import { normalizeFileTreeV2Path } from "@/components/file-tree-v2-model"
45

5-
export type RenderDiff = (SnapshotFileDiff & { file: string }) | VcsFileDiff
6+
export type RenderDiff = FileDiffInfo | (SnapshotFileDiff & { file: string }) | VcsFileDiff
67

78
export function normalizePath(p: string) {
89
return normalizeFileTreeV2Path(p)
910
}
1011

11-
export function filterRenderableDiff(value: SnapshotFileDiff | VcsFileDiff): value is RenderDiff {
12+
export function filterRenderableDiff(value: FileDiffInfo | SnapshotFileDiff | VcsFileDiff): value is RenderDiff {
1213
return typeof value.file === "string"
1314
}
1415

Collapse file

‎packages/app/src/pages/session/v2/review-panel-v2.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/pages/session/v2/review-panel-v2.tsx
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { createMemo, createResource, createSignal, Show, type JSX } from "solid-js"
22
import type { SnapshotFileDiff, VcsFileDiff } from "@opencode-ai/sdk/v2"
3+
import type { FileDiffInfo } from "@opencode-ai/client/promise"
34
import {
45
SESSION_REVIEW_V2_SIDEBAR_WIDTH_MAX,
56
SESSION_REVIEW_V2_SIDEBAR_WIDTH_MIN,
@@ -30,7 +31,7 @@ import {
3031
import type { ReviewPanelV2State } from "@/pages/session/v2/review-panel-v2-state"
3132
import { applyFileListKeyDown, SessionFileListV2 } from "@/pages/session/v2/session-file-list-v2"
3233

33-
type ReviewDiff = SnapshotFileDiff | VcsFileDiff
34+
type ReviewDiff = FileDiffInfo | SnapshotFileDiff | VcsFileDiff
3435

3536
export type ReviewPanelV2Props = {
3637
title?: JSX.Element
Collapse file

‎packages/app/src/utils/diffs.test.ts‎

Copy file name to clipboardExpand all lines: packages/app/src/utils/diffs.test.ts
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { describe, expect, test } from "bun:test"
22
import type { SnapshotFileDiff } from "@opencode-ai/sdk/v2"
3+
import type { FileDiffInfo } from "@opencode-ai/client/promise"
34
import type { Message } from "@opencode-ai/sdk/v2/client"
45
import { diffs, message } from "./diffs"
56

@@ -9,7 +10,7 @@ const item = {
910
additions: 1,
1011
deletions: 1,
1112
status: "modified",
12-
} satisfies SnapshotFileDiff
13+
} satisfies FileDiffInfo & SnapshotFileDiff
1314

1415
describe("diffs", () => {
1516
test("keeps valid arrays", () => {
Collapse file

‎packages/app/src/utils/diffs.ts‎

Copy file name to clipboardExpand all lines: packages/app/src/utils/diffs.ts
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import type { SnapshotFileDiff, VcsFileDiff } from "@opencode-ai/sdk/v2"
2+
import type { FileDiffInfo } from "@opencode-ai/client/promise"
23
import type { Message } from "@opencode-ai/sdk/v2/client"
34

4-
type Diff = SnapshotFileDiff | VcsFileDiff
5+
type Diff = FileDiffInfo | SnapshotFileDiff | VcsFileDiff
56

67
function diff(value: unknown): value is Diff {
78
if (!value || typeof value !== "object" || Array.isArray(value)) return false
Collapse file

‎packages/session-ui/src/components/session-diff.ts‎

Copy file name to clipboardExpand all lines: packages/session-ui/src/components/session-diff.ts
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { parseDiffFromFile, parsePatchFiles, type FileDiffMetadata } from "@pierre/diffs"
22
import { parsePatch } from "diff"
33
import type { SnapshotFileDiff, VcsFileDiff } from "@opencode-ai/sdk/v2"
4+
import type { FileDiffInfo } from "@opencode-ai/client/promise"
45

56
type LegacyDiff = {
67
file: string
@@ -13,7 +14,7 @@ type LegacyDiff = {
1314
}
1415

1516
type SnapshotDiff = SnapshotFileDiff & { file: string }
16-
type ReviewDiff = SnapshotDiff | VcsFileDiff | LegacyDiff
17+
type ReviewDiff = SnapshotDiff | FileDiffInfo | VcsFileDiff | LegacyDiff
1718
export type DiffSource = Pick<LegacyDiff, "file" | "patch" | "before" | "after">
1819

1920
export type ViewDiff = {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.