Archived
Add c to copy the selected path, split key bar into groups
c copies the absolute directory of the selected submodule via OSC 52. Keys are grouped into navigation (footer left), global (footer right) and submodule (detail pane palette, footer if the pane can't show it). Adds a key reference table to the UX guide. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -31,7 +31,7 @@ internal/tui/ Bubble Tea application
|
||||
tree/ tree component: rows, navigation, mouse, view
|
||||
detail/ detail pane; changes.go: change preview
|
||||
header/ header line
|
||||
footer/ help and flash messages
|
||||
footer/ key bar (navigation left, global right) and flash messages
|
||||
```
|
||||
|
||||
### Layering rules
|
||||
@@ -64,6 +64,12 @@ type Watcher interface {
|
||||
}
|
||||
```
|
||||
|
||||
```go
|
||||
type Locator interface {
|
||||
Dir(path string) string // absolute directory, "" if unknown
|
||||
}
|
||||
```
|
||||
|
||||
- `Tree` returns the superproject and all submodules with `Parent` and
|
||||
`Children` linked. `Status` fields are nil.
|
||||
- `Status` is called once per submodule, concurrently. It must be safe to
|
||||
|
||||
@@ -200,3 +200,21 @@ package so versions stay clean.
|
||||
corrupt or partial downloads, not a compromised registry (no signatures).
|
||||
The update check is a deliberate, outside-the-provider network use: only
|
||||
on `update` and a once-a-day background check that can be disabled.
|
||||
|
||||
## Copy path with `c` via OSC 52
|
||||
|
||||
`c` copies the selected submodule's absolute directory (optional
|
||||
`submodule.Locator`; the relative path as fallback). The absolute path is
|
||||
what a shell needs (`cd <paste>`). OSC 52 instead of a clipboard tool
|
||||
(`xclip`, `pbcopy`): no external dependency and it works over SSH. The cost:
|
||||
terminals that block OSC 52 copy nothing silently; the footer still says
|
||||
`copied`, since the application can't know.
|
||||
|
||||
## Key groups: global, navigation, submodule
|
||||
|
||||
Keys that act on the selected submodule (copy path, later checkout, bump) are
|
||||
shown in a palette in the detail pane, next to what they act on; global keys
|
||||
(`?`, `q`) sit right in the footer. Where the pane can't show the palette
|
||||
(hidden below 90 columns, or under 12 lines) the footer shows these keys
|
||||
instead, so small terminals need no extra UI (no overlay or action menu).
|
||||
Keys never depend on what is visible.
|
||||
|
||||
@@ -36,6 +36,21 @@
|
||||
| Detail pane | 40% of the width, at least 36 columns; hidden below 90 columns |
|
||||
| Footer | 1 line (more with full help) |
|
||||
|
||||
### Key bar and palette
|
||||
|
||||
Keys come in three groups (`keyMap.Navigation`, `.Submodule`, `.Global`):
|
||||
|
||||
- **Navigation** (move, fold, toggle): left in the footer.
|
||||
- **Global** (`?`, `q`): right-aligned in the footer, always kept.
|
||||
- **Submodule** (act on the selected one, e.g. `c`): a palette on the last
|
||||
line of the detail pane. It is left out if the pane is shorter than 12
|
||||
lines. Whenever the palette isn't shown (pane hidden or too short), these
|
||||
keys move into the footer after the navigation keys.
|
||||
|
||||
If the footer is too narrow, keys are dropped from the left group's end
|
||||
(submodule keys first); the global keys stay. Full help (`?`) lists all keys
|
||||
in columns, whatever the size. Keys work whether or not they are shown.
|
||||
|
||||
### Tree row
|
||||
|
||||
```
|
||||
@@ -191,6 +206,7 @@ colors in components.
|
||||
| `q`, `ctrl+c` | Quit |
|
||||
| `f` | Fetch all repositories (does nothing while a fetch runs) |
|
||||
| `r` | Reload everything (e.g. after editing files) |
|
||||
| `c` | Copy the absolute directory of the selected submodule to the clipboard (OSC 52, so it also works over SSH; needs terminal support, in tmux `set -g set-clipboard on`). The footer confirms with `copied <path>`. Without a local provider (mock) the path relative to the superproject is copied |
|
||||
| `u`, `b`, `/`, `!` | Planned actions (see requirements) |
|
||||
|
||||
"First child" always means the first child **as displayed** (children are
|
||||
@@ -200,6 +216,32 @@ Collapsing an ancestor of the selection moves the selection to that ancestor.
|
||||
The view scrolls so the selection is always visible; when the first submodule
|
||||
is selected, headers above it are shown too.
|
||||
|
||||
### Key reference
|
||||
|
||||
Every key in the UI, where it is shown, and whether it works. Update this
|
||||
table when a key is added, moved or implemented. "Bar" is the short footer
|
||||
bar, "Palette" the detail pane's palette (the footer takes its keys over
|
||||
where the palette can't be shown, see [Key bar and palette](#key-bar-and-palette)),
|
||||
"Help" the full help (`?`).
|
||||
|
||||
| Key | Action | Group | Shown in | Implemented |
|
||||
|---|---|---|---|---|
|
||||
| `↑` / `k`, `↓` / `j` | Move selection | Navigation | Bar, Help | yes |
|
||||
| `←` / `h`, `→` / `l` | Fold / unfold, parent / first child | Navigation | Bar, Help | yes |
|
||||
| `H` / `⇧←`, `L` / `⇧→` | Collapse / expand all | Navigation | Bar, Help | yes |
|
||||
| `space` | Toggle expand/collapse | Navigation | Bar, Help | yes |
|
||||
| `home` / `g`, `end` / `G` | First / last submodule | Navigation | Help | yes |
|
||||
| `pgup`, `pgdn` | Move by one screen | Navigation | Help | yes |
|
||||
| `c` | Copy path | Submodule | Palette, Help | yes |
|
||||
| `u` | Checkout pin | Submodule | Help | no (flashes "not implemented") |
|
||||
| `b` | Bump pin to tip | Submodule | Help | no (flashes "not implemented") |
|
||||
| `f` | Fetch all repositories | Global | Help | yes |
|
||||
| `r` | Reload everything | Global | Help | yes |
|
||||
| `/` | Filter | Global | Help | no (flashes "not implemented") |
|
||||
| `!` | Problems only | Global | Help | no (flashes "not implemented") |
|
||||
| `?` | Toggle full help | Global | Bar, Help | yes |
|
||||
| `q`, `ctrl+c` | Quit | Global | Bar, Help | yes |
|
||||
|
||||
### Mouse
|
||||
|
||||
- Click a row: select it.
|
||||
|
||||
Reference in New Issue
Block a user