chore: generate

This commit is contained in:
opencode-agent[bot]
2026-07-16 09:53:45 +00:00
parent dc3ff4b7aa
commit c69abee0c7
4 changed files with 27 additions and 40 deletions
@@ -249,15 +249,15 @@ export function createServerSessionEntries(props: {
}) })
if (current.signal.aborted) return [] if (current.signal.aborted) return []
const opened = props.opened() const opened = props.opened()
const openedByID = new Map( const openedByID = new Map(opened.flatMap((project) => (project.id ? [[project.id, project] as const] : [])))
opened.flatMap((project) => (project.id ? [[project.id, project] as const] : [])),
)
const stored = props.stored().map((project) => ({ ...project, expanded: false })) const stored = props.stored().map((project) => ({ ...project, expanded: false }))
const storedByID = new Map(stored.map((project) => [project.id, project] as const)) const storedByID = new Map(stored.map((project) => [project.id, project] as const))
return props return props
.load(search, current.signal) .load(search, current.signal)
.then((result) => .then((result) =>
(result.data ?? []).filter((session) => !session.time.archived).map((session) => { (result.data ?? [])
.filter((session) => !session.time.archived)
.map((session) => {
const project = const project =
projectForSession(session, opened, openedByID) ?? projectForSession(session, stored, storedByID) projectForSession(session, opened, openedByID) ?? projectForSession(session, stored, storedByID)
return { return {
@@ -73,9 +73,7 @@ export function DialogHomeCommandPaletteV2(props: {
const state = { cleanup: undefined as (() => void) | void, committed: false } const state = { cleanup: undefined as (() => void) | void, committed: false }
const commandEntries = createMemo(() => { const commandEntries = createMemo(() => {
const category = language.t("palette.group.commands") const category = language.t("palette.group.commands")
return commandPaletteOptions(command.options).map((option) => return commandPaletteOptions(command.options).map((option) => createCommandPaletteCommandEntry(option, category))
createCommandPaletteCommandEntry(option, category),
)
}) })
const sessions = createServerSessionEntries({ const sessions = createServerSessionEntries({
server: ServerConnection.key(props.server), server: ServerConnection.key(props.server),
@@ -107,10 +105,7 @@ export function DialogHomeCommandPaletteV2(props: {
const loadItems = async (text: string) => { const loadItems = async (text: string) => {
const query = text.trim() const query = text.trim()
if (!query) return commandEntries().slice(0, 5) if (!query) return commandEntries().slice(0, 5)
return [ return [...commandEntries().filter((entry) => matchesEntry(entry, query)), ...(await sessions(query))]
...commandEntries().filter((entry) => matchesEntry(entry, query)),
...(await sessions(query)),
]
} }
onCleanup(() => { onCleanup(() => {
@@ -147,12 +142,7 @@ function CommandPaletteView(props: {
const groupedEntries = createMemo(() => groups(visibleEntries())) const groupedEntries = createMemo(() => groups(visibleEntries()))
const activeEntry = createMemo(() => visibleEntries()[active()]) const activeEntry = createMemo(() => visibleEntries()[active()])
const openSessions = createMemo( const openSessions = createMemo(
() => () => new Set(tabs.store.flatMap((tab) => (tab.type === "session" ? [`${tab.server}\0${tab.sessionId}`] : []))),
new Set(
tabs.store.flatMap((tab) =>
tab.type === "session" ? [`${tab.server}\0${tab.sessionId}`] : [],
),
),
) )
createEffect(() => { createEffect(() => {
+1 -4
View File
@@ -90,10 +90,7 @@ export interface CommandOption {
export function commandPaletteOptions(options: CommandOption[]) { export function commandPaletteOptions(options: CommandOption[]) {
return options.filter( return options.filter(
(option) => (option) =>
!option.disabled && !option.disabled && !option.hidden && !option.id.startsWith(SUGGESTED_PREFIX) && option.id !== "file.open",
!option.hidden &&
!option.id.startsWith(SUGGESTED_PREFIX) &&
option.id !== "file.open",
) )
} }