Skip to content

Scroll the Tailscale machine list independently of the panel - #7332

Open
andrepadez wants to merge 5 commits into
omacom:quattrofrom
andrepadez:pr-peer-scroll
Open

andrepadez wants to merge 5 commits into
omacom:quattrofrom
andrepadez:pr-peer-scroll

Conversation

@andrepadez

Copy link
Copy Markdown
Contributor

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 at Style.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. implicitHeight is min(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 keeps interactive: 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() addressed panelFlick directly. Left as it was, j/k through 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 is omarchy-pkgs checkout found for PKGBUILD coverage, which is a missing sibling checkout in my environment and unrelated to this change.
  • Ran in the live shell as a third-party plugin built from this branch, on a 14-peer tailnet across three monitors: the machine list scrolls on its own, the sections above stay fixed, and j/k past the fifth machine keeps the highlighted row visible.
  • No drift: shell/plugins/panels/tailscale/Panel.qml is identical between the commit I developed against and current quattro.

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 existing schema block alongside refreshIntervalSec if you would rather it be configurable.

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.
Copilot AI balanced review requested due to automatic review settings August 18, 2026 00:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 scrollItemIntoView to optionally target a specific Flickable (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 Flickable with its own scrollbar.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +290 to +295
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)
}
Comment on lines +714 to +716
readonly property real maxPeerListHeight: Style.space(260)
implicitHeight: Math.min(peerColumn.implicitHeight, maxPeerListHeight)
height: implicitHeight
@andrepadez

Copy link
Copy Markdown
Contributor Author

Thanks — both fair points, with a caveat on each.

On peerColumn.children indexing: agreed that Repeater.itemAt() is the right API. Worth noting this line is unchanged from quattro — the PR only adds the scroller argument to the existing call. The same .children[...] pattern is used in four places in this file:

  • scrollCursorIntoView() for peers and for exit nodes
  • scrollMullvadRegionCursorIntoView()
  • openSelectedPeerCopyMenu()

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 maxPeerListHeight: agreed it's a magic value, and I flagged it in the description as the weak spot.

One wrinkle on deriving it from available panel height: the panel's height is already fittedContentHeight(column.implicitHeight, Style.space(560)), and column contains this Flickable. Making the cap depend on panel height would make peerFlick.implicitHeight depend on something that depends on peerFlick.implicitHeight — a binding loop.

Deriving from screen height, or a shared Style constant as suggested, both avoid that. My preference would be whichever fits the codebase's conventions best; happy to push either, or to expose it through the plugin's existing schema block alongside refreshIntervalSec so it's user-tunable. Just say which.

omarchybot and others added 4 commits October 22, 2026 13:46
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]>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 39476ea, merged with current quattro and run on a disposable Omarchy VM against a stub tailscale CLI serving 3, 14 and 60 machines. The review is Claude Opus 5.5's alone: no second opinion ran, because the configured reviewer (Codex Medium) was not called once omabot's daily review budget was spent, so no second model has checked any of this.

Pushed to this branch

  • 86fa7e0 merges quattro, which the branch was about 1,100 commits behind. The merge was clean.
  • 881a965 exposes peerFlick from the panel content. Since Build bar panel content on first open instead of at startup #15044 the panel's content is built lazily, and ids inside it are invisible to root-level code. scrollCursorIntoView() names peerFlick from the root, so on the merged tree every j/k into the machine list logged ReferenceError: peerFlick is not defined (Panel.qml:303), and the highlighted machine never scrolled into view. It is now mirrored through panel.loadedContent like peerColumn, as agents/skills/shell-dev.md describes.
  • b61b152 opens the panel with the machine list at the top. Opening already resets the panel's own scroller. The list now has a scroller of its own, so a reopened panel showed the list wherever the last visit had left it, with the first machines hidden.

What was checked, on the VM at this head

  • tailscale-test.sh, tailscale-receive-test.sh, keyboard-panel-lazy-test.sh, i18n-test.sh and ./test/cli pass. The panel loads and is driven with no QML errors in the shell log.
  • 3 machines: the list is not capped, and moving the highlight with j/k scrolls nothing.
  • 60 machines: the list is capped at about five rows. j/k through to the last machine and back keeps the highlighted row visible inside the list. The copy menu opens at the right row from the bottom of the scrolled list, and the mouse wheel over the list scrolls the list.
  • 14 machines and no exit nodes: the hero, the switch and CONNECTIONS stay put and only the list moves, as described.

Still open

With 2 connections and 2 exit nodes, the panel's content is still about 40px taller than the panel's height limit (Style.space(560) in fittedContentHeight) once the list is at 260, so the panel's own scroller still has room to move. The first j into the machine list scrolls the panel by that 40px, and the hero and on/off switch go off the top. So does the first wheel notch over the list, because the row that slides under the pointer takes the cursor. That is far less than on quattro, where the whole panel scrolls away, but it is what this pull request sets out to prevent, and it grows with each extra exit node, since that section has no cap. Moving the cursor back up to the header does not bring the hero back, but that is already true on quattro: scrollCursorIntoView() has no case for the header.

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 column.implicitHeight avoids the binding loop described in the earlier comment. Which way to go is the maintainer's call, so the value is unchanged. Waiting on the maintainer.

@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[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

  1. P2 Selected machine stays hidden ▶

Summary

The Tailscale machine list now scrolls separately and grows only up to Style.space(260).

  • The machine list scrolls on its own inside the Tailscale panel.

Reviews (1) · Last reviewed commit: "Drop the tests added beside the merge ad..." · Reviewed by Greptile

Comment on lines +304 to +305
scrollItemIntoView(peerFlick)
scrollItemIntoView(peerColumn.children[peerIndex], peerFlick)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Selected machine stays hidden

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.

@omarchybot

Copy link
Copy Markdown
Collaborator

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 scrollItemIntoView(peerFlick) on the panel's own scroller (Panel.qml:304), and the list's height counts only its own rows and the cap, not CONNECTIONS, EXIT NODES or the panel's 560 limit. So whenever the capped content still overflows, the hero and switch scroll away, and they stay away until the panel is reopened. Codex adds a second route to the same result: a wheel scroll that reaches the end of the list is passed on to the panel's scroller, so scrolling on past the last machine moves the hero too. The fixes they suggest are to give the list whatever height the panel has left, or to put the hero and the sections above the list outside the panel's scroller.

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 KeyboardPanel.qml says it does.

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.

@omarchybot omarchybot added enhancement New feature or request and removed enhancement New feature or request labels Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants