Skip to content

highlight only the active document tab, including its top border - #18753

Merged
kevinushey merged 13 commits into
mainfrom
feature/18692-active-doc-tab-highlight
Sep 12, 2026
Merged

kevinushey merged 13 commits into
mainfrom
feature/18692-active-doc-tab-highlight

Conversation

@kevinushey

@kevinushey kevinushey commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

Intent

Follow-up to #18734. Two changes to the active tab highlighting:

  • Only the active document tab is highlighted. Pane tabs (Environment, Files, and so on) and minimized pane strips return to their previous styling.
  • The indicator now includes the top border of the selected tab: a flat 3px bar along the tab's top edge that curves down into the tab's rounded corners, painted over the pane frame's border line rather than sitting beneath it.

Addresses #18692.

Approach

The pane frame paints a 1px border across the top row of the tab strip, and the strip is deliberately offset 1px above its GWT layout layer, which clips it. So the tab's top row is never visible and nothing drawn in flow inside the tab can reach it. The indicator is therefore drawn "by hand" from the tab's client rectangle using CSS anchor positioning: the selected tab carries an anchor-name, and its ::before is a position: fixed box anchored to the tab with top/left/right from anchor(). A fixed box escapes every ancestor's overflow clipping, and anchor positioning keeps it attached through resizes, drags and strip scrolling. anchor-scope binds each overlay to its own tab when several source columns each have a selected tab, and position-visibility: anchors-visible hides it if the tab is scrolled out of the strip.

The overlay is shaped like the top of the tab (3px top border, 1px side borders, a radius 1px larger than the tab's so the curves stay concentric), so the flat top and the end curves come from a single painted shape with no seam. An inset box-shadow could not do this because it paints inside the border box while the bar fills it.

The anchor rules live in an @supports block, which GWT's legacy CssResource parser passes through verbatim; only @external class names are used inside it. Browsers without anchor positioning keep an in-flow position: absolute version of the same shape as a fallback (clipped at the tab's top row, as before).

A fixed box is not clipped by the strip, so while the selected tab is only partly in view the bar would spill past the strip edge. DocTabLayoutPanel listens for scrolling on the strip's layout layer and re-checks after selection and resize; while the tab is partly hidden (past either edge, or under the utility area) it sets docTabPanelClipped on the panel, and the stylesheet returns the overlay to the in-flow shape so the strip clips it along with the tab. Selecting the tab scrolls it back into view and restores the anchored overlay.

The dark theme accent changes from #8ab4f8, which was nearly as light as the tab label and read as a highlight rather than an accent, to #4586e2. The preference title becomes "Highlight active document tab"; generated accessors and NEWS.md are updated to match.

Automated Tests

  • highlight_active_tabs.test.ts was rewritten for the new behavior: it reads the ::before overlay via getComputedStyle, checks its shape, that it is position: fixed and starts 1px above the tab, checks the accent per theme (Modern light, Modern dark, Sky), and asserts pane tabs and minimized strips are never highlighted regardless of the preference. Preference default/Cancel/Apply/reload persistence and stable tab widths under selection are retained.
  • A test opens 20 files, scrolls the selected tab half out of the strip, and checks that the panel is flagged and the overlay falls back to position: absolute, then that selecting the tab restores the anchored overlay.
  • 8 tests pass on macOS Desktop (test:desktop-dev, retries disabled). panes.test.ts (37) and active_tab_restore.test.ts (2) also pass against this build. Playwright typecheck and GWT draft build pass.

QA Notes

Open a few documents and switch between them; the selected document tab should show a blue bar along its top edge that covers the pane's grey border line and curves into the tab's corners. Pane tabs should look exactly as they did before #18734. Check Modern light, a dark editor theme, and Sky. Disable "Highlight active document tab" under Global Options > General > Basic > Other and confirm the bar and label emphasis disappear.

With many documents open, drag a tab toward the strip edge so the strip auto-scrolls and the active tab ends up partly hidden; the bar should be cut off with the tab rather than continuing over the overflow buttons or the pane border.

Follow-up to #18734. Pane tabs keep their previous styling; the selected
document tab's overline now recolors the tab's own top border and extends
it one pixel inward, so it reads as a single 2px bar that follows the
rounded corners.

Addresses #18692
The pane frame paints a 1px border across the top row of the tab strip,
which covered the tab's recolored top border. Draw the indicator as a
raised 2px ::before overlay on the selected document tab instead, and
keep a 1px inset shadow so the bar flows into the tab's rounded corners.
An inset box-shadow is painted inside the border box while the flat bar
fills it, so the two could never meet at the tab's rounded corners. Shape
the overlay like the top of the tab instead: same 3px radius, 2px top
border, 1px side borders, all in the accent color.
The overlay now starts 1px above the tab with a 3px top edge; its radius
grows by 1px so the outer curves stay concentric with the tab's corners.
The tab strip sits 1px above its GWT layout layer, which clips it, so the
tab's top row (where the pane frame's border paints) was never visible
and the in-flow overlay could not extend upward. Position the overlay
with CSS anchor positioning as a fixed box glued to the tab instead; the
in-flow version remains as the fallback where anchors are unsupported.
#8ab4f8 is nearly as light as the tab label and read as a highlight
rather than an accent; #4f8fea matches the light theme's saturation.
@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

RStudio E2E - all platforms

3 test(s) failed

###################- 99% pass rate

Passed Failed Skipped Flaky
2673 3 193 6
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 2 0 10 0
❌ desktop-linux 673 2 38 1
✅ desktop-macos 673 0 42 0
❌ desktop-windows 676 1 39 4
✅ server-linux 621 0 44 1
✅ setup 28 0 20 0
View / download the full report

View report online -- opens in the browser, no download needed. Available for 14 days.

Download playwright-report.zip -- extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


All platforms - commit cd66d95f3dc81147b5cf44bce9a28ac487b0509b - Run #937

@kevinushey
kevinushey merged commit b30102c into main Sep 12, 2026
32 of 34 checks passed
@kevinushey
kevinushey deleted the feature/18692-active-doc-tab-highlight branch September 12, 2026 18:18

This branch was previously deployed

1 inactive deployment
e2e-playwright — cd66d95f Deployed Sep 10, 2026 by kevinushey via windows / e2e-desktop-windows (2) #937
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants