Skip to content

Simplify UX: 3 sections, Space action menu, real tunnel status#9

Merged
rekurt merged 16 commits into
masterfrom
claude/simplify-ux-design-Y2TXv
May 2, 2026
Merged

Simplify UX: 3 sections, Space action menu, real tunnel status#9
rekurt merged 16 commits into
masterfrom
claude/simplify-ux-design-Y2TXv

Conversation

@rekurt
Copy link
Copy Markdown
Owner

@rekurt rekurt commented May 1, 2026

Summary

Reshapes the TUI from 7 fullscreen modes + 3 detail tabs + 6 scattered
action keys into 3 top-level sections with Tab navigation and a
single Space-key action menu. Removes Chart and Namespaces, fixes the
hardcoded "alive" tunnel status, and adds tunnel edit-mode + inline
form validation.

Section model

Tab / Shift+Tab cycles between three sections. Sub-tabs use [ / ].

Section Default Sub-tabs
Connections port table + unified Details panel
Processes process detail (CWD, env, files, tree) Detail ⇄ Topology
SSH hosts + active tunnels in one place Hosts ⇄ Tunnels

Action menu (Space)

Single contextual popup replaces six scattered shortcuts (b, t, F,
p, plus the previous fullscreen toggles 49):

  • Kill / Copy line / Copy PID / Block IP / Trace syscalls / SSH forward
  • Items filter by capability (Block/Forward hidden when no remote addr)
  • Direct shortcuts kept only for K (Kill) and c (Copy)

SSH improvements

  • TunnelStatus { Starting, Alive, Failed } — failed tunnels stay in the
    list (red) until you act, instead of silently disappearing
  • Edit-mode (e) re-opens the form with all fields pre-filled and
    replaces the tunnel in place on submit
  • Inline per-field validation — bad fields turn red as you type
  • Esc on a non-empty form requires a second press within 1.5s
    (mirrors the new filter-clear cascade)
  • save prunes failed tunnels before writing config

Other changes

  • Esc cascade: closes the topmost modal/overlay; clearing a non-empty
    filter now requires a second press inside 1.5s
  • Sort moves off Tab onto o (next column) / O (reverse direction)
  • Help cheat-sheet regrouped by section (Global / Connections /
    Processes / SSH)
  • Bottom Details panel collapses three tabs (Tree / Network / Connection)
    into one unified scrollable view
  • Section breadcrumb in the header shows the active section
  • Updated README.md / README.ru.md / README.zh.md / CHANGELOG.md / CLAUDE.md

Removed

  • Chart fullscreen view (4)
  • Namespaces fullscreen view (7) and the prt_core::core::namespace module

Test plan

  • cargo build --workspace — clean
  • cargo test --workspace — 220 tests pass (was 188, +28 new for
    ViewMode/sub-tabs/ActionMenu/tunnel-form/edit-mode; –7 from the
    removed namespace module and DetailTab cycling tests)
  • cargo clippy --workspace --all-targets — clean
  • cargo fmt --all -- --check — clean
  • Manual TUI smoke (run on host with real SSH config):
    • Tab/Shift+Tab cycles 3 sections; selection persists
    • [/] toggles Detail/Topology and Hosts/Tunnels
    • Space opens the action menu, items match the section, Enter executes
    • K / c still work as direct shortcuts; b/t/F/p no longer top-level
    • o/O sort the table; Tab no longer touches sort
    • /foo then Esc → "Esc again to clear filter"; second Esc clears
    • New tunnel form: invalid port shows red highlight + error text in real time
    • e on a tunnel re-opens form with values; Enter respawns
    • Tunnels list shows green/yellow/red statuses; failed tunnels persist
    • ? shows the new grouped cheat-sheet

https://claude.ai/code/session_01EG1UvuuvbDQQsqXnhrjpvL


Generated by Claude Code

claude and others added 16 commits May 1, 2026 19:02
Bar-chart of connections per process duplicated information already
visible via sort + Topology view. Removing it simplifies the view-mode
enum and frees up keybinding 4.

https://claude.ai/code/session_01EG1UvuuvbDQQsqXnhrjpvL
Linux netns grouping was a niche feature that complicated the UI for the
common case. The view, App::namespace_cache, refresh_namespace_cache,
and the prt-core::core::namespace module are all removed.

https://claude.ai/code/session_01EG1UvuuvbDQQsqXnhrjpvL
The bottom panel showed three tabs (Tree / Network / Connection) that
each rendered partial slices of the same selected entry. The new panel
combines local addr + protocol + bind type + interface + remote + state
+ process + cmdline + multi-port summary + process tree in one scroll
view, removing the need for tab switching and the 1/2/3 + ←/→ + h/l
key bindings.

https://claude.ai/code/session_01EG1UvuuvbDQQsqXnhrjpvL
ViewMode shrinks from { Table, Topology, ProcessDetail, SshHosts, Tunnels }
to { Connections, Processes, Ssh }. Topology and ProcessDetail are now
sub-tabs of Processes; SshHosts and Tunnels are sub-tabs of Ssh.

- Tab / Shift+Tab cycles top-level sections.
- [ / ] cycle sub-tabs inside Processes and SSH.
- Sort moves from Tab/Shift+Tab to o/O so Tab is free for navigation.
- Header gains a section breadcrumb with the active section highlighted.
- Footer hints regroup per section; old hint_views/block/trace/forward/
  ssh_hosts/tunnels strings drop out.

Section labels added to i18n: section_connections, section_processes,
section_ssh, hint_section_next, hint_subtab, hint_action_menu, hint_edit_tunnel.

https://claude.ai/code/session_01EG1UvuuvbDQQsqXnhrjpvL
Replaces the scattered top-level shortcuts (b=block, t=trace, F=forward,
p=copy-pid) with a single contextual popup. Direct shortcuts remain only
for Kill (K) and Copy (c).

The menu is built from the current section + entry capabilities:
- Connections: Kill, Copy, Copy PID, Block IP, Forward, Trace
  (Block/Forward only when remote_addr is present)
- Processes:   Kill, Copy, Copy PID, Trace
- SSH:         not opened — that section uses its own action keys

Navigation: j/k or arrows, Enter to execute, Esc to close, 1..9 jumps.

i18n adds action_menu_title + action_kill/copy/copy_pid/block/trace/forward
across en/ru/zh.

https://claude.ai/code/session_01EG1UvuuvbDQQsqXnhrjpvL
Single-press Esc no longer wipes a non-empty filter. The first press
shows 'Esc again to clear filter' in the status bar and arms a 1.5s
window. A second press inside the window clears the filter; any other
key disarms.

This stops accidental filter loss when chaining Esc to close modals.
i18n adds esc_again_to_clear_filter and esc_again_to_discard_form
(latter wired in commit 7 for the tunnel form).

https://claude.ai/code/session_01EG1UvuuvbDQQsqXnhrjpvL
- TunnelStatus { Starting, Alive, Failed } replaces hard-coded "alive".
  ForwardManager::cleanup() now refreshes each tunnel's last_status
  instead of dropping dead ones, so failures stay visible until the user
  acts. Status renders in green/yellow/red.
- Tunnel form gains edit-mode (TunnelFormState::edit) wired to the new
  'e' shortcut in the tunnels view; Enter then replaces the tunnel
  in-place via ForwardManager::replace_at.
- Real-time per-field validation (validate_field) highlights bad fields
  in red as the user types, instead of only on Enter.
- Esc on a non-empty form now requires a second press within 1.5s
  ("Esc again to discard changes"), preventing accidental data loss.
- save_tunnels prunes failed tunnels before writing config.

i18n adds tunnel_status_starting/failed, tunnel_form_edit_title,
tunnel_form_field_required across en/ru/zh.

https://claude.ai/code/session_01EG1UvuuvbDQQsqXnhrjpvL
The ? overlay is now organised into Global / Connections / Processes /
SSH blocks reflecting the new Tab-driven navigation. Drops obsolete
mentions of bottom-panel tab keys (1/2/3, ←→), fullscreen toggles
(4/5/6/7/8/9), and the per-action top-level shortcuts (b, t, F, p),
all of which moved into the Space action menu.

https://claude.ai/code/session_01EG1UvuuvbDQQsqXnhrjpvL
Rewrites the Hotkeys, Detail Panel / Sections, and SSH-related sections
across README.md / README.ru.md / README.zh.md and crates/prt/README.md
to match the new model: Tab/Shift+Tab between Connections/Processes/SSH,
[/] for sub-tabs, Space for the action menu, two-press Esc to clear
filter, edit-mode + inline validation for tunnels.

CHANGELOG gains an [Unreleased] block summarising the breaking changes
and new features. CLAUDE.md drops mentions of namespaces and DetailTab
and points at the new ViewMode + ProcessesTab/SshTab/ActionItem types.

https://claude.ai/code/session_01EG1UvuuvbDQQsqXnhrjpvL
CI was failing on `-D warnings` because two newer lints fire on Rust
1.95 but not 1.94 (the local toolchain):

- `clippy::collapsible_match`: the Esc cascade was an inner `if`
  inside a match arm; collapse it into a guard on the arm itself.
- `clippy::unnecessary_map_or`: `opt.map(...).unwrap_or(false)` is
  now flagged in favour of `opt.is_some_and(...)`.

https://claude.ai/code/session_01EG1UvuuvbDQQsqXnhrjpvL
The new command palette had the same nested-if-in-match pattern that
already failed CI in input.rs. Collapse it into a guarded match arm
so clippy stops complaining on Rust 1.95.

https://claude.ai/code/session_01EG1UvuuvbDQQsqXnhrjpvL
@rekurt rekurt merged commit 6fb1bf6 into master May 2, 2026
3 checks passed
@rekurt rekurt deleted the claude/simplify-ux-design-Y2TXv branch May 2, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants