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): make session timelines much faster AND without flicker or … · moonug/opencode@3b811bd

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • bun.lock
  • bunfig.toml
  • package.json
  • packages
    • app
      • e2e
        • regression
          • session-timeline-collapse-state.spec.ts
          • session-timeline-context-resize.spec.ts
        • smoke
          • session-timeline.spec.ts
        • utils
          • mock-server.ts
      • package.json
      • src
        • context
          • global-sync
            • event-reducer.test.ts
            • event-reducer.ts
          • server-sdk.test.ts
          • server-sdk.tsx
        • pages
          • layout.tsx
          • session.tsx
          • session/timeline
            • measure.test.ts
            • measure.ts
            • message-timeline.tsx
            • model.test.ts
            • model.ts
            • projection.ts
            • rows.ts
      • test-browser
        • solid-virtual.test.ts
    • opencode/test/share
      • share-next.test.ts
    • ui
      • package.json
      • src
        • components
          • file.css
          • file.tsx
          • markdown-code-state.test.ts
          • markdown-code-state.ts
          • markdown-shiki.worker.ts
          • markdown-stream.test.ts
          • markdown-stream.ts
          • markdown-worker-protocol.test.ts
          • markdown-worker-protocol.ts
          • markdown-worker-queue.test.ts
          • markdown-worker-queue.ts
          • markdown-worker-transport.test.ts
          • markdown-worker-transport.ts
          • markdown-worker.ts
          • markdown.css
          • markdown.tsx
          • message-part.tsx
          • scroll-view.test.ts
          • scroll-view.tsx
        • context
          • marked.tsx
        • pierre
          • index.ts
          • virtualizer.ts
  • patches
    • @tanstack%[email protected]
    • @tanstack%[email protected]
    • [email protected]

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bun.lock‎

Copy file name to clipboardExpand all lines: bun.lock
+72-28Lines changed: 72 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎bunfig.toml‎

Copy file name to clipboardExpand all lines: bunfig.toml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
exact = true
33
# Only install newly resolved package versions published at least 3 days ago.
44
minimumReleaseAge = 259200
5-
minimumReleaseAgeExcludes = ["@ai-sdk/amazon-bedrock", "@ai-sdk/anthropic", "@opentui/core", "@opentui/core-darwin-arm64", "@opentui/core-darwin-x64", "@opentui/core-linux-arm64", "@opentui/core-linux-arm64-musl", "@opentui/core-linux-x64", "@opentui/core-linux-x64-musl", "@opentui/core-win32-arm64", "@opentui/core-win32-x64", "@opentui/keymap", "@opentui/solid", "opentui-spinner", "gitlab-ai-provider", "opencode-gitlab-auth", "@ff-labs/fff-node", "@ff-labs/fff-bun", "@ff-labs/fff-bin-darwin-arm64", "@ff-labs/fff-bin-darwin-x64", "@ff-labs/fff-bin-linux-arm64-gnu", "@ff-labs/fff-bin-linux-arm64-musl", "@ff-labs/fff-bin-linux-x64-gnu", "@ff-labs/fff-bin-linux-x64-musl", "@ff-labs/fff-bin-win32-arm64", "@ff-labs/fff-bin-win32-x64", "app-builder-lib", "dmg-builder", "electron-builder", "electron-publish"]
5+
minimumReleaseAgeExcludes = ["@ai-sdk/amazon-bedrock", "@ai-sdk/anthropic", "@opentui/core", "@opentui/core-darwin-arm64", "@opentui/core-darwin-x64", "@opentui/core-linux-arm64", "@opentui/core-linux-arm64-musl", "@opentui/core-linux-x64", "@opentui/core-linux-x64-musl", "@opentui/core-win32-arm64", "@opentui/core-win32-x64", "@opentui/keymap", "@opentui/solid", "opentui-spinner", "gitlab-ai-provider", "opencode-gitlab-auth", "@ff-labs/fff-node", "@ff-labs/fff-bun", "@ff-labs/fff-bin-darwin-arm64", "@ff-labs/fff-bin-darwin-x64", "@ff-labs/fff-bin-linux-arm64-gnu", "@ff-labs/fff-bin-linux-arm64-musl", "@ff-labs/fff-bin-linux-x64-gnu", "@ff-labs/fff-bin-linux-x64-musl", "@ff-labs/fff-bin-win32-arm64", "@ff-labs/fff-bin-win32-x64", "@pierre/diffs", "@pierre/theming", "app-builder-lib", "dmg-builder", "electron-builder", "electron-publish"]
66

77
[test]
88
root = "./do-not-run-tests-from-root"
Collapse file

‎package.json‎

Copy file name to clipboardExpand all lines: package.json
+7-5Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
"@opentui/core": "0.3.4",
4343
"@opentui/keymap": "0.3.4",
4444
"@opentui/solid": "0.3.4",
45+
"@tanstack/solid-virtual": "3.13.28",
46+
"@shikijs/stream": "4.2.0",
4547
"ulid": "3.0.1",
4648
"@kobalte/core": "0.13.11",
4749
"@types/luxon": "3.7.1",
@@ -51,7 +53,7 @@
5153
"@tsconfig/bun": "1.0.9",
5254
"@cloudflare/workers-types": "4.20251008.0",
5355
"@openauthjs/openauth": "0.0.0-20250322224806",
54-
"@pierre/diffs": "1.1.0-beta.18",
56+
"@pierre/diffs": "1.2.10",
5557
"opentui-spinner": "0.0.7",
5658
"@solid-primitives/storage": "4.3.3",
5759
"@tailwindcss/vite": "4.1.11",
@@ -76,10 +78,9 @@
7678
"zod": "4.1.8",
7779
"remeda": "2.26.0",
7880
"sst": "4.13.1",
79-
"shiki": "3.20.0",
81+
"shiki": "4.2.0",
8082
"solid-list": "0.3.0",
8183
"tailwindcss": "4.1.11",
82-
"virtua": "0.49.1",
8384
"vite": "7.1.4",
8485
"@solidjs/meta": "0.29.4",
8586
"@solidjs/router": "0.15.4",
@@ -145,12 +146,13 @@
145146
"@silvia-odwyer/[email protected]": "patches/@silvia-odwyer%[email protected]",
146147
"@standard-community/[email protected]": "patches/@standard-community%[email protected]",
147148
"[email protected]": "patches/[email protected]",
148-
"[email protected]": "patches/[email protected]",
149149
"@ai-sdk/[email protected]": "patches/@ai-sdk%[email protected]",
150150
"[email protected]": "patches/[email protected]",
151151
"[email protected]": "patches/[email protected]",
152152
"@ai-sdk/[email protected]": "patches/@ai-sdk%[email protected]",
153+
"@tanstack/[email protected]": "patches/@tanstack%[email protected]",
153154
"@pierre/[email protected]": "patches/@pierre%[email protected]",
154-
"@modelcontextprotocol/[email protected]": "patches/@modelcontextprotocol%[email protected]"
155+
"@modelcontextprotocol/[email protected]": "patches/@modelcontextprotocol%[email protected]",
156+
"@tanstack/[email protected]": "patches/@tanstack%[email protected]"
155157
}
156158
}
Collapse file

‎packages/app/e2e/regression/session-timeline-collapse-state.spec.ts‎

Copy file name to clipboardExpand all lines: packages/app/e2e/regression/session-timeline-collapse-state.spec.ts
+96-6Lines changed: 96 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ test.describe("regression: session timeline local row state", () => {
147147

148148
const wrapper = page.locator(`[data-timeline-part-id="${editPartID}"]`).first()
149149
await expectAppVisible(wrapper)
150-
await expectAppVisible(wrapper.locator('[data-component="file"][data-mode="diff"]').first())
150+
const file = wrapper.locator('[data-component="file"][data-mode="diff"]').first()
151+
await expectAppVisible(file)
151152
await markDiffProbe(page)
152153

153154
events.push({
@@ -159,7 +160,15 @@ test.describe("regression: session timeline local row state", () => {
159160
})
160161

161162
await expect(page.locator(`[data-timeline-part-id="${textPartID}"]`).first()).toBeVisible({ timeout: 10_000 })
162-
expect(await readDiffProbe(page)).toEqual({ fileMarker: "before", shadowRoots: 0, toolMarker: "before" })
163+
const siblingProbe = await readDiffProbe(page)
164+
expect(siblingProbe).toEqual({
165+
fileMarker: "before",
166+
frameMarker: "before",
167+
rowKey: `assistant-part:${userMessageID}:part:${assistantMessageID}:${editPartID}`,
168+
rowMarker: "before",
169+
shadowRoots: 0,
170+
toolMarker: "before",
171+
})
163172

164173
await markDiffProbe(page)
165174
events.push({
@@ -173,7 +182,72 @@ test.describe("regression: session timeline local row state", () => {
173182
await expect(wrapper.locator('[data-slot="diff-changes-additions"]').filter({ hasText: "+2" }).first()).toBeVisible(
174183
{ timeout: 10_000 },
175184
)
176-
expect(await readDiffProbe(page)).toEqual({ fileMarker: "before", shadowRoots: 0, toolMarker: "before" })
185+
expect(await readDiffProbe(page)).toEqual({
186+
fileMarker: "before",
187+
frameMarker: "before",
188+
rowKey: `assistant-part:${userMessageID}:part:${assistantMessageID}:${editPartID}`,
189+
rowMarker: "before",
190+
shadowRoots: 0,
191+
toolMarker: "before",
192+
})
193+
})
194+
195+
test("keeps a sticky edit header aligned with a multi-hunk diff", async ({ page }) => {
196+
const events: EventPayload[] = []
197+
const lines = Array.from({ length: 1_000 }, (_, index) => `export const value${index} = ${index}\n`).join("")
198+
const after = [100, 300, 500, 700, 900].reduce(
199+
(result, index) => result.replace(`export const value${index} = ${index}`, `export const value${index} = compute(${index})`),
200+
lines,
201+
)
202+
const part = {
203+
...editPart,
204+
state: {
205+
...editPart.state,
206+
metadata: {
207+
...editPart.state.metadata,
208+
filediff: {
209+
file: "src/regression.ts",
210+
additions: 1,
211+
deletions: 1,
212+
before: lines,
213+
after,
214+
},
215+
},
216+
},
217+
}
218+
await mockServer(page, events, [userMessage, { ...assistantMessage, parts: [part] }])
219+
await configurePage(page)
220+
221+
await page.goto(`/${base64Encode(directory)}/session/${sessionID}`)
222+
await expectSessionTitle(page, title)
223+
224+
const wrapper = page.locator(`[data-timeline-part-id="${editPartID}"]`).first()
225+
const trigger = wrapper.locator('[data-slot="collapsible-trigger"]').first()
226+
const diff = wrapper.locator('[data-component="edit-content"]').first()
227+
await expectAppVisible(diff)
228+
await expect.poll(() => wrapper.evaluate((element) => element.getBoundingClientRect().height)).toBeGreaterThan(500)
229+
const samples = await wrapper.evaluate(async (element) => {
230+
const root = element.closest<HTMLElement>(".scroll-view__viewport")!
231+
element.scrollIntoView({ block: "start" })
232+
const result = []
233+
for (const offset of [0, 120, 240, 360, 480]) {
234+
root.scrollBy(0, offset - (result.at(-1)?.offset ?? 0))
235+
await new Promise(requestAnimationFrame)
236+
const trigger = element.querySelector<HTMLElement>('[data-slot="collapsible-trigger"]')!
237+
const diff = element.querySelector<HTMLElement>('[data-component="edit-content"]')!
238+
result.push({
239+
offset,
240+
trigger: trigger.getBoundingClientRect().y,
241+
diff: diff.getBoundingClientRect().y,
242+
bottom: element.getBoundingClientRect().bottom,
243+
})
244+
}
245+
return result
246+
})
247+
248+
expect(samples[0]!.trigger).toBeLessThan(samples[0]!.diff)
249+
expect(samples.every((sample) => Math.abs(sample.trigger - samples[0]!.trigger) <= 1)).toBe(true)
250+
expect(samples.every((sample) => sample.trigger < sample.bottom)).toBe(true)
177251
})
178252
})
179253

@@ -247,10 +321,16 @@ async function markDiffProbe(page: Page) {
247321
.evaluate((element) => {
248322
const tool = element as HTMLElement
249323
const file = tool.querySelector<HTMLElement>('[data-component="file"][data-mode="diff"]')
324+
const row = tool.closest<HTMLElement>("[data-timeline-key]")
325+
const frame = tool.closest<HTMLElement>("[data-timeline-row]")
250326
if (!file) throw new Error("missing edit diff file")
327+
if (!row) throw new Error("missing virtual timeline row")
328+
if (!frame) throw new Error("missing timeline row frame")
251329

252330
tool.dataset.timelineProbe = "before"
253331
file.dataset.timelineProbe = "before"
332+
row.dataset.timelineProbe = "before"
333+
frame.dataset.timelineProbe = "before"
254334
window.__timelineDiffProbe.reset()
255335
})
256336
}
@@ -262,10 +342,15 @@ async function readDiffProbe(page: Page) {
262342
.evaluate((element) => {
263343
const tool = element as HTMLElement
264344
const file = tool.querySelector<HTMLElement>('[data-component="file"][data-mode="diff"]')
345+
const row = tool.closest<HTMLElement>("[data-timeline-key]")
346+
const frame = tool.closest<HTMLElement>("[data-timeline-row]")
265347
return {
266348
fileMarker: file?.dataset.timelineProbe,
267349
shadowRoots: window.__timelineDiffProbe.shadowRoots(),
268350
toolMarker: tool.dataset.timelineProbe,
351+
rowMarker: row?.dataset.timelineProbe,
352+
rowKey: row?.dataset.timelineKey,
353+
frameMarker: frame?.dataset.timelineProbe,
269354
}
270355
})
271356
}
@@ -300,14 +385,19 @@ function readExpanded(element: Element) {
300385
return !!content && content.getBoundingClientRect().height > 0
301386
}
302387

303-
async function mockServer(page: Page, events: EventPayload[]) {
388+
async function mockServer(
389+
page: Page,
390+
events: EventPayload[],
391+
messages = [userMessage, assistantMessage],
392+
) {
304393
await mockOpenCodeServer(page, {
305394
directory,
306395
project: project(),
307396
provider: provider(),
308397
sessions: [session()],
309-
pageMessages: () => ({ items: [userMessage, assistantMessage] }),
310-
events: () => events.splice(0),
398+
pageMessages: () => ({ items: messages }),
399+
events: () => events.splice(0, 1),
400+
eventRetry: 16,
311401
})
312402
}
313403

Collapse file

‎packages/app/e2e/regression/session-timeline-context-resize.spec.ts‎

Copy file name to clipboardExpand all lines: packages/app/e2e/regression/session-timeline-context-resize.spec.ts
+9-9Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ test.describe("regression: session timeline context group resize", () => {
3232
const samples = await sampleExpansion(page)
3333
const visibleOverlap = samples.filter((sample) => sample.frame >= 1 && sample.overlap > 0.5)
3434

35-
console.log("context resize samples", JSON.stringify(samples, null, 2))
36-
3735
expect(samples[0]?.overlap).toBe(0)
3836
expect(visibleOverlap).toEqual([])
3937
expect(samples.at(-1)?.expanded).toBe("true")
@@ -115,13 +113,15 @@ async function sampleExpansion(page: Page) {
115113

116114
let frame = 1
117115
const tick = () => {
118-
capture(frame, "raf")
119-
frame += 1
120-
if (frame > 8) {
121-
resolve(samples)
122-
return
123-
}
124-
requestAnimationFrame(tick)
116+
setTimeout(() => {
117+
capture(frame, "painted")
118+
frame += 1
119+
if (frame > 8) {
120+
resolve(samples)
121+
return
122+
}
123+
requestAnimationFrame(tick)
124+
}, 0)
125125
}
126126
requestAnimationFrame(tick)
127127
}),

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.