Skip to content

tailscale: virtualize the machine list so huge tailnets don't melt the shell - #7623

Merged
dhh merged 7 commits into
omacom:quattrofrom
iskakaushik:tailscale-large-tailnets
Oct 22, 2026
Merged

dhh merged 7 commits into
omacom:quattrofrom
iskakaushik:tailscale-large-tailnets

Conversation

@iskakaushik

Copy link
Copy Markdown
Contributor

Problem

On a corporate tailnet with ~3,900 machines, the tailscale widget makes the shell unusable. tailscale status --json is ~4.6 MB there, and every 30-second poll reassigns peers, which rebuilds one eager row per peer — each row carrying its own copy-menu Popup — on every bar. Traced with the QML profiler, that is ~500k QML object creations per refresh. On my machine (3,933 peers, two monitors) it meant:

  • ~4.6 s of shell CPU per poll (main thread stalls, visible desktop jank)
  • ~15% average quickshell CPU
  • delegate trees accumulating until the shell passed 7 GB RSS over a workday

Changes

  • Virtualized machine list — the peers Repeater+Column becomes a clipped ListView with reuseItems; only the visible rows exist, and pooled rows are reused across refreshes.
  • Machine search — filter field above the list (/ focuses it, Escape clears), match count in the section header. A 4,000-row list isn't navigable by scrolling alone.
  • One shared copy menu — a single Popup positioned at whichever row summoned it, instead of one instantiated per peer.
  • Change-detected refreshes — the service only reassigns peers/exitNodes/mullvadRegions when the parsed content actually changed, so an unchanged poll rebuilds nothing.
  • Light polling while closed — the periodic poll uses tailscale status --json --peers=false (~3 KB); the full peer list is fetched when the panel opens or on explicit refresh.

Keyboard navigation (j/k cursor, Enter → copy menu, taildrop send, panel tabbing) is preserved; the cursor and copy actions operate on the filtered list. Small tailnets look and behave exactly as before.

Numbers (3,933-peer tailnet, two bars)

before after
full refresh, shell CPU ~4.6 s ~0.17 s
steady-state average CPU ~15% <1%
shell RSS after hours of uptime 7+ GB and climbing ~520 MB, stable

Screenshot

Panel against a synthetic 4,000-machine tailnet (fake tailscale CLI used for the capture, so no real hostnames appear):

tailscale panel with 4,000 machines: virtualized list and search field

🤖 Generated with Claude Code

On a corporate tailnet with ~3,900 machines the tailscale widget makes the
shell unusable: `tailscale status --json` is ~4.6MB, and every 30s poll
reassigns `peers`, rebuilding one eager row per peer - each with its own
copy-menu Popup - on every bar. That is ~500k QML object creations per
refresh: ~4.6s of shell CPU per poll, ~15% average CPU, multi-second
main-thread stalls, and delegate trees that ratchet RSS into the gigabytes
over a workday.

Rebuild the hot paths so tailnet size stops mattering:

- Render machines through a clipped, virtualized ListView (reuseItems)
  instead of a Repeater in a Column, so only the visible rows exist.
- Add a search field over the machines (`/` focuses it, Escape clears),
  with the match count in the section header - a 4k-row list is not
  scrollable without one.
- Share one copy-menu Popup across rows instead of instantiating one per
  peer.
- Only reassign peers/exitNodes/mullvadRegions when their content actually
  changed, so an unchanged poll rebuilds nothing.
- Poll with --peers=false (~3KB) while the panel is closed; fetch the full
  peer list on panel open and explicit refresh.

Measured on a 3,933-peer tailnet with two bars: a full refresh drops from
~4.6s of shell CPU (plus ~7MB retained) to ~0.17s, steady state from ~15%
average CPU to under 1%, and RSS holds at ~520MB instead of climbing past
7GB. Keyboard navigation, the copy menu, taildrop send, and small-tailnet
behavior are unchanged; the cursor and copy actions operate on the filtered
list.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings August 20, 2026 17:56

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

Optimizes the Tailscale panel for large tailnets through virtualization and lighter polling.

Changes:

  • Adds virtualized, searchable peer lists.
  • Shares copy-menu state and avoids unchanged array updates.
  • Uses lightweight polling while the panel is closed.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
Service.qml Adds change detection and conditional peer fetching.
Panel.qml Adds search, list virtualization, and shared copy popup.

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

Comment on lines +203 to +206
_statusFullPeers = fullPeers === true || peersWanted
statusProcess.command = _statusFullPeers
? ["tailscale", "status", "--json"]
: ["tailscale", "status", "--json", "--peers=false"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch — fixed in 97b37c3: a full-peer request that arrives while a light poll is in flight is now remembered (_pendingFullPeers) and launched from statusProcess.onExited, so an opened panel never waits out the refresh interval.

function openCopyMenuFor(peer, row) {
if (!peer || copyOptionsFor(peer).length === 0) return
copyPeer = peer
clampCopyIndex()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 97b37c3: openCopyMenuFor now resets copyIndex whenever the menu opens for a different peer, matching the old per-row behavior.

…py cursor

Review follow-ups: a full-peer request that arrived while a --peers=false
poll was still running was silently dropped, leaving a freshly opened panel
stale for up to a whole refresh interval - remember it and launch the full
fetch when the light process exits. And the shared copy menu kept the cursor
position from the previous machine's menu, so Enter could copy an unexpected
field - reset it whenever the menu opens for a different peer.

Co-Authored-By: Claude Fable 5 <[email protected]>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed on a disposable VM running this branch's shell (quickshell -n -p .../omarchy-pr-7623/shell). test/shell.d/tailscale-test.sh (41 assertions) and test/shell.d/tailscale-receive-test.sh (8) both pass, and the shell loads the modified tree with no QML errors. Those tests only exercise Model.js and grep Panel.qml, so none of them covers the new ListView, the search field or the light-poll path — the VM has no tailscale CLI and no tailnet. What follows is source review plus two standalone Qt 6.11.1 probes I ran on that VM to settle questions the tests cannot.

The virtualization itself holds up. PeerRow keeps no mutable state after the change — peer and rowIndex are required properties, hasCursor derives from root.peerIndex, and the per-row Popup and its copyIndex moved to the panel root. With reuseItems: true that is exactly the shape it needs, and the String(copyPeer.id) !== String(peer.id) guard in openCopyMenuFor correctly stops the copy-menu cursor carrying between machines (peers do have id, set in Model.js:101). Nothing leaks across a recycled row.

Two things worth fixing before this lands.

1. The list jumps back to the top on every poll that changes anything. (Panel.qml:829)

publishPeers suppresses a no-op republish, but any real change — one peer flipping Online, which is part of the signature — assigns a new array to ListView.model, and Qt resets the view on model replacement. Measured on the VM, Qt 6.11.1: a 4000-item ListView over a JS array, positionViewAtIndex(2000) gives contentY 92000; reassign the model to a new array differing in a single item and contentY is 0. peerIndex does not change, so onPeerIndexChanged never fires and nothing puts the position back.

On a small tailnet the list never scrolls, so it does not bite. On the 4k tailnet this PR exists for, peers flip Online constantly and the panel refreshes every refreshIntervalSec (30s by default, 5s minimum) while it is open — so the machine list scrolls itself to the top under the user's finger, roughly every poll. That is the one failure mode virtualization was meant to remove.

2. A search query can outlive its search field. (Panel.qml:771-798)

peerSearch is visible: tailscale.peers.length > 8, and neither visible going false nor the panel closing clears root.peerQuery. Switch to a Tailscale account with fewer than nine machines from the CONNECTIONS section right above, with a query typed, and the field disappears while the filter stays on: the list shows a subset or "No machines match.", with no visible box and no / shortcut (that is gated on peerSearch.visible) to clear it. Clearing peerQuery on onVisibleChanged, and on panel close, would close it.

Smaller, same area:

  • Panel.qml:267 — ensureCursor and moveCursor gate the machines section on showPeers, which is unfiltered (tailscale.active && tailscale.peers.length > 0). With a query that matches nothing, the keyboard cursor can still enter a section that renders nothing: j from EXIT NODES lands in "peers", no row highlights, Enter does nothing. Making showPeers filter-aware fixes it in a line.
  • Panel.qml:785 — peerSearch accepts Down and Escape but not Up, and Up is one of the keys that does propagate to PanelKeyCatcher (measured, see below). Pressing it while typing a query moves the panel's section cursor out from under you. mullvadSearch right above handles Up explicitly.
  • Panel.qml:801 — with the panel closed the poll is now --peers=false, so tailscale.peers is empty until the first full fetch after open. The first open of a session therefore shows "No machines found on this tailnet." until that returns, and on a 4.6MB status fetch it shows longest exactly where it is most wrong.

On the Service half: publishPeers' JSON.stringify is order-stable (peers are normalized and sorted in Model.js), so the guard does work. But on 4k peers it re-serializes several MB on the GUI thread on every full poll, roughly redoing the JSON.parse that just produced the array — and now that the list is virtualized, the delegate churn it pays to avoid is about ten rows, not thousands. Its real value is suppressing the model reset in (1), which it only does for polls where nothing changed; worth reconsidering as a pair with (1). Separately, parseMullvadExitNodes now guards mullvadExitNodes on the regions signature, so it can go stale — harmless today, since nothing reads it.

Second opinion. codex at xhigh reviewed the diff independently and reached (1), (2) and the three smaller items; I had reached them too, and its independence is not currently guaranteed, so read that as agreement rather than confirmation. It did add the Qt source reference for the model-reset behaviour in (1).

Its top finding I checked and rejected. It reported as High that PanelKeyCatcher's Keys.priority: Keys.BeforeItem steals keys from the focused search field, so typing t/c/s into it would toggle Tailscale, overwrite the clipboard or fire Taildrop. PanelKeyCatcher.qml:39-41 says that is how it works, and every other panel in the repo sets blocked: for its inline editor, so it is a fair read — but it is not what Qt does. Probe on the VM: an Item with focus: true and Keys.priority: Keys.BeforeItem wrapping a focused TextField, keys injected with wtype. j, c and s all landed in the field and the ancestor handler saw none of them; Escape, Up and Down all reached the ancestor. So printable keys are safe here — mullvadSearch has relied on that since before this PR — and only the unhandled Up leaks, which is the low above. The comment in PanelKeyCatcher.qml is misleading, but that is not this PR's to fix.

Scope. The virtualization and the shared popup are proportionate: the popup had to move, or it would have been per-row state inside a recycled delegate. The search field is scope creep, but a 4000-row list needs it. The Service-side light polling is a second, separable change with its own risk — the stale/empty first open above — and would read better as a follow-up; AGENTS.md asks commits not to mix unrelated work.

Overlap. #7332 caps and independently scrolls the same machine list while keeping the eager Repeater. Same lines, so they will conflict, and this PR subsumes what it does while also fixing the cost; which to take is the maintainer's call. #6471 (hide sharee nodes) and #6930 (prefer machine names) also touch this list.

Nothing pushed to your branch. The two main items are judgement calls about how the model is published and how search should persist, which are yours rather than mine, and AGENTS.md asks for visual changes to be verified in the running UI, which I cannot do here without a tailnet. Waiting on you.

…edges

Review follow-ups. Qt resets contentY whenever a JS-array model is
reassigned, and on a large tailnet any poll where a peer changed publishes
a new array - so the machine list scrolled itself to the top under the
user's finger, roughly every refresh while the panel was open. Remember
the position the user (or keyboard cursor) chose and restore it on model
change; filter changes and panel opens reset it explicitly.

Also: clear the search query when its field disappears (small-tailnet
account switch) or the panel closes, so an invisible filter cannot hide
machines; make showPeers filter-aware so the keyboard cursor cannot enter
a section that renders nothing; consume Up in the search field instead of
letting it move the section cursor; show "Loading machines" rather than
"No machines found on this tailnet." before the first full peer fetch has
answered; and publish mullvadExitNodes unconditionally so it cannot go
stale behind the regions signature guard.

Co-Authored-By: Claude Fable 5 <[email protected]>
@iskakaushik

Copy link
Copy Markdown
Contributor Author

Thanks — this is a genuinely useful review, especially the measured model-reset behaviour. All five items addressed in d3a35fd:

  1. Scroll reset on republish — the list now remembers the position the user (or keyboard cursor) chose (rememberedY, updated on user scrolling / scrollbar release / keyboard positioning) and restores it in onModelChanged. Filter changes and panel opens reset it explicitly, so search still starts at the top.
  2. Query outliving the field — peerSearch clears itself onVisibleChanged when hidden, and the panel clears it on close.
  3. showPeers filter-aware — now tailscale.active && filteredPeers.length > 0, so the cursor can't enter a section that renders nothing.
  4. Up in the search field — consumed, returns focus to the key catcher like Down does.
  5. Stale first open — added Service.peersLoaded (set on the first full parse, cleared on unavailable); the panel shows "Loading machines…" until it answers and only claims an empty tailnet after.

Also took the nit: mullvadExitNodes is published unconditionally now; only the derived regions keep the churn guard.

On the publishPeers stringify: I kept it, deliberately. It only runs on full polls (panel open or explicit refresh — light --peers=false polls never reach it), and with the scroll restore in place its remaining job is suppressing no-op model resets, which still saves the ~10-row rebuild plus cursor churn on the common nothing-changed poll. A partial-field signature would be cheaper but risks stale rows; happy to swap if the maintainer prefers.

On scope: agreed the light polling would have been cleaner as a follow-up — the PR's steady-state numbers depend on it, which is why it's here. If splitting it out makes this easier to take, say the word and I'll carve it into its own PR. Same for the #7332 overlap — maintainer's call, this PR touches the same lines and subsumes the cap-and-scroll approach.

peersLoaded was set on every full status parse and only ever cleared by resetUnavailable, which a normal stop/start never reaches: `tailscale down` parses fine and exits zero, so it lands in the light-poll branch that clears peers and leaves the flag set. Stop Tailscale, start it again while the panel is closed so only light polls observe the transition, and the next open has peers empty with peersLoaded still true — the panel then states "No machines found on this tailnet." for the whole of the full fetch, which is the claim peersLoaded was added to avoid.

Tie the flag to what it names instead: a full poll sets it only when the tailnet is actually running, and the light-poll branch that clears peers clears it too.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Co-Authored-By: Codex XHigh <[email protected]>
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed at d3a35fd. All five items are fixed. I checked each by mechanism rather than by description: on a disposable VM running this branch's shell against a stub 4000-machine tailnet, plus two compiled Qt 6.11.2 probes for the questions a screenshot cannot answer.

The scroll fix holds. This was the one that mattered, so I came at it from both ends. A probe replicating peerList exactly — same height: Math.min(contentHeight, …) binding, same reuseItems, same rememberedY handlers, 4000-item JS array model — restores contentY 79634 across a model reassignment that previously dropped it to 0. contentHeight is already current when onModelChanged runs, so the clamp is against the new content: shrinking 4000 → 10 peers clamps to 0 rather than leaving the view out of bounds. A republish arriving while the list is still moving does not clobber rememberedY — I expected that race and it does not happen. Both pointer paths feed rememberedY: a mouse wheel sets moving for the length of the flick, and a phased touchpad scroll (ScrollBegin/ScrollUpdate/ScrollEnd) does too. And live: cursor on machine-0060 with the list showing 55–60, a poll changes the peer set, and the list is still showing 55–60.

The other four. Query clearing verified live — with machine-055 typed, shrinking the tailnet to 5 machines makes the field vanish and takes the filter with it: "MACHINES · 5", all five rows. showPeers becoming filter-aware does not hide anything it should not, since "No machines match." and the section header sit in the Column gated on installed && active rather than on showPeers. Up is consumed. "Loading machines…" shows on first open while the full fetch is in flight.

One new defect, pushed as c884506. peersLoaded was cleared only by resetUnavailable, which a normal stop/start never reaches: tailscale down parses fine and exits zero, so it lands in the light-poll branch that clears peers and leaves the flag set. Stop Tailscale and start it again with the panel closed, so only light polls observe the transition, and the next open has peers empty with peersLoaded still true — the panel then states "No machines found on this tailnet." for the whole of the full fetch, which is the exact claim peersLoaded was added to prevent. Reproduced on the VM, then fixed by tying the flag to what it names: a full poll sets it only when the tailnet is actually running, and the light-poll branch that clears peers clears it too. The identical sequence now shows "Loading machines…". Revert it if you would rather shape it differently.

Still open, low. rememberedY is reset on panel open, on a filter change and on explicit positioning, but not when the peer set becomes a different tailnet. Measured: scroll to peer 2000 on a 4000-machine account, switch to a 10-machine one (correctly clamps to 0), switch back to a big one, and contentY goes straight back to 79634. With the panel open, switching accounts from CONNECTIONS lands you midway into a machine list you have never seen; before the fix this case scrolled to the top, which was better. How far "remembered" should scope is your call — resetting it when selectedAccountId changes would close it.

Tests. test/shell.d/tailscale-test.sh (41 assertions) and tailscale-receive-test.sh (8) pass, before and after my commit, on a VM whose compositor was serving this branch. They only exercise Model.js and grep Panel.qml, so none of them covers the ListView, the search field, the light-poll path or peersLoaded. Everything above that is not a source claim came from the stub tailnet or the Qt probes, not from the suite.

Second opinion. codex at xhigh, twice. Its first pass reviewed the pre-d3a35fd tree — every line number predated your commit and it reported all five fixed items as still open — so I re-ran it pinned to the current file. That pass found the peersLoaded stop/start defect, which I had not reasoned about and which is why the commit above exists; that one stands on its own terms. It also reached the rememberedY-across-accounts item, though I had already measured it and codex's independence is not currently guaranteed, so read that as agreement. Rejected again: it re-raised as High that PanelKeyCatcher steals printable keys from the focused search field. It does not. Beyond the earlier probe, this run typed / and then machine-055 into the live panel, and the whole string landed in the box and filtered the list to "MACHINES · 10 OF 4000", firing none of the c/s/n actions. The docstring at shell/Ui/PanelKeyCatcher.qml:39-41 is what keeps sending reviewers down that path.

Unrelated and pre-existing, but worth someone's attention. pollWatchdog is armed on a poll launch (Service.qml:240) and never stopped on success, so it fires 15s later and kills whatever status process is in flight, leaving the panel showing "TAILSCALE IS DISCONNECTED". It predates this PR — git blame puts those lines with the Taildrop change — and it is not yours to fix here. It is worth raising because it bites exactly the population this PR targets: a slow tailscale status --json is the premise of the whole change, and I tripped it three times while probing with a deliberately slow stub.

The #7332 overlap still stands, unchanged since 18 August. That one is the maintainer's call, not yours.

rememberedY was reset on panel open, filter changes and explicit
positioning, but survived the peer set becoming a different tailnet:
scroll deep into a 4000-machine account, switch away and back, and the
list restores a position in a machine list the user has never seen.
Reset it (and the peer cursor) when selectedAccountId changes, so an
account switch starts at the top the way it did before the scroll fix.

Co-Authored-By: Claude Fable 5 <[email protected]>
@iskakaushik

Copy link
Copy Markdown
Contributor Author

Thanks for checking these by mechanism — the scroll-restore probe and the live cursor-hold test are exactly the verification this needed.

  • c884506 kept as-is. Tying peersLoaded to parsed.running and clearing it in the light-poll branch is the right shape; the stop/start-under-light-polls sequence is a real case I missed. Thanks for the fix.
  • rememberedY across accounts — fixed in d6a8a18. The remembered position now belongs to the account it was scrolled in: selectedAccountId changing resets it (and the peer cursor), so an account switch starts at the top the way it did before the scroll fix.
  • pollWatchdog — agreed it's not this PR's to fix, but it bites exactly the tailnets this PR targets, so I filed it separately with your reproduction notes: tailscale: pollWatchdog kills healthy in-flight status polls, panel shows TAILSCALE IS DISCONNECTED #7774.

That leaves #7332 overlap as the one open item, which is the maintainer's call.

`tailscale switch --list --json` publishes an empty selected id on any non-zero exit — including when `pollWatchdog` reaps it — while the user is still on the same tailnet, and the recovery poll then publishes the id back. Reading either edge as an account switch scrolled a hand-scrolled list to the top, which is the scroll loss this branch exists to prevent arriving through a different signal. Compare against the last account actually seen instead, so only a move between two real tailnets resets.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@omarchybot

omarchybot commented Aug 22, 2026 •

Copy link
Copy Markdown
Collaborator

Re-reviewed at d6a8a18. The handler is live and it does what you meant it to — but it fires on more than an account switch, and I pushed a guard.

The fix works. I gave the stub two 4000-machine tailnets this time, so a remembered offset from one is a perfectly valid offset in the other and a list that lands at the top did so because the code reset it, not because a clamp did. Scrolled alpha to machine 0177 with a real mouse wheel — no keyboard cursor, so peerIndex was still 0 and nothing but your handler could move the view — then clicked beta in CONNECTIONS: the list came up at beta-0001. The three statements are also in the right order; root.peerIndex = 0 first means onPeerIndexChanged → scrollCursorIntoView() → rememberPosition() can only run before you zero rememberedY, not after. And ensureCursor() on the sibling handlers only clamps peerIndex downward, so nothing that runs later can restore a non-zero offset. The scroll-hold from d3a35fd is intact at this head: the list sat on 0177–0182 across a poll cycle.

The defect: selectedAccountId goes empty on a failed poll, and that is not a switch. accountsProcess.onExited calls parseAccounts("") on any non-zero exit (Service.qml:567-572), and Model.parseAccounts("") returns selectedAccountId: "" (Model.js:275). resetUnavailable() clears it too (Service.qml:268). So a tailscale switch --list --json that fails or gets killed publishes A → "" for the tailnet the user is still looking at, and the recovery poll publishes "" → A — two firings, both reading as a switch. Reproduced live: scrolled to alpha-0095, made the accounts poll exit non-zero, and 60 seconds later the list was back at alpha-0001 with the account unchanged. That is the same scroll loss this branch exists to prevent, arriving through a different signal.

It is not hypothetical, and it is worse on a big tailnet: anything that reaps an in-flight poll lands on exactly that non-zero exit path, and a slow tailscale status --json is this branch's whole premise. I tripped it here on purpose with a deliberately slow stub, and selectedAccountId was cleared along with everything else. Before d6a8a18 that left the remembered position alone; now it takes the scroll with it.

Pushed 79618d8. It keeps the last account actually seen and resets only when the new id is non-empty and different, so A → "" → A is a no-op and A → B still resets. Proven by mutation on the same stub: the identical failing-poll sequence now holds the list at alpha-0075, the recovery round-trip holds it too, and clicking beta still lands on beta-0001. Your comment and the shape of the handler are unchanged; revert it if you would rather solve it in Service.qml by not clearing the id on a failed poll, which is the other reasonable place for it.

Switching to a tailnet that is down renders correctly with c884506 in place — I checked because that commit made peersLoaded follow parsed.running. The whole machines section is gated on installed && active, so it disappears and the hero reads TAILSCALE IS DISCONNECTED; there is no flash of "No machines found on this tailnet." and no spinner left running. Bringing it back up repopulates cleanly.

Tests. tailscale-test.sh 41/0 and tailscale-receive-test.sh 8/0 on a VM whose compositor was serving this branch, run after my commit. They cover Model.js and grep Panel.qml — nothing in them touches the ListView, the account handler or peersLoaded, so every behavioural claim above comes from the stub tailnet and the screenshots, not from the suite.

Second opinion. codex at xhigh, pinned to d6a8a18 with line anchors it had to quote back — it confirmed all six, so this pass was a review of the right tree. It reached the same empty-id defect. I had already reasoned to it and pointed its prompt at that code, and its independence is not currently guaranteed, so read that as agreement rather than a separate discovery; the one thing it added that I had not worked out is that a failed parse also empties accounts, which makes the next refresh retry immediately through the accounts.length === 0 branch — that is why the reset fires twice in quick succession rather than once. It found nothing else new, and confirmed the five earlier findings are still fixed at this head.

Waiting on the maintainer now: the overlap with #7332 is still open and still their call.

@iskakaushik

Copy link
Copy Markdown
Contributor Author

Good catch on the empty-id edges — the failed-poll path never crossed my mind as a "switch", and you're right it's the same scroll loss through a different door. 79618d8 kept as-is; comparing against the last account actually seen is the right place for it, since Service clearing the id on failure is honest about what it knows and the panel is where "did the user actually move?" belongs. Also ported it to my local build, where it's now running against the real 4k tailnet.

Nothing further from my side — the branch is at 79618d8 with everything verified, and it's the maintainer's call on the #7332 overlap and sequencing with #7774.

Since this branch was cut, quattro builds panel content on first open (omacom#15044), routes every string through I18n with catalogs (omacom#15326), restyled the copy menu for right-to-left layouts, and qualifies palette references for Qt 6.12. The branch's intent is ported onto that structure rather than the old one restored.

The machine list, its search field and the shared copy menu now live inside the lazily built content, so root-level code reaches them through `panel.loadedContent` like the panel's other items, and every root caller tolerates them being null before the first open. The account-switch reset still records the last account seen while the panel has never opened, so the first open after a switch is not mistaken for one. The shared copy menu takes quattro's right-to-left placement, opening from whichever end the row's copy button sits at, and `Commons.Color`. The machine count, search placeholder, loading and no-match texts get English catalog entries, with the counts formatted for the language.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

This PR reduces the work needed to show large Tailscale networks.

  • Tailscale fetches peer details when the panel needs the machine list.
  • The machine list reuses visible rows and shares one copy menu.
  • Machine search narrows the list and keeps keyboard movement on matches.

No actionable issues were found. This review did not include runtime or visual verification.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Poll[Status refresh] --> Full{Panel open or full fetch requested?}
  Full -->|No| Light[Fetch status without peers]
  Light --> Preserve[Keep saved peers while running]
  Full -->|Yes| Fetch[Fetch full status]
  Fetch --> Compare{Peer content changed?}
  Compare -->|No| Keep[Keep existing array]
  Compare -->|Yes| Publish[Publish new peer array]
  Publish --> Filter[Apply machine search]
  Filter --> List[Show visible rows in ListView]
  List --> Menu[Open shared copy menu for chosen peer]
Loading

Reviews (1) · Last reviewed commit: "Merge quattro into tailscale-large-tailn..." · Reviewed by Greptile

@omarchybot

Copy link
Copy Markdown
Collaborator

Brought this up to current quattro and pushed it as 6b5f1b3, a merge commit on your branch, so your six commits stay as they are. The branch had fallen 1106 commits behind and conflicted in Panel.qml. It now merges cleanly.

What the merge had to port, and why. The three textual conflicts were the small part. Since August quattro has changed how panels are built, and your structure had to move onto the new one:

  • Lazy panel content (Build bar panel content on first open instead of at startup #15044). Panel content is now built on first open and kept after that, so root-level code can no longer reach peerList, peerSearch or sharedCopyPopup by id. They are exposed through panel.loadedContent like the panel's other items. Every root caller (open/close, the account-switch reset, the copy-menu helpers) tolerates them being null before the first open. The account reset still records the last account seen while the panel has never been opened. Inside the content, focus still returns to the key catcher by id, as mullvadSearch already does.
  • i18n (Omarchy in 50 languages #15326). The machine count, the filtered count, the search placeholder, "Loading machines…" and "No machines match." now have English catalog entries: tailscale.machinesCount, tailscale.machinesFiltered, tailscale.searchMachines, tailscale.loadingMachines and tailscale.noMatchingMachines. The counts go through I18n.formatNumber, and the new Texts declare textFormat.
  • Copy menu restyle. The shared popup takes quattro's right-to-left placement, opening from whichever end the row's copy button sits at, and uses Commons.Color.background. The per-row popup quattro had restyled is gone, as your change intended.
  • Service.qml merged without conflicts. Light polling, change-detected publishing and peersLoaded are unchanged, alongside quattro's i18n edits there. ShellIpc, the reduce-motion guards and the Qt 6.12 palette qualification came in from quattro untouched, and your refresh(false, true) call sites carried over.

What ran. Everything ran on a disposable VM whose compositor was serving 6b5f1b3. I confirmed quickshell -n -p named the tree.

  • Tests. tailscale-test.sh 41/0, tailscale-receive-test.sh 8/0, i18n-test.sh 401/0 (also with I18N_STRUCTURAL=1), qml-text-format-test.sh 19/0, keyboard-panel-lazy-test.sh 42/0, panel-open-budgets-test.sh, panel-key-catcher-test.sh, bar-icon-geometry-test.sh, installed-service-test.sh and bar-text-color-test.sh all pass. ./test/cli passes (125 ok). scripts/i18n-sync.py extract-scan --check finds no embedded English.
  • Live checks against a stub tailscale CLI serving two 4,000-machine accounts (4.6 MB of status --json, plus --peers=false and switch --list --json). There were no QML errors in any quickshell log. With PeerRow instrumented temporarily, opening the panel and wheel-scrolling 100 notches created 22 rows and recycled them 82 times. Search filtered to "MACHINES · 10 OF 4000". /, Down, j and Enter opened the shared copy menu on the selected machine, in quattro's styling, and j plus Enter copied the DNS name. A full poll that took three machines offline left a wheel-scrolled list where it was. An accounts poll that really failed, then recovered, held the position too. A mutant without the empty-id guard scrolled to the top on the same sequence, so the run does exercise 79618d8. Clicking the other account landed on its first machine. A typed query was gone after close and reopen. While closed, the shell polled only with --peers=false.
  • Measured against quattro at c39fd2a, same VM and stub, /proc CPU and RSS of the shell:
quattro this branch
first open of the panel 11.9 s CPU, RSS 0.72 → 2.37 GB 1.4 s CPU, RSS 0.66 → 0.80 GB
open, steady over 90 s (30 s polls) 49% CPU 11% CPU
refresh with a changed peer, panel open 7.6 s CPU, +0.5 GB 1.2 s CPU, +1 MB
closed again, steady over 90 s 42% CPU 6% CPU

The last row matters for quattro in particular: lazy content stays built once opened, so without virtualization 4,000 eager rows keep rebuilding on every poll after the panel closes.

Not checked. The right-to-left copy-menu placement was only read, not run under an RTL language. The copy menu on a row near the panel's bottom edge extends below the card. Reading quattro's per-row popup, it placed itself below the button the same way, so this is not new with the merge, but I did not run that case on quattro.

Second opinion. Codex Medium and muse-spark-1.3-contributor (via pi, thinking high) reviewed 6b5f1b3 and found no defects. Between them they traced every root-level use of the lazily built content and its null guard, the first-open ordering against KeyboardPanel's loader, the shared popup's parent, right-to-left placement and focus return, the new catalog keys and their placeholders, and the Service merge, and confirmed that scroll restore, query clearing, peersLoaded and the empty-account guard are all still there. They read the session's earlier findings, so their agreement is not guaranteed to be independent.

Overlap. #7332 also edits the machine list in shell/plugins/panels/tailscale/Panel.qml, so whichever of the two lands second will need a rebase onto the other.

Waiting on the maintainer.

@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge and removed ready Good to merge enhancement New feature or request labels Oct 22, 2026
@dhh
dhh merged commit c872d57 into omacom:quattro Oct 22, 2026
1 check passed
rdoupe added a commit to omarchy-asus/omarchy-asus that referenced this pull request Oct 26, 2026
- The charger-swap monitor unit's omarchy-pkgs companion is open as
  omacom/omarchy-pkgs#1629 (companion of omacom/omarchy#15668); the 0002
  entry no longer says it isn't opened, and the draft is gone.
- Tailscale panel (0016): our omacom/omarchy#15671 is closed in favour of
  omacom/omarchy#7623 (c872d57cf).
- Stranded lock (0024, 0027): #15912 is at ab447851e, which 0024
  matches; the thread endorses 0027 (ddfdcf77) for it.
- hid-asus Win-lock (0568): v1 fails checkpatch since 1e035297ffda removed
  the Assisted-by trailer from the kernel docs; a v2 goes to linux-input
  after v7.4-rc1.

The recipes' NOTES.md and the omarchy-settings DELTA comment say the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
rdoupe added a commit to omarchy-asus/omarchy-asus that referenced this pull request Oct 26, 2026
- The charger-swap monitor unit's omarchy-pkgs companion is open as
  omacom/omarchy-pkgs#1629 (companion of omacom/omarchy#15668); the 0002
  entry no longer says it isn't opened, and the draft is gone.
- Tailscale panel (0016): our omacom/omarchy#15671 is closed in favour of
  omacom/omarchy#7623 (c872d57cf).
- Stranded lock (0024, 0027): #15912 is at ab447851e, which 0024
  matches; the thread endorses 0027 (ddfdcf77) for it.
- hid-asus Win-lock (0568): v1 fails checkpatch since 1e035297ffda removed
  the Assisted-by trailer from the kernel docs; a v2 goes to linux-input
  after v7.4-rc1.

The recipes' NOTES.md and the omarchy-settings DELTA comment say the same.

Co-authored-by: rdoupe <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
rdoupe added a commit to omarchy-asus/omarchy-asus that referenced this pull request Oct 28, 2026
… Omarchy 4.5.0rc2 (#376)

* omarchy 4.5.0rc2-1.101: rebase onto Omarchy 4.5.0rc2

Our patches are now on fork branch asus/v4-5-0-rc2. Most of the
adaptations follow upstream's test cleanup: it dropped tests that only
read source text (omacom/omarchy#16334), so our edits to them go
(0003, 0017, 0026, general-0004), and it merged the stranded-lock test
into hyprland-session-lock-test.sh (omacom/omarchy#16337), where 0024's
and 0027's cases are ported. 0016 now sits on top of
omacom/omarchy#7623, which rc2 ships: the IPN-bus watch replaces its
light closed-panel poll, and opening the panel fetches every peer.
general-0001's timer stub moves beside upstream's new plugin stub.

No carried fix is in rc2, so nothing drops.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* omarchy-settings 4.5.0rc2-1.101: rebase onto Omarchy 4.5.0rc2

The same patches as omarchy, from fork branch asus/v4-5-0-rc2; upstream
now installs Omarchy's timesyncd drop-in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: rdoupe <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
shawnduggan added a commit to shawnduggan/omarchy that referenced this pull request Oct 29, 2026
Resolve conflicts with the virtualized machine list (omacom#7623) and the panel
translations (omacom#15326): publishPeers now writes the cached _peers that the
visible peers list derives from, the offline switch sits beside the counted
MACHINES header, and the new switch, empty-state and Offline strings are
English catalog entries. The runtime fixture builds the lazily created panel
content (omacom#15044), feeds statuses as full peer fetches, and qualifies its
palette references (omacom#14553).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CFeF4GVPAdJb4fXF29e79S
@emirb emirb added this to the 4.5 milestone Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants