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

Function TimeRow

ui/src/components/InboxSidebar.tsx:310–357  ·  view source on GitHub ↗

Row in the flat time feed — carries the workspace label (no cluster * header to provide it).

({
  entry, active, unread, onClick,
}: {
  entry: InboxEntry
  active: boolean
  unread: boolean
  onClick: () => void
})

Source from the content-addressed store, hash-verified

308/** Row in the flat time feed — carries the workspace label (no cluster
309 * header to provide it). */
310function TimeRow({
311 entry, active, unread, onClick,
312}: {
313 entry: InboxEntry
314 active: boolean
315 unread: boolean
316 onClick: () => void
317}) {
318 return (
319 <div
320 role="button"
321 tabIndex={0}
322 onClick={onClick}
323 onKeyDown={(e) => {
324 if (e.key === 'Enter' || e.key === ' ') {
325 e.preventDefault()
326 onClick()
327 }
328 }}
329 className={`group relative flex min-h-14 flex-col gap-0.5 px-3 py-2 cursor-pointer transition-colors outline-none focus-visible:bg-bg-tertiary/70 ${
330 active ? 'bg-bg-tertiary' : 'hover:bg-bg-tertiary/50'
331 }`}
332 >
333 {active && (
334 <span aria-hidden className="absolute left-0 top-0 bottom-0 w-[2px] bg-accent" />
335 )}
336
337 {/* Line 1: unread dot · workspace · time */}
338 <div className="flex items-center gap-1.5">
339 <span
340 aria-hidden
341 className={`shrink-0 w-1.5 h-1.5 rounded-full ${unread ? 'bg-accent' : 'bg-transparent'}`}
342 />
343 <span className={`flex-1 truncate text-[12px] ${unread ? 'font-medium text-text' : 'text-text'}`}>
344 {entry.workspaceLabel ?? entry.workspaceId}
345 </span>
346 <span className="shrink-0 text-[10px] text-text-muted/60 tabular-nums">
347 {formatRelativeTime(entry.ts)}
348 </span>
349 </div>
350
351 {/* Line 2: preview */}
352 <div className={`pl-3 text-[11px] truncate ${unread ? 'text-text-muted' : 'text-text-muted/70'}`}>
353 {previewForEntry(entry)}
354 </div>
355 </div>
356 )
357}
358
359// ==================== Date bucketing (time view) ====================
360

Callers

nothing calls this directly

Calls 3

formatRelativeTimeFunction · 0.90
previewForEntryFunction · 0.90
onClickFunction · 0.85

Tested by

no test coverage detected