Editing in the browser
Open a document's files in the app editor, preview markdown and HTML as you type, save with a version check, hold an edit lease, compare and restore versions, crop images, and hand a change to an agent.
Write with your team or edit what your AI creates. Markdown documents open in the note editor, with visual writing, source editing, and live collaboration when enabled. The guide below covers the file editor for HTML, code, images, and other supported files, including version checks and edit leases.
Opening the editor
Select a document and click Edit in the inspector header. It opens the document's primary file:
| Document kind | Opens | Notes |
|---|---|---|
| markdown | source.md |
the rendered page is regenerated on save |
| HTML | index.html |
with the document's other text files as tabs |
| snippet | source.<ext> |
re-highlighted on save |
| file share | the file itself | when it is text or a raster image |
| video, audio, archives | nothing | no editor; change the description instead |
When the document has several editable files, a Files menu next to the button lists the rest, and the editor shows them as tabs. The generated index.html of a markdown or snippet document is not offered, because the next save of the source would overwrite it.
Who can open it: the document's owner, and on Business and above anyone holding edit access through a grant. Others see the button disabled with a note to ask the owner.
The wiki shows Edit this page in a document's footer for signed-in members who may edit it; it opens the same editor.
Which editor you get
| File | Editor |
|---|---|
.md, .markdown, .mdx |
markdown mode with a toolbar, wiki-link autocomplete and a live preview |
.html, .css, .js, .ts and friends |
code editor with the matching mode; HTML documents get a live preview of the draft |
.json, .yaml, .yml |
code editor with syntax checking; a file with errors cannot be saved until they are fixed |
| snippet source | code editor with a Language picker that changes highlighting in the editor only; the published language stays what the snippet was given |
.txt, .csv, .log and other text |
plain text with line wrapping |
.png, .jpg, .webp, .gif, .bmp, .avif |
the image editor, see below |
SVG files count as text. Text files are editable up to 1 MiB, the same limit as search and get_file.
The markdown toolbar
The toolbar writes plain markdown syntax around or before your selection; there is no rich-text model, and source.md stays exactly what you see. Buttons: bold, italic, heading, bulleted list, numbered list, quote, link, code (inline for a one-line selection, a fenced block otherwise), image, table, horizontal rule, and [[ ]] for a wiki link. Applying the same list or heading prefix twice removes it. Ctrl or Cmd plus B and I do bold and italic.
Wiki-link autocomplete
Type [[ and the editor offers your documents by alias and by title; pick one and it inserts [[alias]], or [[doc:<id>]] for a document without an alias, and closes the brackets. Type [[# to complete a tag from the tags you use, with its document count. The [[ ]] toolbar button inserts the brackets and opens the list. Background on how links resolve is in Links between documents.
Live preview
Preview sits next to the editor on wide screens and behind an Edit / Preview switch on narrow ones.
- Markdown is rendered by the server with the same pipeline that renders the published page, wiki links and Mermaid diagrams included, shortly after you stop typing. Each diagram in the preview has the same Expand diagram viewer as the published page, with zoom, pan and keyboard control. What you see is what ships. Previews are rate limited per account; a normal editing pace does not reach the limit.
- HTML documents preview the draft itself, with the document's own stylesheets and scripts inlined from their tabs and everything else resolved against the published copy.
Both previews run inside a sandboxed frame that is never same-origin with the app, so a draft cannot read your session. See Two origins.
Saving
Save (or Ctrl or Cmd plus S) writes every changed file. Each write carries the document version your draft started from, its base_version. If the document is still at that version, the write lands as the next version and the page is regenerated: source.md re-renders, source.<ext> re-highlights, index.html of an HTML document updates in place, any other file is replaced. The status line shows the current version and how many changes are unsaved, and the browser warns before you leave with unsaved changes.
When someone saved first
If the document moved on while you were editing, the server refuses the write and the editor shows Saved by … while you were editing, naming who wrote the newer version. The dialog has three tabs and three choices:
- What happened explains the choices. Their changes shows a unified diff from your base version to what is on the server now. Against my draft shows the server's file side by side with your draft.
- Keep editing closes the dialog and leaves your draft alone.
- Reload (discard my draft) replaces your draft of that file with the server's copy. Other open files keep their drafts.
- Overwrite as v(n+1) saves your draft as the next version. Nothing is lost: their version stays in Versions and can be compared or restored later.
Edit leases
Two people typing into the same document at once would take turns overwriting each other, so the editor takes a short edit lease on the document at your first keystroke and renews it while the editor is open. A lease lasts at most ten minutes and clears itself when it expires, so a closed laptop never blocks a document for long. Closing the editor or the tab releases it.
While someone else holds the lease, your editor is read-only with a banner: Ada is editing this document (lease until 14:35). Your view is read-only until they finish. The editor checks every few seconds and a Retry button asks again. Agents see the same lease: a write from an agent into a document you have leased is refused with your email and the expiry, unless the agent presents the lease token. Your own lease never blocks you, so two of your own windows can share a document.
The document's owner can break someone else's lease through the API with force; the release is recorded in the audit log with who broke it. Leases stop writers only. Reading, previewing, searching and syncing a document are never blocked. The lease endpoints and the agent tools lock_doc, renew_lock, unlock_doc and write_file are in the MCP reference and the REST reference.
Compare versions and restore
The inspector's Versions tab lists every version with when it was written, what wrote it and its size, and expands to the files with their hashes. Compare opens two versions side by side (the previous and the current by default):
- pick From and To from any two versions, Swap them, and switch between Side by side and Unified;
- each file is listed as
changed,added,removedorunchangedwith its size in both versions; - text files show a diff with unchanged regions folded, images show before and after, other binary files show sizes only;
- Restore v(n) on either side brings that version's files back as a new version.
Restoring never rewrites history: the versions you compared stay where they are, and the restore is itself undoable. The version list also has a per-version Compare with current icon, a Restore button on every older version, and Open in editor.
Images
A raster image opens on a canvas with three tools: rotate left or right in quarter turns, crop by dragging a rectangle on the image, and resize by typing a width or height, with the aspect ratio locked by default. Reset puts the original back. Save as new version encodes the result in the file's own format and replaces the file at the same path as a new version, so the original is one click away in Versions. Annotations such as arrows, boxes, text or blur are not available; this is a version-based editor rather than a layered one.
Ask an agent
Some changes are better described than made. In the inspector's Comments panel, switch from Comment to Ask an agent, write the instruction ("tighten the intro and fix the broken link in the second section"), optionally pick the file it concerns and say where (a heading, a line range, a quoted phrase), and click Send request. The request is stored as a comment on the document with your instruction as its body and the file and location as its path and anchor. Comments need a paid plan.
An agent picks it up like any other comment: list_comments(doc_id) returns the open comments with their path and anchor; the agent reads the file with get_file, applies the change with edit_file, apply_patch or write_file, publishes, and then calls resolve_comment so the panel shows the request as done. Agents connected through the MCP server are told to treat open comments as their feedback queue after publishing.
You can also hand the request to an agent by hand: Copy instruction for Claude Code puts a one-line prompt on your clipboard, In Fermium, resolve request <id> on doc <doc_id>: <your instruction>, ready to paste into a terminal.
Limits worth knowing
- Text files are editable up to 1 MiB.
- Every save is a publish for quota purposes and counts against the account's 120 writes per hour.
- Files inside a document add up to at most 20 MiB, so a large image saved from the editor can be refused with a message naming the cap.