Repository navigation
perf(tabs): free closed tabs and stop re-encoding menu icons - #2041
Merged
Merged
Conversation
Every closed tab kept its widget tree and view state alive through closures that captured their own widgets, so the icon and preference registries scanned on each icon creation grew with every close and folder opens slowed with uptime (#2021). Dispose a closed tab's widget tree as a window is destroyed, break the sidebar toggle and device row cycles that also leak on window close, encode each context-menu icon texture once instead of per column build, and build the Back history menu when it opens. Keep a pending child mirror when a suppressed focus echo arrives, which the faster column build exposed.
l0gicgate
added a commit
to adamcbrewer/strata
that referenced
this pull request
Nov 3, 2026
Each sort menu build registered a Browser observer, and Browser keeps observers until its tab closes, so every navigation and view rebuild added another closure that ran on every browser event for the life of the tab (the uptime slowdown fixed in lgse#2041). Track mapped menus in a small registry instead and refresh them from the tab's existing event dispatch when a sort finishes or a column reloads. Refs lgse#1652
wmfeht
pushed a commit
to wmfeht/strata-feature-map
that referenced
this pull request
Nov 3, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RQ23A9FMdmsZYjsqdLwDf9
This was referenced Nov 3, 2026
l0gicgate
added a commit
that referenced
this pull request
Nov 3, 2026
* feat(sort): add sorting flyouts and list sort indicators Add Extension, Created and Unsorted sorting with independent name comparison settings and saved folder/default choices. Implement design option 3 from #1652, with right-aligned submenu values and List indicators for sorts that visible column headers cannot explain. Refs #1652 * fix(sort): align submenu rows and move list sort control Keep submenu titles aligned with the main choices and reduce the visual weight of their selected values. Place the List sort control before Refresh with a gap. Refs #1652 * fix(sort): align default sort actions with other menu rows Remove the empty indicator slot from plain sort actions as well as choices and submenu titles. Refs #1652 * fix(sort): toggle the active menu sort off when selected again Switch to Unsorted when the checked sort field is selected again, so both primary and flyout choices can be turned off. Refs #1652 * fix(sort): use apply as default sort wording Update the action label and its translations in all supported languages. Refs #1652 * fix(sort): keep menus open while changing sort options Allow several choices before dismissing the menu with Escape or an outside click. Keep checkmarks, submenu summaries and default actions current while the menu is open. Refs #1652 * fix(sort): sync open sort menus without a browser observer per pane Each sort menu build registered a Browser observer, and Browser keeps observers until its tab closes, so every navigation and view rebuild added another closure that ran on every browser event for the life of the tab (the uptime slowdown fixed in #2041). Track mapped menus in a small registry instead and refresh them from the tab's existing event dispatch when a sort finishes or a column reloads. Refs #1652 * test(sort): round-trip a non-default per-folder name comparison Refs #1652 * fix(sort): keep a finished sort from seeding the next folder at its depth A sort stays pending after it applies, so once Columns replaced that column with another folder, the next sort, name-order or default action there started from the previous folder's request and saved it for the new folder. Overlay a request only while it is still waiting to apply to the folder it was made for. Refs #1652 * fix(sort): treat a missing birth time in full listings as unavailable Filesystems without birth times (NFS, SFTP) left every listed row's creation time unknown, so a Created sort refilled the whole folder on each load, file by file over the network for remote folders, and a monitored change moved its row ahead of the filled ones. Refs #1652 * docs(sort): restore the directory metadata note on sort gap targets Refs #1652 * feat(sort): flatten the sort menu and label its default action Make default List Extension and Created with the other fields and show Natural, Alphabetical and Case-sensitive names under a Name order heading, so no choice hides in a flyout that opens over the listing at the window edge. Unsorted has no row: unchecking the active field already turns sorting off. Drop the submenu summaries, their styling and the submenu-only keyboard routing, and rename the QA scenario to match. Refs #1652 * fix(sort): match the sort menu's top inset to its bottom Native context menus open with a padded header row, so their contents only pad the bottom; the sort menu opens on a section title, which sat 8px closer to the top edge than its last row did to the bottom. Refs #1652 * style(sort): apply rustfmt to the sort menu * test(icons): wait for the grid layout before checking Left wraps rows The test pressed Down 100 ms after switching to Icons and assumed the grid already had several columns. On a loaded CI runner it had not been laid out yet, so Down reached the second tile and the test failed; this also failed #2044's own CI. Wait until Down moves a whole row instead. * test(icons): accept any row start in the Left-wrap test GTK 4.22, which CI uses, lays the fixture's tiles out about 450 px wide in a 460 px grid, one per row, where GTK 4.24 fits two. Requiring Down to pass the second tile therefore always failed on CI. Wait for the tiles to be laid out, then use whichever row start Down reaches; with one column Left from the second tile still must not enter the sidebar, and the test still fails on both versions without #2044's fix. * test(transfer): keep chooser background stamps from taking the injected check The chosen-folder check failed or held only the first stamp of the folder, which the chooser's own relocation, relist and freshness work could make first under load, so the check succeeded and the chooser closed. Inject into every unforced stamp of the case and pass over forced freshness stamps. * test(columns): wait for the autofit animation to end before comparing widths The animated case read the column after a fixed 280 ms, but its ticks wait for frames, which a loaded runner draws late, so the column was still mid-animation. Wait for the column to end at the saved width instead. --------- Co-authored-by: Pierre Berube <[email protected]>
wmfeht
added a commit
to wmfeht/strata-feature-map
that referenced
this pull request
Nov 7, 2026
Sync lgse/strata#2041, #2044, #2045: tab teardown, Icons Left wrap, portal text scaling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Strata slowed down in proportion to uptime (#2021). An overnight soak reproduced it in two hours: every closed tab kept its whole widget tree and
ViewStatealive, and the registries that every icon creation and preference binding scans (PRIMARY_ICONS,INTERFACE_ICONS, preference listeners, theme listeners, thumbnail viewport hooks) grew by roughly 110 listeners and 160 icons per closed tab, in every view mode. A folder open went from 0.5 s to 2.6 s and an idle main-loop round trip from 1 ms to 9 ms after 300 closes. File watchers were not involved (inotify watches stayed at 10).The leaks were reference cycles between a tab's widgets and the closures attached to them:
composition/layout.rs), and the sidebar animation tick captured the paned (sidebar_width.rs);device_menu.rs,sidebar_devices.rs);Rather than hunt each one,
TabWindow::discardand the window unrealize path now callWindowContent::destroy, which disposes the closed tab's widget tree the waygtk_window_destroydisposes a window: dispose drops every widget's signal handlers and controllers, so any cycle through a closure is broken. Widgets a parent keeps for itself (a range's slider) are left to that parent. The specific cycles above are fixed as well, since they also leak on window close. The preview find bar no longer edits a disposed entry during teardown.Two secondary costs found by the profiler are fixed too:
gio::MenuItem::set_iconwith a 96 px texture, which GLib serializes by PNG-encoding it; that dominated a fresh folder open in Columns. The PNG is now encoded once per texture and handed to every item as agio::BytesIcon.The faster column build exposed a race in Columns: a suppressed focus echo (the listing retaking focus) arriving within the 75 ms preview delay cancelled the pending child mirror of a keyboard move, so the automatic preview never opened.
schedule_child_mirrornow leaves a pending mirror alone when the new focus event cannot schedule one; the mirror re-checks the cursor when it runs.The tab-close regression test now also requires the closed tab's listing widget to be freed and its preference listeners released.
Visual evidence
N/A: no visible change; the fix is in tab teardown and menu construction.
How to test
Expected result: folder opens stay as fast after the tab churn as at startup, memory does not grow with each closed tab, and the Back history menu lists the visited folders most recent first and jumps to the chosen one.
Related issue
Closes #2021