Repository navigation
Scroll the Tailscale machine list independently of the panel - #7332
andrepadez wants to merge 5 commits into
Conversation
On a tailnet with more than a handful of machines the whole panel scrolls to reach them, which pushes the hero and the CONNECTIONS and EXIT NODES sections off the top. Reaching a machine means losing sight of the on/off switch and the account switcher. Give the machine list its own Flickable, capped at Style.space(260) — about five rows — so those sections stay in view while only the machines move. The cap applies only when it is needed: implicitHeight is min(content, max), so a tailnet with three machines still renders as a short panel, and the list keeps `interactive: contentHeight > height` so it stays inert when everything fits. scrollItemIntoView() took a single hardcoded scroller. Keyboard navigation in the peers section would otherwise scroll the panel rather than the list, leaving the highlighted row hidden inside a list that never moved, so it now takes the target scroller and defaults to the panel. Peer navigation brings the list into view first, then the row within it.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adjusts the Tailscale panel’s “Machines” section to scroll independently and improves keyboard focus scrolling behavior so focused peers are actually revealed.
Changes:
- Extend
scrollItemIntoViewto optionally target a specificFlickable(inner vs outer scroller). - Update cursor scrolling to first reveal the peers list container, then scroll within the peers list.
- Wrap the peer list in a capped-height
Flickablewith its own scrollbar.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if (focusSection === "peers" && peerColumn && peerIndex >= 0 && peerIndex < peerColumn.children.length) { | ||
| // Bring the machine list itself into view first, then the row within it — | ||
| // otherwise the row scrolls inside a list that is still off-screen. | ||
| scrollItemIntoView(peerFlick) | ||
| scrollItemIntoView(peerColumn.children[peerIndex], peerFlick) | ||
| } |
| readonly property real maxPeerListHeight: Style.space(260) | ||
| implicitHeight: Math.min(peerColumn.implicitHeight, maxPeerListHeight) | ||
| height: implicitHeight |
|
Thanks — both fair points, with a caveat on each. On
Changing only the peers one here would leave the file inconsistent, so I've left it alone rather than half-convert it. Happy to do all four as a separate PR if you'd like it fixed — it's a real latent issue, just a wider one than this change. On One wrinkle on deriving it from available panel height: the panel's height is already Deriving from screen height, or a shared |
Since quattro builds panel content on first open (omacom#15044), ids inside `content` are invisible to root-level code. `scrollCursorIntoView()` names `peerFlick` from the root, so on the merged tree j/k through the machines threw a ReferenceError and the highlighted row never scrolled into view. Mirror it through `panel.loadedContent` like the panel's other scrollers. The lazy-content test now fails any first-party panel whose root-level code names an id that lives only inside its content, since that error surfaces only when the code runs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Opening the panel resets the panel's scroller to the top. The machine list now scrolls on its own, so it kept wherever the last visit left it, and a reopened panel showed the list mid-way with the first machines hidden. Reset it alongside the panel's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Omarchy's test rules rule both out: the tailscale assertion greps the source for the line it guards, and the lazy-content id analysis is out of proportion to a two-line adaptation. Both fixes were proven on a worker instead: the unadapted merge logs `ReferenceError: peerFlick is not defined` on every j into the machine list, and without the reset a reopened panel shows the list mid-scroll. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Reviewed at 39476ea, merged with current Pushed to this branch
What was checked, on the VM at this head
Still open With 2 connections and 2 exit nodes, the panel's content is still about 40px taller than the panel's height limit ( This is the 260 question raised in the description. A value or derivation that keeps the hero, the sections and the list within the panel's height would close it, and summing the sibling sections' heights rather than reading |
[Low impact] The changes stay within the Tailscale panel. The PR appears safe to merge, with a non-blocking keyboard visibility issue on short displays or with large theme spacing. Findings
SummaryThe Tailscale machine list now scrolls separately and grows only up to
Reviews (1) · Last reviewed commit: "Drop the tests added beside the merge ad..." · Reviewed by Greptile |
| scrollItemIntoView(peerFlick) | ||
| scrollItemIntoView(peerColumn.children[peerIndex], peerFlick) |
There was a problem hiding this comment.
If a short screen or large theme spacing makes peerFlick taller than panelFlick, keyboard navigation can leave the selected machine hidden. The outer call tries to reveal the whole list and aligns its bottom, while the inner call can leave the selected row at the list’s clipped top. Limit the list height to the available space, or reveal the selected row in the outer scroller after scrolling the inner list.
|
A second opinion has now reviewed 39476ea: Codex Medium and muse-spark-1.3-contributor (via pi, thinking high). Neither found a defect in the lazy-content exposure, the reset on open, the deferred keyboard scrolling or the copy and Taildrop paths, and both found no binding loop between the list and the panel. Both agree with the open point above and put it more sharply: it is about how the space is divided, not about the 260 value. Entering the list calls Smaller, from muse: when both scrollers can move, two scrollbars show, and the inner one sits over the row's copy button. Reopening the panel now resets the list as well as the panel, which is what this pull request intends, but it means the panel no longer keeps its scroll position across a close, which The reviewers read this session's earlier findings, so their agreement is not guaranteed to be independent. Nothing new was pushed. Still waiting on the maintainer for how the list should be sized. |
Problem
On a tailnet with more than a handful of machines, the Tailscale panel scrolls as one piece. Reaching a machine near the bottom pushes the hero — and with it the on/off switch — plus the CONNECTIONS and EXIT NODES sections off the top of the panel.
So the two things you are most likely to want while looking at a machine (toggling Tailscale, switching account) are exactly the things that scroll away. On the tailnet I tested with (14 online peers) the hero is gone before the fifth machine.
Change
Give the machine list its own
Flickable, capped atStyle.space(260)— about five rows — so the sections above it stay put while only the machines move.Two details worth calling out:
The cap applies only when it is needed.
implicitHeightismin(peerColumn.implicitHeight, maxPeerListHeight), so a tailnet with three machines still renders as a short panel rather than reserving five rows of empty space. The list also keepsinteractive: contentHeight > height, matching 51075ce ("Make sure we never get in-panel scrolling when we shouldn't") — it stays inert when everything fits.Keyboard navigation needed the scroller passed explicitly.
scrollItemIntoView()addressedpanelFlickdirectly. Left as it was,j/kthrough the peers would scroll the panel rather than the list, leaving the highlighted row hidden inside a list that never moved. It now takes the target scroller and defaults to the panel, and peer navigation brings the list into view first, then the row within it.The outer panel scroller is untouched and still handles the panel as a whole outgrowing the screen.
Verification
test/shell— 815 pass. The single failure isomarchy-pkgs checkout found for PKGBUILD coverage, which is a missing sibling checkout in my environment and unrelated to this change.j/kpast the fifth machine keeps the highlighted row visible.shell/plugins/panels/tailscale/Panel.qmlis identical between the commit I developed against and currentquattro.Open question
Style.space(260)is a chosen number rather than a derived one. Five rows felt right against the rest of the panel's proportions, but it is a design call and I have no attachment to it — happy to change the value, derive it from the panel height, or expose it through the plugin's existingschemablock alongsiderefreshIntervalSecif you would rather it be configurable.