more recents in side bar

This commit is contained in:
Arjun 2026-06-02 22:25:05 +05:30
parent caea83aecf
commit 8a8b78071d

View file

@ -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