Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ export function DialogSessionList() {
const spinnerFrames = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]

const sessions = createMemo(() => searchResults() ?? sync.data.session)
const isSearching = createMemo(() => search().length > 0)

const options = createMemo(() => {
const today = new Date().toDateString()
const limit = sync.data.config.tui?.session_list_limit ?? 150
return sessions()
.filter((x) => x.parentID === undefined)
.toSorted((a, b) => b.time.updated - a.time.updated)
.slice(0, isSearching() ? undefined : limit)
.map((x) => {
const date = new Date(x.time.updated)
let category = date.toDateString()
Expand Down
7 changes: 7 additions & 0 deletions packages/opencode/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,13 @@ export namespace Config {
.enum(["auto", "stacked"])
.optional()
.describe("Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column"),
session_list_limit: z
.number()
.int()
.min(1)
.max(10000)
.optional()
.describe("Maximum number of sessions to display in session list (default: 150)"),
})

export const Server = z
Expand Down
4 changes: 4 additions & 0 deletions packages/sdk/js/src/v2/gen/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1609,6 +1609,10 @@ export type Config = {
* Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column
*/
diff_style?: "auto" | "stacked"
/**
* Maximum number of sessions to display in session list (default: 150)
*/
session_list_limit?: number
}
server?: ServerConfig
/**
Expand Down
6 changes: 6 additions & 0 deletions packages/sdk/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -9343,6 +9343,12 @@
"description": "Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column",
"type": "string",
"enum": ["auto", "stacked"]
},
"session_list_limit": {
"description": "Maximum number of sessions to display in session list (default: 150)",
"type": "integer",
"minimum": 1,
"maximum": 10000
}
}
},
Expand Down