feat(file-viewer): browse a versioned file's git history
Nightly Build / build (push) Successful in 8m5s

A clock button in the file viewer header lists the versions of a file
whose project keeps a git history; picking one shows the file as of
that commit, read-only, with a banner back to the current version.

A past version is never served from the working tree: the whole
repository is materialized at that revision (git archive streamed
through tar into a size-bounded, immutable-by-rev cache) and every
fetch — content, compiled LaTeX, markdown images, downloads — resolves
inside that tree, so dependencies are contemporaneous with the file:
a .tex compiles against its \input's and images of that moment.

Backend: new git_versions module (repo discovery bounded by the
workspace mount, host-git log/rev-parse/archive, extraction cache with
oldest-first prune) + GET /api/file/versions and a rev param on
GET /api/file (rev is the ETag; never X-Writable). Frontend: history
mode in FileViewerBase shared by the desktop and mobile viewers —
popover, banner, watcher paused while browsing, rev propagated to
every /api/file URL it builds.
This commit is contained in:
Daniele
2026-08-10 14:27:48 +01:00
parent cd641ab89e
commit 1515492938
14 changed files with 950 additions and 15 deletions
+4
View File
@@ -1040,6 +1040,10 @@ export default {
'fv.zoom_in': 'Zoom in',
'fv.zoom_out': 'Zoom out',
'fv.pdf_failed': 'This PDF could not be displayed.',
'fv.history': 'History',
'fv.current': 'current',
'fv.version_banner': 'Version of {date} — read-only',
'fv.back_to_current': 'Back to current',
// ── Marketplace ─────────────────────────────────────────────────────────────
'marketplace.title': 'Marketplace',
+4
View File
@@ -1030,6 +1030,10 @@ export default {
'fv.zoom_in': 'Agrandir',
'fv.zoom_out': 'Réduire',
'fv.pdf_failed': 'Impossible dafficher ce PDF.',
'fv.history': 'Historique',
'fv.current': 'actuelle',
'fv.version_banner': 'Version du {date} — lecture seule',
'fv.back_to_current': 'Retour à la version actuelle',
// ── Marketplace ─────────────────────────────────────────────────────────────
'marketplace.title': 'Marketplace',
+4
View File
@@ -1030,6 +1030,10 @@ export default {
'fv.zoom_in': 'Ingrandisci',
'fv.zoom_out': 'Riduci',
'fv.pdf_failed': 'Impossibile visualizzare questo PDF.',
'fv.history': 'Cronologia',
'fv.current': 'attuale',
'fv.version_banner': 'Versione del {date} — sola lettura',
'fv.back_to_current': 'Torna allattuale',
// ── Marketplace ──────────────────────────────────────────────────────────────
'marketplace.title': 'Marketplace',