All pages
On this page

The file viewer Added in 0.9.9

The file viewer shows one file at a time over the whole screen. It opens when you click a file in 📁 Browse files, a file name an agent wrote in its reply, or a picture, video or audio attachment in the conversation. You can read the file, play it, zoom into it, save it and, for pictures, mark it up.

Pictures, video and audio sit on black. Text sits in a column that stays readable on a wide screen. The title, the buttons and a line with the file's kind and size float over the content. A tap or click on the content hides them and brings them back. While a video or an audio file plays they also fade after three seconds, and moving the mouse or touching a button brings them back. A paused player always shows them.

What each kind looks like #

The relay decides the kind from the file's ending and, for text, from a look at its first bytes.

Kind What you see
Image The picture, fitted to the screen, with zoom (see Zoom). SVG, GIF, ICO, BMP and AVIF are shown too.
Video A player with controls. You can seek, because the relay serves video in parts.
Audio A card with the file name and a player.
Markdown (.md, .mdx, .markdown) Rendered, with headings, tables, code and formulas. Raw shows the source. Added in 0.9.11 A table wider than the viewer scrolls sideways in its own box, like a code block, and a swipe that starts on it stays in the file.
Code and text The text with syntax highlighting where the relay knows the language. No line numbers. Long lines are not wrapped: the block scrolls sideways. Each block has a Copy button.
PDF A card with Open in new tab (your browser's own PDF viewer) and Download. The viewer does not show PDFs itself.
Anything else A card with the name, the size, "no inline preview" and Download.

The line over the content reads like CODE · javascript · 4.2 KB: the kind, the language where there is one, and the size.

Text buttons #

For Markdown, code and text files from the workspace, the drives or the session folder, the toolbar has Preview and Raw. Preview is the rendered or highlighted view, Raw is the plain text.

A Markdown file opens with its layout HTML switched on, and a line says ⚠ Safe layout HTML enabled; active content is blocked. Show literal HTML turns that off, so HTML in the file appears as text, and Show HTML layout turns it back on. Scripts never run either way.

A relative link inside a rendered Markdown file opens the linked file in the same viewer, and a ← Back button appears in the toolbar to return to the file before. A link to a web address opens in a new tab. A file opened this way has no neighbours to swipe to.

Large and binary files #

  • Large text. The viewer reads the first 512 KB of a text file. For a longer file the line over the content adds truncated to 512 KB. The rest is not shown; Download gives the whole file.
  • Binary content. A file that looks like text by its ending but whose bytes are binary (or that the relay serves as a binary type) is shown as the "no inline preview" card.
  • Images, video, audio. No size limit applies to them in the viewer.
  • A file that cannot be read. The viewer shows Preview failed with the error, for example File not found.

Whether you can move on from the open file depends on how you opened it.

Opened from The gallery is
A folder in 📁 Browse files The files of that folder, in the order the browser lists them. Sub-folders are skipped.
A picture or an attachment in a conversation Every image, video and audio attachment and every picture embedded in a reply, in the conversation's order, oldest to newest.
A file name in a reply, or a link inside a Markdown file None. The viewer shows that one file.

A folder with a single file, or a conversation with a single picture, opens without a gallery. When there is one, two buttons (‹ and ›) and the position (for example 3 / 12) appear at the bottom. The gallery does not wrap: the buttons are disabled at both ends. The neighbours on both sides are fetched ahead, so a step lands on the file instead of on Fetching file preview….

A file in a conversation that is not a picture, video or audio (a PDF, say) is a normal link below the message and opens in a new browser tab, not in the viewer.

Closing it #

  • Swipe down on a picture, a player or a card. The content follows your finger and goes if you swipe far or fast enough. Text scrolls under your finger instead.
  • Swipe sideways to step through the gallery. Mouse drags do not swipe, so they can still select text; a zoomed-in picture pans instead of swiping.
  • × in the top right corner, or Esc.
  • Back on a phone, see below.

Zoom and pan #

Action Result
Mouse wheel Zooms in and out around the pointer.
Pinch (two fingers) Zooms around the point between them, up to 8 times.
Double click or double tap Zooms in 3 times at that point. A second double click returns to the fitted view.
Drag, once zoomed in Moves the picture.

A picture is shown at its fitted size at first and never smaller than that. Fitted, a sideways swipe moves to the next file and a swipe down closes the viewer. Zoomed in, those drags pan the picture instead.

Back on a phone and in the installed app #

While the viewer is open, the system back gesture or back button closes the viewer and nothing else. The address in the browser does not change.

In the app installed from the browser (Android, iOS or desktop), Back never closes the app by itself. With nothing left to close, it shows Press back again to close the app, and a second press closes it. Before you have touched the page once, the browser lets Back leave, which a page cannot change. In an ordinary browser tab the back button is the browser's as usual.

Actions #

Button What it does Where
Download Saves the file. A file from the workspace or the drives is saved with the time of its last change in the name, such as report (1005-0719).pdf (month, day, hour, minute), so you can tell versions apart and never get an older copy. An attachment keeps its name. Every file
Copy Copies the picture to the clipboard as PNG. The label shows Copied ✓ or Copy failed. Images
🖍️ Annotate Closes the viewer and opens the image editor. The annotated copy goes into the composer. The original stays untouched. Not available for GIF and SVG. See Annotating an image. Images, not in a shared link
Open in new tab Opens the file in the browser's own viewer. PDF cards
← Back Returns to the file before, after following a link in a Markdown file. Only after such a link

Click the title at the top to copy the file's reference, such as `@file:src/app.js`, which you can paste into the composer so that the agent reads that file. The title's tooltip shows the exact text. For a file from the drives or the session folder, the reference carries the absolute path.

  • A file name or path in plain text, such as src/app.js, with an ending of a known file type, is a link that opens the file in the viewer. It is always read as a path inside the conversation's workspace. An absolute path is cut back to the part inside the workspace. An absolute path that is not in the workspace, such as /var/log/app.log, becomes a workspace path too and fails with File not found. Names inside code spans and code blocks are not turned into links.
  • A picture the agent embedded by its absolute path opens in the viewer with the conversation's other media. This works for files outside the workspace as well. See Media in an agent's reply.
  • A Markdown link to a file path opens the raw file in a new browser tab, not in the viewer, and so does one to a web address. The same path written as plain text opens in the viewer.

What the viewer can open #

The viewer asks the relay for the file, so the relay decides.

Source Which files
Workspace Files inside the conversation's working folder. A path with .. is refused, and so is a symbolic link that leads outside the folder.
Drives On Linux and macOS, any file the user running the relay can read, anywhere. On Windows, files on the drives the relay lists under 📁 Browse files.
Session folder Read like the drives.
Attachments The files you or an agent attached to a message in the conversation.

A path that names a folder, or a file that is gone, is refused. HTML and XML files are shown as text and an SVG cannot run script, so a file written by an agent never runs as a page on the relay. A shared read-only link cannot fetch workspace or drive files, and a click on an embedded picture does nothing there.

Keys #

Key What it does
Esc Closes the viewer.
→ The next file in the gallery.
← The previous file in the gallery.

The arrow keys work only when there is a gallery, and not while you type in a field.