UnENVerse 0.42.6
Local-first desktop secrets manager — TypeScript frontend
Loading...
Searching...
No Matches
timeline.ts File Reference
import st;

Functions

function rotationDue(e:VaultEntry) shortDate (iso:string|null|undefined)
 The date a rotation is next due, or null when the entry has no cadence.
 
 if (bound) return
 Parses an expression.
 
function daysUntil (iso:string)
 Days between now and iso; negative when it is in the past.
 
 if (days< 0) return
 
 if (days<=30) return
 
function rotationCell (e:VaultEntry)
 Rotation cell: due date derived from the cadence, or an em dash.
 
 if (!due) return
 
function createdSortKey (e:VaultEntry)
 Sort value for the Created column; undated entries sort last in both directions.
 
function selectedKinds ()
 Which event kinds the export checkboxes currently select.
 

Variables

type SortKey = 'created-desc' | 'created-asc' | 'expires-asc' | 'provider'
 Sort orders offered by the pane.
 
type EventKind = 'created' | 'expires' | 'rotation'
 Which kinds of calendar event this pane can produce.
 
const invoke = invokeTauri
 
 return { text: 'unknown', certainty: 'unknown' }
 
const when = shortDate(e.expires_at)
 
const days = daysUntil(due)
 

Function Documentation

◆ shortDate()

function rotationDue(e:VaultEntry) shortDate ( iso:string|null|  undefined)

The date a rotation is next due, or null when the entry has no cadence.

A pure display computation — "which date is next" — not part of the .ics byte format, so it stays local rather than round-tripping through IPC for every row in the table on every render. vault_core::calendar::rotation_due computes the same thing for the same reason build_ics needs it; the two are not a twin pair the way icsEscape/build_ics were, because neither produces bytes the other has to match — only a date used to sort and colour one column.

Counts from last_rotated_at when there is one and from created_at otherwise: a key with a 90-day cadence that has never been rotated is due 90 days after it was issued, not never. An entry with neither date has no anchor, and inventing one would put a deadline in someone's calendar that no evidence supports. 2026-03-04T… → 4 Mar 2026. Empty string for anything unparseable. What the Created column says for one entry, and how sure it is.

The distinction is the whole point of the column: known came from the entry's own record, bound is the earliest date it can be proved to have existed, and unknown is an honest absence. Rendering the second as if it were the first is the lie this pane exists not to tell.

◆ if() [1/4]

if ( pos !  pos ! = =toks.length)
new

Parses an expression.

Throws with a readable message on malformed input.

◆ daysUntil()

function daysUntil (   iso:string)

Days between now and iso; negative when it is in the past.

Expiry cell plus the class that colours it.

◆ if() [2/4]

if ( )

◆ if() [3/4]

if ( days<=  30)

◆ rotationCell()

function rotationCell (   e:VaultEntry)

Rotation cell: due date derived from the cadence, or an em dash.

◆ if() [4/4]

if ( !  due)

◆ createdSortKey()

function createdSortKey (   e:VaultEntry)

Sort value for the Created column; undated entries sort last in both directions.

Applies _sort, keeping undated and non-expiring entries at the bottom.

◆ selectedKinds()

function selectedKinds ( )

Which event kinds the export checkboxes currently select.

Variable Documentation

◆ SortKey

type SortKey = 'created-desc' | 'created-asc' | 'expires-asc' | 'provider'

Sort orders offered by the pane.

◆ EventKind

type EventKind = 'created' | 'expires' | 'rotation'

Which kinds of calendar event this pane can produce.

Mirrors vault_core::calendar::EventKind — the string spelling is the contract between the two, asserted by calendar_build_ics on the Rust side rather than by a shared type, since nothing here crosses a type boundary.

◆ invoke

const invoke = invokeTauri

◆ return

return { text: 'unknown', certainty: 'unknown' }

◆ when

const when = shortDate(e.expires_at)

◆ days

const days = daysUntil(due)