Files
ARTEX/web/scripts
mirzahasnat f660ba1d2f feat(web): preview workspace files in the file sheet
Opening a file in Workspace showed a bare text editor, and every image
was reported as "Binary file; online preview/editing is not supported".
The sheet now opens on a Preview tab, with the editor one click away:

- Markdown is rendered with the existing Markdown component (no raw HTML).
- JSON and HTML/XML get line numbers and the JSON/markup highlighting
  already used by HttpCodeBlock; other text gets line numbers.
- PNG, JPEG, GIF, WebP, BMP, ICO and AVIF are shown inline. They come
  from the existing /api/workspace/download route through apiFetch, so
  the route's auth and path checks apply unchanged. The Blob takes its
  type from the extension allow-list, and the read stops at 10 MiB (by
  Content-Length, or by counting bytes when there is none).
- SVG is shown as source, never rendered, since it can carry script.
- Text over 200,000 characters or 5,000 lines is shown as one plain
  block, so a big log cannot stall the page. Binary files and text over
  the server's 2 MiB read limit keep the download prompt.

The sheet's sm:max-w-2xl lost to the Sheet's own
data-[side=right]:sm:max-w-sm, holding it at 384 px; it now uses the
data-[side=right] prefix like the other wide sheets.

No backend change.
2026-12-04 14:32:45 +05:00
..