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 — fix(tui): keep server-scoped pins out of the local scope check · anomalyco/opencode@99fef80

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/tui
    • src/component
      • dialog-session-list.tsx
    • test/cli/tui
      • dialog-session-list.test.tsx
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/tui/src/component/dialog-session-list.tsx‎

Copy file name to clipboardExpand all lines: packages/tui/src/component/dialog-session-list.tsx
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ export function DialogSessionList() {
149149
const query = filter().trim()
150150
const current = data.location.info(pickerLocation())
151151
const pinned = local.session.pinned().flatMap((sessionID) => {
152-
const session = sessionMap.get(sessionID) ?? (query ? undefined : data.session.get(sessionID))
152+
const fetched = sessionMap.get(sessionID)
153+
if (fetched) return [fetched]
154+
if (query) return []
155+
const session = data.session.get(sessionID)
153156
if (!session || session.parentID) return []
154157
if (
155158
!allProjects() &&
Collapse file

‎packages/tui/test/cli/tui/dialog-session-list.test.tsx‎

Copy file name to clipboardExpand all lines: packages/tui/test/cli/tui/dialog-session-list.test.tsx
+8-4Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ test("scopes sessions to the active session location", async () => {
132132

133133
test("shows pinned sessions outside the fetched page when tabs are enabled", async () => {
134134
const events = createEventStream()
135-
const session = (id: string, title: string, updated: number) => ({
135+
const session = (id: string, title: string, updated: number, directory = process.cwd()) => ({
136136
id,
137137
projectID: "proj_test",
138138
cost: 0,
139139
tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } },
140140
time: { created: 1, updated },
141141
title,
142-
location: { directory: process.cwd() },
142+
location: { directory },
143143
})
144144
const calls = createFetch((url) => {
145145
if (url.pathname === "/api/location") {
@@ -150,10 +150,13 @@ test("shows pinned sessions outside the fetched page when tabs are enabled", asy
150150
if (url.pathname !== "/api/session") return undefined
151151
const parentID = url.searchParams.get("parentID")
152152
if (parentID && parentID !== "null") return json({ data: [], cursor: {} })
153-
return json({ data: [session("ses_recent", "Recent session", 2)], cursor: {} })
153+
return json({
154+
data: [session("ses_recent", "Recent session", 2, "/tmp/opencode/worktree-b")],
155+
cursor: {},
156+
})
154157
}, events)
155158
const temporary = await tmpdir()
156-
await Bun.write(path.join(temporary.path, "session.json"), JSON.stringify({ pinned: ["ses_old"] }))
159+
await Bun.write(path.join(temporary.path, "session.json"), JSON.stringify({ pinned: ["ses_old", "ses_recent"] }))
157160
let storage!: ReturnType<typeof useStorage>
158161

159162
function Probe() {
@@ -208,6 +211,7 @@ test("shows pinned sessions outside the fetched page when tabs are enabled", asy
208211
(value) => value.includes("Old pinned session") && value.includes("Recent session"),
209212
)
210213
expect(frame).toContain("Pinned")
214+
expect(frame).not.toContain("1970")
211215
} finally {
212216
app.renderer.destroy()
213217
await storage.flush()

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.