refactor(tui-go): move session dates to the R overlay; drop dead idle panels
The launcher removed the idle session list, so the per-row date moves to the R resume overlay — now the sole session list. sessionListRow shows an absolute local date (absDateISO → shortDateTime) alongside the relative age: "Jun 22 14:30 · 5m ago", with the year shown for older-than-this-year rows. Delete the now-unused idle-panel renderers (sessionRows / welcomeRows / workflowRows) and renderMainNarrow's dead idle branch (renderLauncher owns idle, narrow included). Add a "resume" preview kind to screenshot the R overlay. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -228,10 +228,25 @@ func (m Model) sessionListRow(i int) string {
|
||||
}
|
||||
stageCell := mbg(t, padRaw(stage, 22), t.P.Accent2)
|
||||
|
||||
age := relativeAge(s.LastActivityAt)
|
||||
ageCell := mbg(t, age, t.P.Faint)
|
||||
dateCell := mbg(t, padRaw(absDateISO(s.LastActivityAt), 12), t.P.Dim)
|
||||
ageCell := mbg(t, "· "+relativeAge(s.LastActivityAt), t.P.Faint)
|
||||
|
||||
return marker + idCell + " " + statusCell + " " + stageCell + " " + ageCell
|
||||
return marker + idCell + " " + statusCell + " " + stageCell + " " + dateCell + " " + ageCell
|
||||
}
|
||||
|
||||
// absDateISO renders an ISO-8601 instant (the server's LastActivityAt) as a compact local
|
||||
// date via shortDateTime, or "—" when absent/unparseable.
|
||||
func absDateISO(iso string) string {
|
||||
if iso == "" {
|
||||
return "—"
|
||||
}
|
||||
ts, err := time.Parse(time.RFC3339Nano, iso)
|
||||
if err != nil {
|
||||
if ts, err = time.Parse(time.RFC3339, iso); err != nil {
|
||||
return "—"
|
||||
}
|
||||
}
|
||||
return shortDateTime(ts.UnixMilli())
|
||||
}
|
||||
|
||||
// shortSessionID trims a long session id to a recognizable prefix for the list.
|
||||
|
||||
Reference in New Issue
Block a user