Commit Graph
8 Commits
Author SHA1 Message Date
Aditya Tripathi e050ea339c refactor(files): Monaco editor, single-stat listing, kebab actions, hardening
Address review feedback and UX issues on the file browser.

Editor
- Replace the TipTap editor with Monaco, reusing the self-hosted assets. The
  editor is kept mounted (wire:ignore) and preloaded on page init, and receives
  content + language via the load-file-editor event, applying the language with
  setModelLanguage so highlighting is correct without recreating the instance.
- Keep the Monaco instance on the DOM node, not in Alpine reactive state, so its
  object graph is never proxied (that hung and crashed the tab).
- Drop @tiptap/*, lowlight and highlight.js; remove the TipTap CSS and JS.
- Broaden guessLanguage to Monaco ids and common extension-less/dotfiles.

Listing / read (perf)
- List a directory in one stat call instead of a per-entry loop (embedding a
  real tab, since stat -c does not expand \t), and surface owner/group columns.
- Fold the read size-cap, binary probe and base64 into one SSH round trip.

Actions
- Collapse the per-row Edit/Download/Rename/Delete buttons into a 3-dots menu.
- Fix actions silently failing on names with apostrophes: the entry name now
  lives in the row's Alpine scope instead of passing @js() through a component
  attribute (which double-encodes the quotes).

Hardening
- Lock client-controllable state (container/type/resource) with #[Locked].
- Re-check guard() in open/goTo/refresh; sanitize upload filenames; clean up the
  download temp file and report errors; route >96KiB writes through docker cp.

Tests updated and extended (32 passing). Frontend rebuild (npm run build) is
still needed only to drop TipTap from the bundle; the editor works without it.
2026-08-27 16:31:39 +00:00
Aditya Tripathi f93d73cfc1 fix(files): harden file browser against tampering and large writes
- Escape dynamic file/path names with @js() in Livewire click handlers
  instead of interpolating raw strings, and lock resource/container
  properties to prevent client-side property tampering
- Route writes over ~96 KiB through docker cp instead of an inline
  base64 shell argument, which was capped by MAX_ARG_STRLEN
- Treat empty files as editable text instead of misclassifying them
  as binary
2026-08-27 14:34:12 +00:00
Aditya Tripathi 4f4287f9e0 feat(files): new-file action, permissions + chmod, TipTap syntax-highlight editor, breadcrumb + grid fixes 2026-08-26 16:40:47 +00:00
Aditya Tripathi 1e47cbfac2 feat(files): add upload and download byte transfer 2026-08-26 13:39:34 +00:00
Aditya Tripathi d6a39f1a80 feat(files): add write, mkdir, rename and delete operations 2026-08-26 13:38:56 +00:00
Aditya Tripathi b68462734f feat(files): read files with binary and size guards 2026-08-26 13:38:29 +00:00
Aditya Tripathi a8f143cf60 feat(files): execute directory listing and default-root resolution over SSH 2026-08-26 13:36:46 +00:00
Aditya Tripathi c37000eaeb feat(files): add container listing command builder and parser 2026-08-26 13:35:42 +00:00