MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / previewForEntry

Function previewForEntry

ui/src/live/inbox-threads.ts:57–71  ·  view source on GitHub ↗
(entry: InboxEntry)

Source from the content-addressed store, hash-verified

55 * flat list used.
56 */
57export function previewForEntry(entry: InboxEntry): string {
58 const c = (entry.comments ?? '').trim()
59 if (c) {
60 const firstLine = c.split('\n').find((l) => l.trim().length > 0) ?? ''
61 return firstLine.replace(/^[#>*\-]+\s*/, '').trim()
62 }
63 if (entry.docs && entry.docs.length > 0) {
64 const d = entry.docs[0]
65 if (d) {
66 const suffix = entry.docs.length > 1 ? ` · +${entry.docs.length - 1} more` : ''
67 return `📄 ${d.path}${suffix}`
68 }
69 }
70 return ''
71}

Callers 3

InboxReportsSectionFunction · 0.90
ClusterRowFunction · 0.90
TimeRowFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected