e177bca92fc68e5d64b15ceed2982e92089a52e3
Deploy to VPS / deploy (push) Has been cancelled
The hero CMS only listed HeroSlide rows from the database. Files dropped
directly into /public/footage/main were rendering on the live site (via
the home page's filesystem fallback) but invisible in the editor — so
the editor couldn't manage their focal point, alt text, ordering or
on/off toggle without re-uploading.
NEW SERVER ACTIONS (src/app/hq-command/dashboard/hero/actions.ts)
- listImportableFootage()
Scans /public/footage/main, returns the list of files that aren't
already referenced by a HeroSlide row. Each entry has filename,
publicUrl, mediaType (image/video), file size and mtime.
- importFootageFiles(filenames[])
For each selected filename: validates extension, checks existence,
skips already-imported files, derives a sensible alt text (filename
with extension stripped, dashes/underscores → spaces, leading
numeric prefix removed), and creates a HeroSlide row at the next
available order position. Returns {created, skipped} so the UI can
show a precise toast.
UI (src/app/hq-command/dashboard/hero/page.tsx)
- New amber-tinted panel above the slide list, visible only when
importable.length > 0. Shows every uncovered file as a thumbnail
card with checkbox-style selection.
- 'Select all' / 'Clear' toggle, 'Import all' for one-click bulk
import, 'Import N selected' once a subset is picked.
- After import: panel re-renders empty (since those files now have
HeroSlide rows) and the new slides appear in the regular list,
ready for focal-point and caption editing.
NO BACKEND-DATA CHANGES BEYOND ROW CREATION
- Filesystem untouched (no rename, no move). Files keep their original
path under /public/footage/main, the new HeroSlide row simply points
at /footage/main/<filename>.
- Public-facing pages render the same images either way (they read
from HeroSlide first, footage scan second).
- After import: the home page now reads the slides from the DB and
uses the focal-point + alt text data the editor sets.
Description
No description provided
Languages
TypeScript
98.1%
JavaScript
0.9%
Dockerfile
0.4%
Shell
0.4%
CSS
0.2%