mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-06-06 19:35:44 +02:00
more recents in side bar
This commit is contained in:
parent
caea83aecf
commit
8a8b78071d
1 changed files with 7 additions and 7 deletions
|
|
@ -512,7 +512,7 @@ export function SidebarContentPanel({
|
||||||
const out: TreeNode[] = []
|
const out: TreeNode[] = []
|
||||||
const walk = (nodes: TreeNode[]) => {
|
const walk = (nodes: TreeNode[]) => {
|
||||||
for (const n of nodes) {
|
for (const n of nodes) {
|
||||||
if (n.path === 'knowledge/Meetings' || n.path === 'knowledge/Workspace') continue
|
if (n.path === 'knowledge/Meetings' || n.path === 'knowledge/Workspace' || n.path === 'knowledge/Agent Notes') continue
|
||||||
if (n.kind === 'file') out.push(n)
|
if (n.kind === 'file') out.push(n)
|
||||||
else if (n.children?.length) walk(n.children)
|
else if (n.children?.length) walk(n.children)
|
||||||
}
|
}
|
||||||
|
|
@ -521,11 +521,11 @@ export function SidebarContentPanel({
|
||||||
return out
|
return out
|
||||||
.filter((n) => n.stat?.mtimeMs)
|
.filter((n) => n.stat?.mtimeMs)
|
||||||
.sort((a, b) => (b.stat?.mtimeMs ?? 0) - (a.stat?.mtimeMs ?? 0))
|
.sort((a, b) => (b.stat?.mtimeMs ?? 0) - (a.stat?.mtimeMs ?? 0))
|
||||||
.slice(0, 5)
|
.slice(0, 10)
|
||||||
}, [tree])
|
}, [tree])
|
||||||
|
|
||||||
// Recents: most recently touched notes / agents / chats, interleaved by
|
// Recents: most recently touched notes / agents / chats, interleaved by
|
||||||
// recency. Capped per type (3 notes, 2 agents, 1 chat) and 5 overall.
|
// recency. Capped per type (4 notes, 4 agents, 4 chats) and 12 overall.
|
||||||
type QuickAccessItem = {
|
type QuickAccessItem = {
|
||||||
key: string
|
key: string
|
||||||
label: string
|
label: string
|
||||||
|
|
@ -536,7 +536,7 @@ export function SidebarContentPanel({
|
||||||
const quickAccessItems = React.useMemo<QuickAccessItem[]>(() => {
|
const quickAccessItems = React.useMemo<QuickAccessItem[]>(() => {
|
||||||
const items: QuickAccessItem[] = []
|
const items: QuickAccessItem[] = []
|
||||||
|
|
||||||
for (const note of recentNotes.slice(0, 3)) {
|
for (const note of recentNotes.slice(0, 4)) {
|
||||||
items.push({
|
items.push({
|
||||||
key: `note:${note.path}`,
|
key: `note:${note.path}`,
|
||||||
label: displayNoteName(note),
|
label: displayNoteName(note),
|
||||||
|
|
@ -551,7 +551,7 @@ export function SidebarContentPanel({
|
||||||
const ms = ts ? new Date(ts).getTime() : 0
|
const ms = ts ? new Date(ts).getTime() : 0
|
||||||
return Number.isFinite(ms) ? ms : 0
|
return Number.isFinite(ms) ? ms : 0
|
||||||
}
|
}
|
||||||
for (const t of [...bgTaskSummaries].sort((a, b) => agentRecency(b) - agentRecency(a)).slice(0, 2)) {
|
for (const t of [...bgTaskSummaries].sort((a, b) => agentRecency(b) - agentRecency(a)).slice(0, 4)) {
|
||||||
items.push({
|
items.push({
|
||||||
key: `agent:${t.slug}`,
|
key: `agent:${t.slug}`,
|
||||||
label: t.name,
|
label: t.name,
|
||||||
|
|
@ -565,7 +565,7 @@ export function SidebarContentPanel({
|
||||||
const ms = new Date(r.createdAt).getTime()
|
const ms = new Date(r.createdAt).getTime()
|
||||||
return Number.isFinite(ms) ? ms : 0
|
return Number.isFinite(ms) ? ms : 0
|
||||||
}
|
}
|
||||||
for (const r of [...recentRuns].sort((a, b) => chatRecency(b) - chatRecency(a)).slice(0, 1)) {
|
for (const r of [...recentRuns].sort((a, b) => chatRecency(b) - chatRecency(a)).slice(0, 4)) {
|
||||||
items.push({
|
items.push({
|
||||||
key: `chat:${r.id}`,
|
key: `chat:${r.id}`,
|
||||||
label: r.title || '(Untitled chat)',
|
label: r.title || '(Untitled chat)',
|
||||||
|
|
@ -575,7 +575,7 @@ export function SidebarContentPanel({
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return items.sort((a, b) => b.recency - a.recency).slice(0, 5)
|
return items.sort((a, b) => b.recency - a.recency).slice(0, 12)
|
||||||
}, [recentNotes, bgTaskSummaries, recentRuns, onSelectFile, onOpenAgent, onOpenRun])
|
}, [recentNotes, bgTaskSummaries, recentRuns, onSelectFile, onOpenAgent, onOpenRun])
|
||||||
|
|
||||||
// Workspace count for the Workspaces sublabel — top-level dir children of
|
// Workspace count for the Workspaces sublabel — top-level dir children of
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue