Skip to content

Fix the stage view leaving a gap above its bar in dark mode - #642

Merged
hannesa2 merged 1 commit into
masterfrom
fix-stage-bar-gap-in-dark-mode
Sep 15, 2026
Merged

hannesa2 merged 1 commit into
masterfrom
fix-stage-bar-gap-in-dark-mode

Conversation

@goneng

@goneng goneng commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #481.

Dark mode in these views is not a theme. It is a whole page inversion
filter applied to body, so dark is the one appearance where the layout
differs from light:

.body--dark { -webkit-filter: invert(0.89) hue-rotate(180deg); }

On macOS 26 a filtered element also became the containing block for position: fixed descendants.
The stage view's bar is the only position: fixed in the app, so in dark mode it stopped being positioned
against the viewport and dropped below the 30px margin that body reserves for it,
leaving the empty strip the reporter sees.
Light mode has no filter, so it was never affected.

The bar is now a sticky element in the flow, which does not depend on the viewport and
does not need a margin reserved for it.
diff.css already uses position: sticky in this same document, so the approach is not new here.

Measured

#title in the same document, toggling only the dark class:

engine offsetParent bar top
modern WebKit, as shipped BODY 40.0
modern WebKit, patched BODY 0.0
legacy WebView on macOS 15, as shipped null 0.0
legacy WebView on macOS 15, patched BODY 0.0

Please verify on macOS 26

The reproduction is macOS 26 only. On macOS 15 the old CSS already behaves
correctly, so this was developed against the mechanism rather than against
a local repro, and the patch is confirmed to cause no regression there.
@tagliala, would you try the build from this PR?

Test plan

  • macOS 26, dark mode: open the Stage view, confirm the bar sits at the
    top with no gap above it and the first line of the diff is readable
  • Light mode: unchanged
  • Scroll a long diff and confirm the bar stays pinned

Dark mode in these views is not a theme but a whole page inversion
filter, so it is the one appearance where the layout differs. On macOS
26 a filtered element also became the containing block for the fixed
bar above the diff, which dropped the bar below the margin reserved for
it and left an empty strip at the top.

* Let the bar sit in the flow as a sticky element, so it no longer
  depends on being positioned against the viewport
* Drop the margin reserving a guessed 30px for a bar that measures
  23.5px, and the full width that would overflow once it is in the flow
@goneng
goneng marked this pull request as ready for review September 14, 2026 19:42
@goneng
goneng requested a review from hannesa2 September 14, 2026 19:43
@tagliala

Copy link
Copy Markdown
Contributor

@tagliala, would you try the build from this PR?

As soon as the build completes, I'll test on macOS 27

@hannesa2

Copy link
Copy Markdown
Contributor

Screenshot differs: emulatorApi=arm64 with 4 screenshot(s)

setpoint (old) | diff | actual screenshot (new)

00-commit-context-menu.pngscreenshot

01-history-view.pngscreenshot

02-main-window.pngscreenshot

03-staging-view.pngscreenshot

@goneng goneng added the bugfix label Sep 14, 2026
@tagliala

tagliala commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Hello, I confirm this fixed on 27.0 (I'm pretty confident that it would be the same on 26.x)

Dark

image

Ligh

image

@goneng

goneng commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

Hello, I confirm this fixed on 27.0 (I'm pretty confident that it would be the same on 26.x)

Great, and yes - the change in behavior was introduced in macOS 26 (which is way it worked OK before that).

@hannesa2, I think we can merge this one - thanks!

@hannesa2
hannesa2 merged commit 32aa9ac into master Sep 15, 2026
3 checks passed
@hannesa2
hannesa2 deleted the fix-stage-bar-gap-in-dark-mode branch September 15, 2026 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS 26, dark mode, space below stage window prevent to read first line of changed file

3 participants