Files and the editor
You can browse your project, read and edit files, and check diffs on the canvas, next to the agents that change them. This page shows the file tree, the file node and its diff views.
Figure: A file tree, left, and a file opened from it, right. The letters show each file’s git status.
Add a file tree
A file tree lists the files of the canvas’s project folder. On a layer, it lists that layer’s folder.
- Right-click an empty spot on the canvas.
- Choose New file tree here.
You can also press Ctrl+K (Cmd+K on a Mac) and choose New file tree.
In the tree:
- Click a folder to open or close it. Folders come first.
- Double-click a file to open it in a file node beside the tree.
- Click ↻ at the top right to read the folder again.
The tree leaves out what your .gitignore ignores, and the .git folder. It shows at most 5000
entries.
Git badges
A letter next to a file shows its git status:
| Badge | Meaning |
|---|---|
| M | Modified |
| A | Added |
| D | Deleted |
| R | Renamed |
| ?? | New, not tracked by git yet |
| U | Unmerged: a merge conflict waits in it |
A folder shows M when something inside it changed.
Read a file
A file node shows one file of the project. Its strip, at the top, has six buttons:
| Button | What it does |
|---|---|
| Text | Shows the file’s text, with line numbers. |
| Diff | Shows the changes not staged yet, in colour. |
| Staged | Shows the changes staged for the next commit. |
| Stage | Stages the file (git add). |
| Unstage | Takes the file out of the next commit. |
| Reload | Reads the file from disk again. |
The button for the view you see is highlighted. A file node reads its file again every few seconds while it is on screen. So you see your agents’ changes as they make them.
Figure: The Diff view. Added lines are green, removed lines red.
When a view is empty, the node says so: No unstaged changes. or Nothing staged.
Tip
Use Diff, Stage and Staged to build a commit file by file. Then commit from a terminal. To commit everything in a layer at once, see Review your agents’ work.
Edit a file
- Click into the file’s text. Or select the file node and press
Enter. - Type. A caret and selection work as in any editor.
- Press
Ctrl+S(Cmd+Son a Mac) to save.
Leaving the file also saves it: press Esc, or click somewhere else. Closing the canvas saves
too.
While you edit, the strip says Unsaved until you save, then Saving….
The editor keeps the file’s own line breaks and indent style. Useful keys:
| Keys | Action |
|---|---|
Ctrl+Z | Undo |
Ctrl+Shift+Z or Ctrl+Y | Redo |
Tab, Shift+Tab | Indent or outdent the selected lines |
Ctrl+Left, Ctrl+Right | Move by word |
Ctrl+A | Select all |
On a Mac, use Cmd where the table says Ctrl.
When an agent changes the file you edit
While you have nothing unsaved, your agents’ changes to the file show up by themselves.
If an agent changes the file while you have unsaved edits, the strip says Changed on disk. Cuewire then refuses to save, so the agent’s work is never overwritten without you seeing it.
Figure: Changed on disk. Your edits are still on screen, but saving is refused.
To go on:
- Copy anything from your edits that you want to keep.
- Click Reload. The agent’s version replaces your edits.
- Paste your changes back in, and save.
Warning
Reload drops your unsaved edits. Copy what you want to keep first.
What a file node can open
- Text files up to 1 MiB, in UTF-8.
- Files inside the project folder only. A symbolic link is refused: open its target instead.
On a remote project, files and diffs come from the host. There, files and diffs larger than 512 KiB are not opened. See Remote projects.
What’s next
- Review your agents’ work: review a whole layer at once.
- Browser portals: see the web app your agents are building.
- Terminals, notes and shapes: notes are edited the same way as files.