Skip to content

perf(settings): open Settings smoothly and without a first-click build - #2054

Merged
l0gicgate merged 1 commit into
mainfrom
perf/2050-settings-open
Nov 5, 2026
Merged

l0gicgate merged 1 commit into
mainfrom
perf/2050-settings-open

Conversation

@l0gicgate

Copy link
Copy Markdown
Contributor

Description

Opening Settings paused on the first click and stuttered on every open.

  • Fade: Settings now fades through the layer's own opacity, driven by the frame clock. The CSS transition re-styled the layer's tree each frame, and removing only the scale barely helped. The new fade also plays on the first open, which used to pop in, and it follows Reduce motion and the GTK animations setting. Other dialogs keep their CSS transitions.
  • Pre-build: one hidden Settings layer is built and laid out on idle after the first paint, without being mapped. Settings is per tab, so only the first tab shown does this. Later tabs still build on first open, which measured about 41 ms because most of the cost is paid once per process.
  • udiskie poll: the row polled every 2 s while hidden, so a pre-built layer would have polled for the whole session. It now polls only while Settings is open, so availability can lag by up to 2 s after opening.

Measured with a temporary probe (not committed), debug build, software GL under Xvfb, 945×900:

Before After
Open fade, style + layout per frame (median / p95) 2.1 / 6.8 ms 0.07 / 1.4 ms
Open fade, render per frame (median / p95) 3.0 / 5.7 ms 1.8 / 2.6 ms
Longest frame gap during open 117 ms 16.7 ms
First open, click handler 45.7 ms 0.8 ms
First open, style + layout 39 ms 20 ms

The pre-build costs about 78 ms of idle work, split across two callbacks, and about 14 MiB, once per process.

Not verified or not fixed:

  • These numbers are not from Vulkan or a real GPU, because agents can't use the desktop session. The stutter still needs checking on the reporter's NVIDIA/Hyprland setup.
  • Cold shader compilation is unchanged. The first render after a driver or GTK update still stalls (about 460 ms here, about 450 ms in the issue), although the fade now plays after that stall instead of being skipped.

Visual evidence

N/A. Agents cannot upload attachments. The fade looks the same apart from dropping the dialog's slight scale-up.

How to test

  1. Launch Strata and wait a moment for the window to settle.
  2. Click the Settings gear, close Settings with Escape, then open it several more times.
  3. Open a new tab and open Settings from there.
  4. Turn on Reduce motion and open and close Settings again.

Expected result: The first open has no noticeable pause and fades in. Repeat opens and closes fade smoothly at the display refresh rate. With Reduce motion on, Settings appears and closes without a fade. Focus returns to the file list after closing.

Related issue

Closes #2050

Fade the Settings layer through its own opacity from the frame clock. A CSS
transition re-styles the layer's tree each frame and needs a prior style pass,
so the first open popped in instead of fading.

Build and lay out one hidden layer per process after the first paint, so the
first click no longer pays for it. Only the first tab shown does this, because
Settings is per tab and the costs that dominate are paid once per process.

Stop the udiskie row polling while its Settings layer is closed, since a
pre-built layer would otherwise poll for the whole session.

Refs #2050
@l0gicgate
l0gicgate merged commit eaed868 into main Nov 5, 2026
9 of 11 checks passed
wmfeht added a commit to wmfeht/strata-feature-map that referenced this pull request Nov 7, 2026
Sync lgse/strata#2054–#2065: Settings fade and pre-build, Language & Units, code-block wrap, sidebar rail alignment, trash scheme handler
l0gicgate added a commit that referenced this pull request Nov 7, 2026
…n the window (#2081)

* fix(delete): keep the permanent-delete dissolve when the dialog closes

Since #1900 the delete confirmation hands focus back to the listing when
it is removed, before the confirmed action prepares the dissolve. The
focus change leaves the column without a current allocation, GTK refuses
to snapshot it, and the dissolve was silently dropped for every
permanent delete. Prepare the dissolve when Confirm is clicked, while
the column is still laid out.

* fix(settings): open and close Settings instantly

The frame-clock fade from #2054 eased in on close, so Settings barely
changed for most of its 200 ms, and slow renderers such as Cairo
stretched it further. Show and hide the layer at once instead, and drop
the fade module that only Settings used.

* fix(context-menu): keep context menus inside the window at full height

Menus were capped by the monitor, so they could run past the window's
edge. Place them inside the window instead: below the click when the
whole menu fits there, above when only that side fits, otherwise slid up
so it shows whole, scrolling only when the window is shorter than the
menu. Also keep them clear of the window's left and right edges.

A hidden popover measures as empty and the file menu's last items only
take their size on its first frame, so measure the menu frame and its
content directly, and refit on the frames after it opens until its size
holds.

* fix(preview): keep Space from opening an empty preview on a folder

Clicking a folder in Columns moves focus to its column with nothing
focused there, so Space toggled the preview with no target and opened a
drawer that only said "No preview for this selection". With a folder or
nothing focused, Space now only closes a drawer that is already open.

* test(delete): let the confirmation paint before confirming it

Opening the dialog moves focus to its confirm button, which leaves the
column awaiting a new allocation until the next frame. Confirming before
that frame is not something a person can do, and it made the dissolve
regression test fail on slower CI runners.

* fix(delete): dissolve the open folder's row when deleting it permanently

The dissolve is now prepared when Confirm is clicked, before the confirmed
action moves the cursor out of a folder being deleted. Deleting the folder
whose column is active in Columns then looked for its row in its own
column, found none, and dropped the dissolve. Prepare it from the depth
the deletion will act on, without moving focus while the dialog is open.

* refactor(context-menu): compute menu placement apart from applying it

---------

Co-authored-by: Pierre Berube <[email protected]>
@l0gicgate
l0gicgate deleted the perf/2050-settings-open branch November 24, 2026 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(settings): Settings opens with a delay and its open animation stutters

1 participant