History

feat(environments): draw each environment as the machine it runs on (#9299)

Julius Marminge committed 2 months ago

Commit 0fbb9421 parent d89764132 files · +1222 −84Browse files

Showing the changes to docs (2 of 32 files). Show all

Unified · Split

2 files
  1. docs/internals/remote.md +17 −0
  2. docs/user/thread-sidebar.md +15 −0
docs/internals/remote.md+17−0
@@ -224,6 +224,22 @@ right action without making the transport responsible for process management. Th · 223 unmodified lines
224224 supervisor owns the resulting disconnect and reconnect like any other involuntary close. See
225225 [server-updates.md](./server-updates.md).
226226
227+## Machine identity
228+
229+Every environment is drawn with one of a fixed set of machine glyphs (`EnvironmentMachineKind` in
230+contracts: server, cloud, desktop, laptop, mac-mini, mac-studio). Two inputs feed it, and the
231+precedence lives in one helper, `resolveEnvironmentMachineKind`, so web and mobile cannot drift:
232+
233+1. `settings.environmentIcon`, a nullable server setting the user picks in Settings → Connections.
234+ It is server state rather than client state so every device connecting to that server agrees.
235+2. `environment.platform.machine`, detected once at startup by [ServerEnvironmentMachine.ts][machine]
236+ (IOKit product name / `hw.model` on macOS, `/sys/class/dmi/id` on Linux with virtualization
237+ markers mapped to "cloud"). Absent when there is no signal, so older servers, Windows hosts, and
238+ containers decode without it.
239+3. A generic server otherwise.
240+
241+Clients treat the field like any other capability: absent means "use the fallback", never "wait".
242+
227243 ## Future work
228244
229245 These remain unbuilt and are listed to keep the model honest:
@@ -237,3 +253,4 @@ These remain unbuilt and are listed to keep the model honest: · 7 unmodified lines
237253 [authremote]: ../../packages/client-runtime/src/authorization/remote.ts
238254 [sshenv]: ../../apps/desktop/src/ssh/DesktopSshEnvironment.ts
239255 [sshtunnel]: ../../packages/ssh/src/tunnel.ts
256+[machine]: ../../apps/server/src/environment/ServerEnvironmentMachine.ts
docs/user/thread-sidebar.md+15−0
@@ -53,6 +53,21 @@ The main sidebar, right panel, and terminal drawer open and close immediately by · 52 unmodified lines
5353 The duration can be set up to 400 ms. Clicking the preview replays all three panel transitions; at
5454 0 ms, it snaps between the same open and closed states.
5555
56+## Environment icons
57+
58+When you are connected to more than one environment, every thread that lives somewhere other than
59+the machine you are on wears a small icon for that machine at the end of its row: a server, a cloud
60+VM, a desktop, a laptop, a Mac mini, or a Mac Studio. In the hosted web app and the mobile app,
61+where every environment is remote, each row wears its machine so you can tell them apart at a
62+glance. The same icon appears in the thread tooltip, the "Run on" picker, the pull request server
63+filter, and the environment lists under **Settings → Connections**.
64+
65+Servers pick the icon themselves from the hardware they run on. A Mac reports its model, a Linux
66+machine reports its chassis type and whether it is a virtual machine, and anything without a usable
67+signal shows a generic server. To override it, open **Settings → Connections** and choose an icon
68+for that environment; **Automatic** goes back to what the server detected. The choice is stored on
69+that server, so every device that connects to it sees the same icon.
70+
5671 ## Environment artwork
5772
5873 Dev and Nightly environments can identify themselves with artwork at the top of the sidebar and in

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t