Repository navigation
fix(rustconn): show the View Only eye as a tab indicator icon - #485
asgitcode-tech wants to merge 6 commits into
Conversation
The View Only state was always applied — the tab title verifiably carries the 👁 prefix — but whether the user could see it depended on their emoji fonts. On setups where fontconfig prefers a monochrome emoji font (Segoe UI Emoji) over Noto Color Emoji, the eye draws as a few faint outline pixels at tab size: effectively invisible, so toggling looked like it did nothing. The state now also shows as the tab's indicator icon — the same theme view-reveal-symbolic eye the split pane headers use — which the icon theme renders legibly everywhere, with a "View Only" tooltip. The single indicator slot gets one owner: refresh_tab_indicator recomputes it from the session's state (split colour, then offline, then View Only), and every state change calls it instead of writing the slot directly, so the three writers can no longer clobber each other. The title prefix stays for setups that render it. Covered by a GUI test: the indicator appears with the toggle, clears when it is toggled off, is covered by the offline mark while the session is disconnected, and comes back on reconnect. Co-Authored-By: Claude <noreply@anthropic.com>
The credential-resolution start path mirrored the View Only toggle onto the tab, but two other start paths created the same VNC session widget without that wiring: the sidebar's Connect action (connect_selected — the route password-less connections take, like these surgery viewers) and the Quick connect dialog. On those sessions the toggle gates input while the tab is never marked, so the state has no visible sign. Both paths now mirror the toggle exactly like the full path, so the eye appears no matter which door the session came in through. Co-Authored-By: Claude <noreply@anthropic.com>
…tor on selection With the indicator icon carrying the visible state, the 👁 title prefix only duplicated it — and after a tab switch the retitling paths rebuilt the title with the emoji while the indicator slot lost the eye, so the tab showed the wrong marker in the wrong place. - set_view_only_marker no longer writes a title emoji: the indicator is the single visible marker, on every font setup; - the restore path and the session group windows follow suit (the group window sets the same theme indicator instead of the emoji title); - the indicator is re-derived whenever a tab is selected, so whatever touched the slot while another tab was up, the next look at the tab shows the state the state set actually holds. The GUI tests assert the indicator on the notebook tab and in the group window, and that the title stays clean. Co-Authored-By: Claude <noreply@anthropic.com>
The theme symbolic eye recolours per tab state, and on the selected tab's lighter pill it lost its contrast entirely — the eye showed on background tabs and vanished on the active one, while the state stayed. Generate the indicator as fixed amber pixels (like the split-colour circles already do): identical rendering on selected and unselected tabs, in every theme and font setup. Theme icon kept as fallback. Co-Authored-By: Claude <noreply@anthropic.com>
|
Thanks for tracking this down, including the second start path. The direction is right: one owner for the indicator slot, and the eye on every start path. CI is green and the code merges into Must fix
Should fix
Optional
|
The sandbox repro with full write-tracing caught the real writer: the tab-switch handler (the one that acknowledges `needs-attention` on the newly selected page) also cleared `indicator-icon` unconditionally for non-split pages. Selection order made the symptom read backwards: the selection refresh set the eye first, the acknowledgement cleared it right after — so the eye showed on background tabs and vanished the moment its own tab was selected, exactly as reported. The acknowledgement now recomputes the indicator from state (split colour, offline, View Only eye, else none) instead of clearing it, like every other writer of the slot. Co-Authored-By: Claude <noreply@anthropic.com>
The maintainer review on totoshko88#485 caught the remaining pieces: - the tab-switch handler (needs-attention acknowledgement) still cleared the indicator slot directly, and because it is connected after the subtitle handler, it ran after the selection re-derivation — the eye was set and then wiped on the same selection, so a View Only tab showed the eye only while in the background. The acknowledgement now recomputes the indicator from state instead of clearing it; - prepare_for_reconnect, the spawn-failure path, the command-result notification and the session group windows no longer write the slot directly either: they update their state and call refresh_tab_indicator, making it the single owner of the slot; - the eye is drawn as generated fixed-colour pixels (#c06838, at least 3:1 contrast on white and #222226 per the palette rule), identical on selected and unselected tabs and in both themes — the symbolic icon lost its contrast exactly on the selected tab — with a contrast unit test over the palette and the eye, and a per-size cache so the refresh does not re-encode on every tab switch and resolution change; - the View Only wiring lives in the creation methods (add_embedded_rdp_tab and create_vnc_session_tab_with_host, both now taking self: &Rc<Self>) instead of one copy per start path, and the RDP Quick Connect path is wired through the same creation call; - split titles drop the retired 👁 prefix on rebuilds and swaps, and the docs, tests and CHANGELOG describe what actually ships. Co-Authored-By: Claude <noreply@anthropic.com>
|
Thanks for the thorough review — every point addressed in e97c594. Item 1 — confirmed and fixed exactly as suggested. Your handler-ordering analysis matches what a write-tracing repro caught independently: the subtitle handler set the eye, Item 2 — all remaining writers routed through
Item 3 — the colour is now Item 4 — docs re-attached to Item 5 — investigation logging removed (marker/state/entry traces all gone). Item 6 — wiring moved to creation. Item 7 — Item 8 — CHANGELOG rewritten to describe the generated-pixel indicator, with the PR link and contributor credit in the house style. Item 9 — split titles dropped the 👁 too: Item 10 — the icon is cached in a Item 11 — the test asserts the indicator is present, that the title stays free of the retired emoji, that the offline mark outranks the eye while disconnected, and that reconnecting restores the eye. It still lives in Item 12 — acknowledged as a follow-up for the split circles too. |
What changed
The View Only state was always applied — on a machine that reproduces
the report, the tab title verifiably carries the 👁 prefix (
view-only marker: applied to the notebook tab … marked=👁️ Eye Test VNC2in thedebug log) — but whether the user can see it depends on their emoji
fonts. Where fontconfig prefers a monochrome emoji font (Segoe UI Emoji)
over Noto Color Emoji, 👁 draws as a few faint outline pixels at tab size:
effectively invisible, so toggling looked like it did nothing.
theme
view-reveal-symboliceye the split pane headers use — which theicon theme renders legibly everywhere, plus a "View Only" indicator
tooltip;
TerminalNotebook::refresh_tab_indicatorrecomputes it from thesession's state (split colour, then offline, then View Only), and every
state change calls it instead of writing the slot directly — the three
writers can no longer clobber each other (previously
mark_tab_connectedspecial-cased the split colour by hand while otherwriters cleared the slot);
How to test
fc-match "Segoe UI Emoji"resolving to Segoe), open any VNC/RDP connection and toggle View
Only: the tab now shows the symbolic eye indicator (and the title
keeps its 👁 where the fonts render it). Toggling off clears it.
back.
Second part (e70e0f8): the lean VNC start paths never wired the eye at all
While verifying on a machine that reproduces the report, a second bug
surfaced: only the credential-resolution start path mirrored the View Only
toggle onto the tab. Two other start paths create the very same VNC session
widget without that wiring:
connect_selected) — the routepassword-less connections take (these viewers have no VNC password);
On sessions opened through either door, the toolbar toggle gates input
(the widget's own handler) but nothing ever marks the tab — the state has
no visible sign at all, on any font setup. Both paths now mirror the
toggle exactly like the full path, so the eye appears no matter which
door the session came in through. Verified end-to-end in a sandboxed
Xvfb run through
connect_selected.Checklist
cargo fmtcargo clippy --all-targetscargo test --workspace+run-ignored-gui-tests.sh(new GUI test:indicator appears/clears with the toggle, offline wins while
disconnected, reconnect restores the eye)
connect_selectedin the sandboxdbg!Third part (aac4f3a): one eye only — the indicator
With the indicator carrying the visible state, the 👁 title prefix only
duplicated it, and after a tab switch the retitling paths rebuilt the
title with the emoji while the indicator slot lost the eye. The title
emoji is retired (title stays clean), the group-window marker switches
to the same theme indicator, and the indicator is re-derived whenever a
tab is selected, so the eye follows the state set no matter what touched
the slot in the meantime.