Repository navigation
Draw hierarchy lines in the list's tree - #222
Open
rustytensor wants to merge 2 commits into
Open
rustytensor wants to merge 2 commits into
rustytensor wants to merge 2 commits into
Conversation
[Medium impact] The PR appears safe to merge; no actionable issues remain. SummaryAdds optional hierarchy lines to the list view, with Quiet, Git graph and Trace styles.
Reviews (2) · Last reviewed commit: "Draw hierarchy lines in the list's tree" · Reviewed by Greptile |
The handler's parent was view.item, which is null until the loader has made its view. With no parent, the garbage collector can take the handler, and Ctrl+scroll then no longer steps the size. It now stays on the loader until there is a view.
The list opens folders in place, and only the indent showed what is inside what. A guide now runs down from each open folder and turns into each of its items. There are three styles (Quiet, Git graph, Trace), picked from a new button beside the view button or stepped through with L and Shift+L. They are off by default. TreeLines.qml works the lines out from the rows' depths, which FolderModel::outline() gives in one call. With no lines chosen the rows are never read. The menu is made the first time it is opened.
rustytensor
force-pushed
the
upstream-tree-lines
branch
from
November 23, 2026 18:54
738e4c8 to
73d082a
Compare
Contributor
Author
|
The red check here is |
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.
The list view opens folders in place as a tree, and today only the indent shows what is inside what. This adds hierarchy lines: a guide runs down from each open folder and turns into each of its items with a small curve. They are off by default, so nothing changes until you pick a style.
What you'd notice
Lsteps through the same four choices andShift+Lsteps back, the waySandShift+Sstep the sort order. The keys only work in the list view.What changed
+390 −3, in two commits. Most of it is one new file.
TreeLines.qml(262 lines) draws the lines. It sits in the list's content, above the rows' fills, and takes no clicks. It works the lines out from the rows' depths, not from the row items, because a guide crosses rows the list has not made.FolderModelgetsoutline(), which gives every row's depth and whether it is a folder in one call.get()builds a whole map for one row, which is too much to do for every row of a long list.outline()has one test.Main.qmlkeeps the choice aslineStylein its Settings, and holds the list of styles that the menu and the keys share. A stored value this build does not know draws no lines and is left as it is.PathBar.qmlhas the button and its menu,Glyph.qmlthe button's glyph, andFolderPane.qmlthe two keys. The menu is made the first time it is opened, like the sort menu, and the keys work without it.outline()call, each time rows are added, removed or replaced.?overlay and the README. The new strings are only inen.json.treeLines,linesButton,linesMenuandlines-<style>) are there for the gates below. Nothing else in the code exists for them.FolderPane.qmlthat the lines need. The Ctrl+scroll handler hasparent: view.item, which is null until the loader has made its view. With no parent, the garbage collector can take the handler, and Ctrl+scroll then does nothing.TreeLines.qmlallocates enough while it loads to make that happen often enough thatlistRowsFollowTheSizeStepfailed with it. The handler now stays on the loader until there is a view.Tested
One new test covers
outline(). Everything else is checked by gates, as in #114: 30 checks with fixed expected results, kept outside the PR. They are on thetree-lines-gatesbranch of my fork, and its README lists what each one expects.The gates open Folio's real window and read where the lines are. They cover each style, opening and closing folders, the menu and that it is only made when first opened, the keys, zoom from 0.75 to 2 (the lines must meet the real arrows and pictures), display scales 1.5 and 2, right to left, a settings file with an unknown style, 2,000 rows eight levels deep, a folder opened just before the folder is re-read, a file arriving in an open empty folder, and that "No lines" draws the same pixels as main. In a folder of 10,000 items with one folder open, adding a file calls
outline()once andget()never, and may cost at most 20 ms more with the lines than without. In my last run it was 3 to 6 ms more. The numbers move by more than that on a busy machine.All 30 pass on Omarchy, and
bin/testgives main's result plus the new test: 290 passed, 1 skipped.To run them, in a checkout of this branch that also has a local
main:It needs
cmake,qmake6andpython3. It takes a few minutes, because it rebuilds Folio from clean in the checkout'sbuild/folder and runs the whole test suite.