mirror of
https://github.com/nicolargo/glances.git
synced 2026-09-30 22:15:10 -04:00
Closes gap #2 of the v4 -> v5 parity inventory: v5 handled 15 of v4's 62 hotkeys and had no per-plugin visibility keys at all. It now handles the whole SHOW/HIDE family. A cloud-less amps C cloud d diskio D containers f fs+folders G gpu I ip K connections l alert n network N now P ports Q irq r smart R raid s sensors V vms W wifi z processes 7 npu 8 mpp 2 left sidebar 3 quicklook 5 top row Mechanism: a fourth `_HOTKEYS` action kind, `hide`, whose value is always a tuple of plugin names, so a compound key (`f` -> fs+folders, `z` -> the three process blocks) and a slot-wide key (`2`, `5`) are not special cases. The tuple flips as a unit keyed on its first member, so a compound key can never land half-hidden. State lives in `ViewState.hidden_plugins`. The renderer now hides a block on the UNION of two authorities: the user's set, and the `hide_<plugin>` keys the width-degradation cascades write. They are deliberately separate namespaces -- the cascade rebuilds its keys every cycle, so a user choice stored there would be clobbered by the next fit, and a user-hidden block would make the cascade believe it had already spent that step. Reading both also collapsed the seven hardcoded per-plugin `if` statements in `build_frame` into one `hide_{plugin_name}` lookup. The count in the roadmap said 23. It is 24: `C` (disable_cloud) is missing from Part 3 of the parity inventory entirely, and `r` (disable_smart) is filed there under MISCELLANEOUS though it is a visibility toggle. Conversely `e` (extended stats) is listed under SHOW/HIDE but needs the process cursor, so it stays with 2.X-b. Part 3 is not amended here -- it is a dated snapshot and deserves its own pass. Roadmap section 10 is corrected. Three divergences from v4, all forced by v5's architecture and all release-note material: - A config-disabled plugin is never instantiated in v5, so its hotkey is a visible no-op. This is most apparent on `Q`/irq, which is opt-in in v4. - `z` hides the process blocks but does not stop the shared `glances_processes` engine: v5 shares it with the REST API and the WebUI, and a TUI keypress must not blank /api/5/processlist for every other consumer. - `2` is expanded to its slot members, so `2` then `n` then `2` leaves network visible. v4's own `5` already behaves this way. `r` follows the v4 code (disable_smart), not the v4 docs, which mislabel it "Reset history" -- a v4 documentation bug, untouched here. 46 tests added, including a 24-case key sweep, a drift guard that every `hide` tuple names a real slot member, and one case per cascade key so the collapsed `if` chain is proven equivalent rather than merely plausible. Three mutation runs confirm the new tests bite. Verified live against real plugins, both through a pty and headlessly at frame level. Design: docs/superpowers/specs/2026-09-21-glances-v5-tui-show-hide-toggles-design.md Plan: docs/superpowers/plans/2026-09-21-glances-v5-tui-show-hide-toggles.md Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PW4fwSR6ceSmETznbLExNK