Skip to content

Commit ca06ee1

Browse files
zoza1982claude
andauthored
feat(tui): show the pane's connection in its header (#134)
Each pane's top border now shows which backend it is browsing so a remote pane is instantly distinguishable from the local filesystem. A remote pane renders a full scheme://user@host:path locator (e.g. ssh://root@dietpi6:/home) in a distinct accent color; a local pane shows just its path as before. The pane holds only an opaque ConnectionId; a new AppState::pane_location joins that id against the connections/saved_profiles registries at render time to build the locator, with a graceful path-only fallback when it can't be resolved (archive mounts, not-yet-registered connections). Adds a `remote` theme color role (default yellow) and a `remote-pane` render scenario + snapshots. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1347527 commit ca06ee1

15 files changed

Lines changed: 471 additions & 13 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ lcov.info
4444
# WASM fixture guest build output (the built component is committed under tests/fixtures/).
4545
crates/cairn-plugin/tests/fixture-guest/target/
4646
crates/cairn-plugin/tests/fixture-guest/src/bindings.rs
47+
dist/

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- **Pane connection header**: each pane's top border now shows *which* backend it is browsing, so a
13+
remote pane is instantly distinguishable from the local filesystem. A remote pane renders a full
14+
`scheme://user@host:path` locator (e.g. `ssh://root@dietpi6:/home`, `s3://bucket:/prefix`) in a
15+
distinct accent color (`remote` theme role, default yellow); a local pane shows just its path as
16+
before. The identity is joined at render time from the pane's connection id against the
17+
connection/profile registries, with a graceful path-only fallback when it can't be resolved (e.g.
18+
inside an archive mount). Add `remote = "<color>"` under `[ui.colors]` to recolor it.
19+
1220
- **Test a connection, pin/hide discovered entries** (RFC-0011 P6): the connection switcher
1321
(`Ctrl-O`) gains three new keys. `t` probes the highlighted entry's reachability without opening
1422
it into a pane or switching any pane — it reuses the same vetted per-scheme open path (so a real

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,20 @@ to two transfers run at once by default — set `[transfers] concurrency = N` in
109109
```
110110

111111
Colors can be themed under `[ui.colors]` — override individual roles
112-
(`focused_border`, `unfocused_border`, `dir`, `error`, `status`, `selection_bg`, `selection_fg`) over
113-
the built-in `dark` preset, using color names or `#rrggbb`:
112+
(`focused_border`, `unfocused_border`, `dir`, `error`, `status`, `remote`, `selection_bg`,
113+
`selection_fg`) over the built-in `dark` preset, using color names or `#rrggbb`:
114114

115115
```toml
116116
[ui.colors]
117117
focused_border = "magenta"
118118
dir = "#5fafff"
119+
remote = "yellow" # accent for a pane on a remote backend (SSH/S3/…)
119120
```
120121

122+
Each pane's top border shows which backend it is browsing: a local pane shows just its path,
123+
while a remote pane shows a full `scheme://user@host:path` locator (e.g.
124+
`ssh://root@dietpi6:/home`) in the `remote` accent color, so the two are easy to tell apart.
125+
121126
### Connections
122127

123128
`Ctrl-O` opens the connection switcher — pick a backend to open in the active pane. Docker and

crates/cairn-config/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,9 @@ pub struct UiConfig {
333333
#[serde(default)]
334334
pub keybindings: BTreeMap<String, String>,
335335
/// Theme color overrides on top of the [`theme`](UiConfig::theme) preset: a map of role →
336-
/// color. Roles are `focused_border`/`unfocused_border`/`dir`/`error`/`status`/`selection_bg`/
337-
/// `selection_fg`; color *values must be strings* — names (`"cyan"`, `"bright-blue"`) or
336+
/// color. Roles are `focused_border`/`unfocused_border`/`dir`/`error`/`status`/`remote`/
337+
/// `selection_bg`/`selection_fg`; color *values must be strings* — names (`"cyan"`,
338+
/// `"bright-blue"`) or
338339
/// `#rrggbb`. Unknown roles, unparseable colors, and an unknown `theme` preset are ignored with a
339340
/// warning (the dark preset is used).
340341
#[serde(default)]

crates/cairn-core/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ pub use state::{
2020
detect_file_kind, visible_connection_indices, ActiveTransfer, AppState, ArchiveFormat,
2121
ChoiceProvenance, ChoiceStatus, ConnectionChoice, ConnectionFormStage, ConnectionKind,
2222
ContentHash, DiscoverySource, FieldValue, FileKind, Listing, LogViewerId, LogViewerStatus,
23-
MaskedInput, MountFrame, Overlay, PagerId, PagerMode, PagerStatus, PaneState, PendingSave,
24-
PromptKind, QueuedTransfer, RemoteEditId, RemoteVersion, SessionEnd, SessionRecord,
25-
ShellActionMeta, Side, SortMode, TransferId, WritebackChoice, WritebackConflictReason,
26-
LOG_VIEWER_MAX_BYTES, LOG_VIEWER_MAX_LINES, PAGER_HEX_ROW_BYTES, PAGER_MAX_BYTES,
27-
REMOTE_EDIT_MAX_BYTES, SESSION_OUTPUT_MAX_BYTES, SESSION_OUTPUT_MAX_LINES,
23+
MaskedInput, MountFrame, Overlay, PagerId, PagerMode, PagerStatus, PaneLocation, PaneState,
24+
PendingSave, PromptKind, QueuedTransfer, RemoteEditId, RemoteVersion, SessionEnd,
25+
SessionRecord, ShellActionMeta, Side, SortMode, TransferId, WritebackChoice,
26+
WritebackConflictReason, LOG_VIEWER_MAX_BYTES, LOG_VIEWER_MAX_LINES, PAGER_HEX_ROW_BYTES,
27+
PAGER_MAX_BYTES, REMOTE_EDIT_MAX_BYTES, SESSION_OUTPUT_MAX_BYTES, SESSION_OUTPUT_MAX_LINES,
2828
};
2929
pub use update::{initial_effects, update, VAULT_PASSPHRASE_MIN_LEN};

0 commit comments

Comments
 (0)