Improved naming scheme for backup snapshot names

This commit is contained in:
patben8 committed 2026-07-09 13:19:16 +02:00
1 parent 41111c7c4c
commit f19a662bd3
3 files changed
+27 -10

No files matched your search

+24 -6
View File
@@ -21,6 +21,17 @@ function formatWhen(iso: string): string {
}) })
} }
// Backend joins the summary's parts with "; " (e.g. "Added 6 hotcues; edited
// beatgrid on 3 tracks"). Split them back out so each renders as its own chip
// that wraps — far more scannable than one truncated run-on line.
function summaryChips(summary: string): string[] {
return summary
.split('; ')
.map((p) => p.trim())
.filter(Boolean)
.map((p) => p.charAt(0).toUpperCase() + p.slice(1))
}
/** /**
* Version history browser for the current collection. Every save is a commit in * Version history browser for the current collection. Every save is a commit in
* a purely-local git repo (see backend history.py); this lists them newest-first * a purely-local git repo (see backend history.py); this lists them newest-first
@@ -96,18 +107,25 @@ export function HistoryPanel({ onClose, onNotify, onError }: Props) {
return ( return (
<li <li
key={e.id} key={e.id}
className="group flex items-center gap-3 rounded-md border border-line bg-ink-850 px-3 py-2" className="group flex items-start gap-3 rounded-md border border-line bg-ink-850 px-3 py-2"
> >
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<div className="flex items-center gap-2"> <div className="flex flex-wrap items-center gap-1">
<span className="truncate text-sm text-text">{e.summary}</span>
{isCurrent && ( {isCurrent && (
<span className="shrink-0 rounded bg-mint/15 px-1.5 py-0.5 text-[10px] font-medium text-mint"> <span className="rounded bg-mint/15 px-1.5 py-0.5 text-[10px] font-medium text-mint">
current current
</span> </span>
)} )}
{summaryChips(e.summary).map((chip, ci) => (
<span
key={ci}
className="rounded bg-ink-800 px-1.5 py-0.5 text-xs text-text"
>
{chip}
</span>
))}
</div> </div>
<div className="text-[11px] text-faint"> <div className="mt-1 text-[11px] text-faint">
{formatWhen(e.timestamp)} · {e.id.slice(0, 8)} {formatWhen(e.timestamp)} · {e.id.slice(0, 8)}
</div> </div>
</div> </div>
@@ -132,7 +150,7 @@ export function HistoryPanel({ onClose, onNotify, onError }: Props) {
onClick={() => setConfirmingId(e.id)} onClick={() => setConfirmingId(e.id)}
disabled={isCurrent} disabled={isCurrent}
title={isCurrent ? 'This is the current version' : 'Restore this version'} title={isCurrent ? 'This is the current version' : 'Restore this version'}
className="shrink-0 rounded-md border border-line px-2.5 py-1 text-xs text-muted opacity-0 transition-opacity hover:bg-ink-800 hover:text-text group-hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-0" className="mt-0.5 shrink-0 rounded-md border border-line px-2.5 py-1 text-xs text-muted opacity-0 transition-opacity hover:bg-ink-800 hover:text-text group-hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-0"
> >
Restore Restore
</button> </button>
@@ -281,7 +281,7 @@ function FolderBrowser({
{data?.path ?? '…'} {data?.path ?? '…'}
</span> </span>
</div> </div>
<div className="max-h-48 overflow-y-auto"> <div className="h-48 overflow-y-auto">
{data?.dirs.length ? ( {data?.dirs.length ? (
data.dirs.map((d) => ( data.dirs.map((d) => (
<button <button
+2 -3
View File
@@ -248,10 +248,9 @@ export function Sidebar({ source, onSelect, onError, onOpenHistory }: Props) {
<button <button
onClick={onOpenHistory} onClick={onOpenHistory}
className="flex items-center gap-2 border-t border-line px-4 py-2 text-left text-xs text-muted hover:bg-ink-800 hover:text-text" className="flex items-center justify-center gap-2 border-t border-line px-4 py-2 text-center text-xs text-muted hover:bg-ink-800 hover:text-text"
> >
<span className="text-[11px] text-faint">🕑</span> Collection Version History
Version history
</button> </button>
<SaveBar onError={onError} /> <SaveBar onError={onError} />