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 — Merge branch 'dev' into db-lock-retry-v2 · anomalyco/opencode@aae3d3c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages
    • app
      • e2e/regression
        • command-palette.spec.ts
      • src/shell/commands
        • dialog.tsx
    • client/src
      • effect
        • api
          • api.ts
        • generated
          • client.ts
      • promise/generated
        • client.ts
        • types.ts
      • solid
        • data.ts
    • console/app/src/component
      • header.tsx
    • core
      • schema.json
      • src
        • database
          • migration.gen.ts
          • migration
            • 20261010180456_project_time_archived.ts
          • schema.gen.ts
        • plugin/provider
          • github-copilot.ts
        • project.ts
        • project
          • sql.ts
      • test
        • effect/layer-node
          • node-build.test.ts
        • lib
          • project.ts
        • location.test.ts
        • project.test.ts
    • protocol
      • openapi.json
      • src/groups
        • project.ts
    • schema/src
      • project.ts
    • server/src
      • handlers
        • project.ts
      • routes.ts
    • ui/src/context
      • marked-base.tsx
      • marked-parser.test.ts
  • services/www
    • openapi.json
    • public
      • openapi.json
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/app/e2e/regression/command-palette.spec.ts‎

Copy file name to clipboardExpand all lines: packages/app/e2e/regression/command-palette.spec.ts
+46-2Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,52 @@ test("appends search results without resetting the selected command", async ({ p
8585
await expect(dialog.getByRole("option", { name: "Copy Project ID", exact: true })).toHaveCount(0)
8686
})
8787

88-
test("keeps the automatically selected file when session results arrive later", async ({ page }) => {
89-
const warnings = captureConsoleWarnings(page)
88+
test("selects the first session when it arrives above automatically selected files", async ({ page }) => {
9089
const { dialog, input } = await openCommandPalette(page)
9190
const sessions = Promise.withResolvers<void>()
9291
await page.route("**/api/fs/find?*", (route) =>
9392
route.fulfill({ json: { data: [{ path: "README.md", type: "file" }] } }),
9493
)
94+
await page.route("**/api/session?*", async (route) => {
95+
await sessions.promise
96+
await route.fulfill({
97+
json: {
98+
data: Array.from({ length: 18 }, (_, index) => ({
99+
...paletteSession,
100+
id: index === 0 ? paletteSession.id : `ses_palette_readme_${index}`,
101+
location: { directory: paletteSession.directory },
102+
title: `README work ${index + 1}`,
103+
})),
104+
},
105+
})
106+
})
107+
await input.fill("README")
108+
await expect(dialog.getByRole("option", { name: "/ README.md", exact: true })).toHaveAttribute(
109+
"aria-selected",
110+
"true",
111+
)
112+
sessions.resolve()
113+
const first = dialog.getByRole("option", { name: /README work 1 command-palette/ })
114+
const second = dialog.getByRole("option", { name: /README work 2 command-palette/ })
115+
await expect(first).toHaveAttribute("aria-selected", "true")
116+
await expect(first).toBeInViewport()
117+
await input.press("ArrowDown")
118+
await expect(second).toHaveAttribute("aria-selected", "true")
119+
await expect(second).toBeInViewport()
120+
await input.press("ArrowUp")
121+
await expect(first).toHaveAttribute("aria-selected", "true")
122+
await input.press("Enter")
123+
await expect(dialog).toHaveCount(0)
124+
await expect(page.getByRole("heading", { name: paletteSession.title, exact: true })).toBeVisible()
125+
})
126+
127+
test("keeps a keyboard-selected file when session results arrive later", async ({ page }) => {
128+
const warnings = captureConsoleWarnings(page)
129+
const { dialog, input } = await openCommandPalette(page)
130+
const sessions = Promise.withResolvers<void>()
131+
await page.route("**/api/fs/find?*", (route) =>
132+
route.fulfill({ json: { data: [{ path: "README.txt", type: "file" }, { path: "README.md", type: "file" }] } }),
133+
)
95134
await page.route("**/api/session?*", async (route) => {
96135
await sessions.promise
97136
await route.fulfill({
@@ -102,6 +141,11 @@ test("keeps the automatically selected file when session results arrive later",
102141
})
103142
await input.fill("README")
104143
const file = dialog.getByRole("option", { name: "/ README.md", exact: true })
144+
await expect(dialog.getByRole("option", { name: "/ README.txt", exact: true })).toHaveAttribute(
145+
"aria-selected",
146+
"true",
147+
)
148+
await input.press("ArrowDown")
105149
await expect(file).toHaveAttribute("aria-selected", "true")
106150
sessions.resolve()
107151
await expect(dialog.getByRole("option", { name: /README work/ })).toBeVisible()
Collapse file

‎packages/app/src/shell/commands/dialog.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/shell/commands/dialog.tsx
+16-13Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Dialog, DialogBody } from "@opencode/ui/dialog"
55
import { Icon } from "@opencode/ui/icon"
66
import { Keybind } from "@opencode/ui/keybind"
77
import { TextInput } from "@opencode/ui/text-input"
8-
import { createEffect, createMemo, For, Match, Show, Switch } from "solid-js"
8+
import { createEffect, createMemo, For, Match, onCleanup, Show, Switch } from "solid-js"
99
import { createStore } from "solid-js/store"
1010
import { formatKeybindParts } from "@/shell/commands/command"
1111
import { useLanguage } from "@/runtime/i18n/language"
@@ -70,13 +70,13 @@ export function CommandPaletteView(props: {
7070
}) {
7171
const language = useLanguage()
7272
const tabs = useTabs()
73-
const [store, setStore] = createStore({ query: "", active: undefined as string | undefined })
73+
const [store, setStore] = createStore<{ query: string; active?: string }>({ query: "" })
7474

7575
const search = createCommandPaletteSearch({ query: () => store.query, items: props.items, sources: props.sources })
7676
const visibleEntries = search.items
7777
const groupedEntries = createMemo(() => groups(visibleEntries()))
7878

79-
// Keep keyboard selection stable when another search source adds results.
79+
// Follow the first result until the user explicitly chooses a row.
8080
const activeEntry = createMemo(
8181
() => visibleEntries().find((entry) => entry.id === store.active) ?? visibleEntries()[0],
8282
)
@@ -85,28 +85,31 @@ export function CommandPaletteView(props: {
8585
() => new Set(tabs.store.flatMap((tab) => (tab.type === "session" ? [`${tab.server}\0${tab.sessionId}`] : []))),
8686
)
8787

88-
createEffect(() => {
89-
// Pin automatic selection too: a later source can insert rows before it.
90-
const id = activeEntry()?.id
91-
92-
if (store.active !== id) setStore("active", id)
93-
})
94-
9588
createEffect(() => {
9689
props.highlight(activeEntry())
9790
})
9891

9992
let resultsRef: HTMLDivElement | undefined
10093

94+
createEffect(() => {
95+
// Incoming results can move an explicitly selected row below the viewport.
96+
visibleEntries()
97+
98+
if (!activeEntry()) return
99+
100+
const frame = requestAnimationFrame(() => {
101+
resultsRef?.querySelector("[data-active]")?.scrollIntoView({ block: "nearest" })
102+
})
103+
104+
onCleanup(() => cancelAnimationFrame(frame))
105+
})
106+
101107
const move = (delta: -1 | 1) => {
102108
const count = visibleEntries().length
103109

104110
if (count === 0) return
105111
const index = visibleEntries().findIndex((entry) => entry.id === activeEntry()?.id)
106112
setStore("active", visibleEntries()[(index + delta + count) % count].id)
107-
requestAnimationFrame(() => {
108-
resultsRef?.querySelector("[data-active]")?.scrollIntoView({ block: "nearest" })
109-
})
110113
}
111114

112115
const handleKeyDown = (event: KeyboardEvent) => {
Collapse file

‎packages/client/src/effect/api/api.ts‎

Copy file name to clipboardExpand all lines: packages/client/src/effect/api/api.ts
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1663,8 +1663,9 @@ export interface CredentialApi<E = never> {
16631663
readonly remove: CredentialRemoveOperation<E>
16641664
}
16651665

1666+
export type ProjectListInput = { readonly archived?: boolean | undefined }
16661667
export type ProjectListOutput = ReadonlyArray<Project.Info>
1667-
export type ProjectListOperation<E = never> = () => Effect.Effect<ProjectListOutput, E>
1668+
export type ProjectListOperation<E = never> = (input?: ProjectListInput) => Effect.Effect<ProjectListOutput, E>
16681669

16691670
export type ProjectUpdateInput = {
16701671
readonly projectID: Project.ID
Collapse file

‎packages/client/src/effect/generated/client.ts‎

Copy file name to clipboardExpand all lines: packages/client/src/effect/generated/client.ts
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ import type {
164164
CredentialActivateOutput,
165165
CredentialRemoveInput,
166166
CredentialRemoveOutput,
167+
ProjectListInput,
167168
ProjectListOutput,
168169
ProjectUpdateInput,
169170
ProjectUpdateOutput,
@@ -1102,8 +1103,10 @@ const adaptGroupCredential = (raw: RawClient["server.credential"]) => ({
11021103
remove: EndpointCredentialRemove(raw),
11031104
})
11041105

1105-
const EndpointProjectList = (raw: RawClient["server.project"]) => () =>
1106-
preserveEffect<ProjectListOutput>()(raw["project.list"]({}).pipe(Effect.mapError(mapClientError)))
1106+
const EndpointProjectList = (raw: RawClient["server.project"]) => (input?: ProjectListInput) =>
1107+
preserveEffect<ProjectListOutput>()(
1108+
raw["project.list"]({ query: { archived: input?.["archived"] } }).pipe(Effect.mapError(mapClientError)),
1109+
)
11071110

11081111
const EndpointProjectUpdate = (raw: RawClient["server.project"]) => (input: ProjectUpdateInput) =>
11091112
preserveEffect<ProjectUpdateOutput>()(
Collapse file

‎packages/client/src/promise/generated/client.ts‎

Copy file name to clipboardExpand all lines: packages/client/src/promise/generated/client.ts
+10-2Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ import type {
158158
CredentialActivateOutput,
159159
CredentialRemoveInput,
160160
CredentialRemoveOutput,
161+
ProjectListInput,
161162
ProjectListOutput,
162163
ProjectUpdateInput,
163164
ProjectUpdateOutput,
@@ -1473,9 +1474,16 @@ export function make(options: ClientOptions) {
14731474
),
14741475
},
14751476
project: {
1476-
list: (requestOptions?: RequestOptions) =>
1477+
list: (input?: ProjectListInput, requestOptions?: RequestOptions) =>
14771478
request<ProjectListOutput>(
1478-
{ method: "GET", path: `/api/project`, successStatus: 200, declaredStatuses: [400, 401, 404], empty: false },
1479+
{
1480+
method: "GET",
1481+
path: `/api/project`,
1482+
query: { archived: input?.["archived"] },
1483+
successStatus: 200,
1484+
declaredStatuses: [400, 401, 404],
1485+
empty: false,
1486+
},
14791487
requestOptions,
14801488
),
14811489
update: (input: ProjectUpdateInput, requestOptions?: RequestOptions) =>
Collapse file

‎packages/client/src/promise/generated/types.ts‎

Copy file name to clipboardExpand all lines: packages/client/src/promise/generated/types.ts
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export type ProjectIcon = { url?: string; override?: string; color?: string }
234234

235235
export type ProjectCommands = { start?: string }
236236

237-
export type ProjectTime = { created: number; updated: number; active: number }
237+
export type ProjectTime = { created: number; updated: number; active: number; archived?: number }
238238

239239
export type PermissionID = string
240240

@@ -6127,6 +6127,8 @@ export type CredentialRemoveInput = { readonly credentialID: { readonly credenti
61276127

61286128
export type CredentialRemoveOutput = void
61296129

6130+
export type ProjectListInput = { readonly archived?: { readonly archived?: boolean | undefined }["archived"] }
6131+
61306132
export type ProjectListOutput = Array<Project>
61316133

61326134
export type ProjectUpdateInput = {
Collapse file

‎packages/client/src/solid/data.ts‎

Copy file name to clipboardExpand all lines: packages/client/src/solid/data.ts
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1828,7 +1828,9 @@ export function createData(config: CreateDataInput) {
18281828
},
18291829
project: {
18301830
list() {
1831-
return Object.values(store.project.info).toSorted((a, b) => b.time.active - a.time.active)
1831+
return Object.values(store.project.info)
1832+
.filter((project) => project.time.archived === undefined)
1833+
.toSorted((a, b) => b.time.active - a.time.active)
18321834
},
18331835
get(projectID: string) {
18341836
return store.project.info[projectID]
Collapse file

‎packages/console/app/src/component/header.tsx‎

Copy file name to clipboardExpand all lines: packages/console/app/src/component/header.tsx
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export function Header(props: { zen?: boolean; go?: boolean; hideGetStarted?: bo
186186
</li>
187187
<Show when={props.zen || props.go}>
188188
<li>
189-
<a href="/auth">{i18n.t("nav.login")}</a>
189+
<a href="/console">{i18n.t("nav.login")}</a>
190190
</li>
191191
</Show>
192192
<Show when={!props.hideGetStarted}>
@@ -311,7 +311,7 @@ export function Header(props: { zen?: boolean; go?: boolean; hideGetStarted?: bo
311311
</li>
312312
<Show when={props.zen || props.go}>
313313
<li>
314-
<a href="/auth">{i18n.t("nav.login")}</a>
314+
<a href="/console">{i18n.t("nav.login")}</a>
315315
</li>
316316
</Show>
317317
<Show when={!props.hideGetStarted}>
Collapse file

‎packages/core/schema.json‎

Copy file name to clipboardExpand all lines: packages/core/schema.json
+12-2Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"version": "7",
33
"dialect": "sqlite",
4-
"id": "e98619ef-c334-45e3-8c48-9932ed1ef290",
5-
"prevIds": ["be60f352-8da1-40e1-8d70-dc41121cfbc5"],
4+
"id": "5067fae0-90ff-4601-82d7-dd050ea9dc8f",
5+
"prevIds": ["e98619ef-c334-45e3-8c48-9932ed1ef290"],
66
"ddl": [
77
{
88
"name": "account_state",
@@ -710,6 +710,16 @@
710710
"entityType": "columns",
711711
"table": "project"
712712
},
713+
{
714+
"type": "integer",
715+
"notNull": false,
716+
"autoincrement": false,
717+
"default": null,
718+
"generated": null,
719+
"name": "time_archived",
720+
"entityType": "columns",
721+
"table": "project"
722+
},
713723
{
714724
"type": "text",
715725
"notNull": true,
Collapse file

‎packages/core/src/database/migration.gen.ts‎

Copy file name to clipboardExpand all lines: packages/core/src/database/migration.gen.ts
+2Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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.