Code Viewer

Trinity has a built-in Code viewer, accessible from the sidebar. It's a read-only code browser for your project's repositories — browse files, switch branches, read code with syntax highlighting, walk the commit history, see what any commit changed, and blame any line. It never touches your working code or an active run, so you can safely browse a branch even while it's being worked on.

Opening It

Click Code in the project sidebar. The viewer opens as a full-window workspace:

  • Repo tabs (top left) — switch between repositories when your project has more than one.
  • Branch picker (top right) — choose any branch. Your branches are grouped under Branches, with a Local group for anything tracked separately.
  • Fetch — pull the latest commits and branches from your remote. The viewer also refreshes on its own every few minutes and when you first open it, so a branch you just pushed shows up.

A breadcrumb under the toolbar shows where you are — the repo and the path to the file you're reading.

Browsing Files

The left sidebar shows the file tree. Click a folder to expand it; click a file to open it.

  • Single-click opens a file as a preview tab (shown in italics) that's reused as you click around — handy for quickly scanning files.
  • Double-click pins the file in its own tab so it stays open.

Open files appear in a tab strip above the editor, just like a code editor. Use the chevrons to scroll through tabs when you have many open, and press Cmd/Ctrl+W to close the active tab.

Finding a file fast

Press Cmd+P (or Ctrl+P) to open the file finder. Start typing any part of a file's name or path and press Enter to jump straight to it — no clicking through folders.

Syntax highlighting

Files render with full syntax highlighting that matches your Trinity light or dark theme, across dozens of languages — TypeScript, JavaScript, Rust, Go, Python, Java, Kotlin, Swift, Ruby, PHP, shell, SQL, CSS, YAML, TOML, Markdown, and more. Use Ctrl+F to search within the open file.

Markdown preview

When you open a Markdown or MDX file, a Raw / Preview toggle appears. Preview renders the document the way it's meant to look — headings, lists, tables, links — while Raw shows the source. The viewer always opens files as Raw and resets when you switch files.

Images and PDFs

Open an image (PNG, JPG, GIF, WebP, SVG, and more) or a PDF and the viewer renders it inline instead of showing a "binary file" message. Other binary files — archives, fonts, compiled output — still show a placeholder, since there's nothing meaningful to display.

Commit History

Switch the left sidebar from Files to History to see the branch's commit history laid out as a graph. Each commit shows its message, author, and time, and hovering a commit reveals the full message along with a summary of how many files it changed and the lines added and removed. Scroll back through history and use Load more to pull in older commits.

Seeing what a commit changed

Click any commit to open its diff in the main panel. You'll see each file the commit changed, with the before-and-after content side by side, the change type (added, modified, deleted, or renamed), and the lines added and removed per file. Merge commits are clearly badged so you know you're looking at what the merge introduced.

Blame

When a file is open, click Blame in the toolbar to turn on the blame gutter. Each line shows the commit that last changed it and who wrote it, right alongside the code. Lines you authored are highlighted and labelled you, so your own work stands out at a glance. Blame turns off automatically when you switch to another file.

Keyboard Shortcuts

Shortcut Action
Cmd/Ctrl+P Find a file by name
Ctrl+F Search within the open file
Cmd/Ctrl+W Close the active tab

Tips

  • The viewer is read-only — it's for reading and reviewing, not editing. To change code, run a story.
  • Use History plus a commit's diff to review exactly what a run produced before you merge or release.
  • Browsing here is completely separate from execution, so you can read any branch without interrupting a run that's using it.