Files
tty7/docs/window/side-panel.mdx
T
l0ng-aiandl0ng-ai b7196ae49a Give the side panel's Info tab rows that do what they show (#531)
* feat(right-panel): give the Info tab rows that do what they show

The panel's Session table rendered every fact the same inert way, and its
two actions sat in a strip of their own under the whole list — unlabelled,
four rows below the path they acted on. Rows now carry their own shape:
`changes` is the sidebar's green-and-red `+N −M` and opens the same diff
overlay under the same setting, an agent wears the same status dot its tab
does, and what a row can do appears at the end of it on hover, in the strip
Source Control rows already use. A port row hands over its address instead
of leaving it to be retyped, and the lit panel tile closes the panel the way
every other activity bar does.

* fix(right-panel): answer for the row the pointer is actually on

Review of #531 found the new rows promising more than they could keep.

Port rows keyed their element id on the port alone, but a port is only
unique with its pid — a pre-forking server puts one row per worker on
screen, and gpui handed them a single interactive state, so a click on
one lit the tooltip and the pressed fill on all of them.

The `changes` counts were read off `Tab::git_status`, which resolves a
split tab to its *first* leaf, while the click target came from
`detail_pane`, which resolves it to the *last focused* one. Inert text
could disagree harmlessly; a button could not, and clicking `+2 −0`
opened another pane's repository. Both now come from the pane the rest
of the rows describe.

A port is only `localhost` if localhost reaches it. `lsof`'s bind
address was parsed and dropped, so a server on `172.17.0.1:8080` was
offered as `localhost:8080` — a refused connection, or somebody else's
service. `PortEntry` carries the address (`serde(default)`, so an older
daemon still answers), and the wildcard and loopback binds keep the
`localhost` spelling anyone would type.

The browser tile hung off `remote_context()` — where the *shell* is —
though the ports come from the pane's own process tree either way. It
hid the tile on the one pane where it works, a `ssh -L` forward listening
on this machine. It is about the host now.

The action strip is opaque and pinned to the row's right edge, so on the
working-directory row it covered the leaf that the head-first elision
exists to preserve. The value holds that width back for good rather than
on hover: taking it on hover would re-elide the path under the pointer,
which is the pixel-shifting the strip is absolutely positioned to avoid.

Also: the counts were `flex_1`, so the whole rest of the line was the
button and empty space underlined numbers it was nowhere near; the agent
pip was pinned in pixels inside rem-sized text and slid off its line at
any interface scale but 100%, and drew Waiting as a thin ring where the
tab strip punches a hole in a filled dot — one rule, two dialects; the
panel-toggle chrome tile, which on macOS lives inside the panel it
closes, still dropped focus into the destroyed element and left ⌘J
dead; and `scm/detail.rs` kept a third copy of `ROW_INSET`.

---------

Co-authored-by: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com>
2026-08-12 09:58:47 +08:00

78 lines
3.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "The side panel"
description: "Info, Source Control, and Files — plus the built-in editor."
---
<kbd>⌘ J</kbd> opens a panel on the right of the window with three tabs. It is
hidden by default; whichever tab you leave it on is where it opens next time.
The three icons at the top switch tabs, and clicking the lit one puts the panel
away again.
<Frame caption="Placeholder — screenshot: the side panel showing the Info tab beside a terminal">
<img src="/images/placeholder.svg" alt="The tty7 side panel" />
</Frame>
## Info
Everything tty7 knows about the focused pane, in one column:
| Section | What it shows |
|---|---|
| **Session** | working directory, shell, SSH connection, git branch, `+N M` changes, and the coding agent with its status (idle / working / waiting / done) |
| **Processes** | the process tree inside the pane, with the foreground process marked |
| **Ports** | every port those processes are listening on |
Hovering a row shows what it can do at the right-hand end of it: **Copy** on the
working directory, the SSH host and the branch, and **Reveal in Finder** / **Open
Folder** alongside it on a working directory this machine can see. The `+N M`
counts open the [diff overlay](/git/diffs), the same click the sidebar's counts
answer to — and the same **Settings → Window & Tabs → Open diff preview from
sidebar counts** turns both of them back into plain text.
The ports section is the quickest answer to "what is this pane serving, and
where" — the same data `tty7 procs` prints. A port row copies `localhost:PORT`,
and on a local pane opens it in your browser.
## Source Control
The git panel for the focused pane's repository, in four groups — **Merge
Changes**, **Staged Changes**, **Changes**, **Untracked**. Write a message,
commit, and push without leaving the window.
[Source control →](/git/source-control)
## Files
A file tree rooted at the pane's working directory, with git status decorations
on every row and a search box at the top. The search box carries a clear button
while there is something in it.
- **Click a file** to open it in the built-in editor.
- **Drag a file out** to Finder or Explorer to copy it there.
- **Drag files in** from the desktop to copy them into the folder under the
cursor. A folder row takes them itself, a file row stands in for the folder
holding it, and the empty space below the tree means the top of it. Folders
come in whole, the executable bit survives, and a name that is already taken
is asked about rather than replaced.
Both directions work over a [remote workspace](/remote/workspaces) too, reading
on one machine and writing on the other, up to the size one control frame can
carry — past that the panel tells you to use [SFTP](/remote/sftp).
## The editor
<kbd>⌘ ⇧ E</kbd> toggles the code panel; clicking a file in the Files tab opens
it there. It is a real editor — syntax highlighting, line and column readout,
wrap toggle, and a Markdown preview — meant for the edit you would otherwise
have opened `vim` for.
| | |
|---|---|
| <kbd>⌘ S</kbd> | Save |
| <kbd>Esc</kbd> | Back to the terminal |
Files are watched on disk: a change underneath you is picked up, and closing
with unsaved edits asks before discarding them. Files over 4 MB and anything
that looks binary are refused with a note rather than opened badly.