Prepare TrackLayout for usage#13
Merged
Merged
Conversation
Mark branch range and relations as used for layout This means they should move from track.rs to layout.rs at some point.
This makes it easier to read the high level function.
Give general introduction and mention future and legacy functions.
A new API for print_graph (only) will be added, so it is important that the curent API is properly named to disinguish them.
Text Formatting must be optional, so provide new functions that return data at a lower level.
peso
force-pushed
the
tracklayout
branch
2 times, most recently
from
July 8, 2026 08:41
9cf4b42 to
ff4ec63
Compare
Contributor
Author
|
One step closer to #6 |
Document terms used throughout Gleisbau. Describe how branch assignment works
This is intended for internal usage only
This field defines the start and end row used for layout of a branch. Add a flag to indicate if the track continues outside what is visualized. The old version used An Option<usize> where None meant undetermined. The new representation has the benefit that it can always be drawn, even if we know that it should be continued. Some visualsations need to know where last visible commit was, which was not possible with the old structure.
This means the parent is outside the layout range. Just ignore it, or make a line all the way to the bottom for the current branch visualisation. Each such parent should have a line terminating outside range. which can be a 1-char marker or a line.
Logging is a debugging tool which usually generates lots of data, but this change only adds call notification at important API points at tracing level.
Explain what inserts are and how they fit in the algorithm.
As layout is a subset of the full topology, we need to take the start offset into account. index_map previously mapped from (absolute commit index) to (grid row) Now it maps from (commit index relative to layout) to (grid row)
For edge layouts, it may occur that it lists too many commits. I assume it never goes before commit 0. For those fake commit-index, return an empty inserts value.
Apparently there are two locations that create the Grid - legacy code - new code Maybe I should adapt get_inserts so it computes grid heigt? Maybe a separate function to compute needed height from inserts and text heights.
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.
Implement the most critical functions to demo the new API on gitui