mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
tui: show more sessions in list and fix sync timing to prevent race conditions
This commit is contained in:
parent
0a395d8783
commit
1a2b3701f2
3 changed files with 2 additions and 4 deletions
|
|
@ -43,6 +43,7 @@ export function DialogSessionList() {
|
|||
footer: Locale.time(x.time.updated),
|
||||
}
|
||||
})
|
||||
.slice(0, 150)
|
||||
})
|
||||
|
||||
createEffect(() => {
|
||||
|
|
@ -57,7 +58,6 @@ export function DialogSessionList() {
|
|||
<DialogSelect
|
||||
title="Sessions"
|
||||
options={options()}
|
||||
limit={50}
|
||||
current={currentSessionID()}
|
||||
onMove={() => {
|
||||
setToDelete(undefined)
|
||||
|
|
|
|||
|
|
@ -269,8 +269,8 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
|||
return last.time.completed ? "idle" : "working"
|
||||
},
|
||||
async sync(sessionID: string) {
|
||||
const now = Date.now()
|
||||
if (store.message[sessionID]) return
|
||||
const now = Date.now()
|
||||
console.log("syncing", sessionID)
|
||||
const [session, messages, todo, diff] = await Promise.all([
|
||||
sdk.client.session.get({ path: { id: sessionID }, throwOnError: true }),
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ export interface DialogSelectProps<T> {
|
|||
title: string
|
||||
onTrigger: (option: DialogSelectOption<T>) => void
|
||||
}[]
|
||||
limit?: number
|
||||
current?: T
|
||||
}
|
||||
|
||||
|
|
@ -58,7 +57,6 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
|
|||
const result = pipe(
|
||||
props.options,
|
||||
filter((x) => x.disabled !== true),
|
||||
take(props.limit ?? Infinity),
|
||||
(x) =>
|
||||
!needle ? x : fuzzysort.go(needle, x, { keys: ["title", "category"] }).map((x) => x.obj),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue