Conversation
An id was measured against the tree's root, so a branch whose own id was nothing like the root's drew in full and so did every bead beneath it, including the ones the branch's id is the front of. A reader met a column of whole ids on exactly the pairs they could most easily have read as one thing. The rule is now that a bead omits the part of its id the bead on the row above already spells, and draws whole where that bead's id is not the front of its own. It holds at every depth and in every tree, so walking up the rows and joining what each says gives the whole id back. That takes the focused-root case with it. A rooted forest shortened every row against the bead it started at, which is this rule written for one depth only; the bead a rooted forest starts at is now a row with nothing above it, and draws whole for the same reason a tree's root does. A copy drawn under a bead it does not descend from now reads whole where it used to read as that bead's child. The sluice fixture draws both copies of one bead, and the second says `slu-1.1` rather than `.1`.
The test promising that a reader can type what the row showed them spelled the query by hand. A search matches on the whole id, so a hand-spelled suffix passes on that alone and never touches the drawn form at all. Taking the query off the row couples the two. With the layout weakened so every row draws its whole id, the hand-spelled `.1` still passes and this does not.
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.
One row on the screen gets longer, and that is the part worth looking at. A bead drawn under one it blocks rather than under its parent was reading as that bead's child:
slu-1.1hanging offslu-1.2drew.1. It now drawsslu-1.1. Everything else here is ids getting shorter.The rule is that a bead omits the part of its id the bead on the row above already spells, and draws whole where that bead's id is not the front of its own. Before this, an id was measured against the tree's root, so a branch whose own id was nothing like the root's drew in full and so did every bead beneath it.
abbreviatenow takes the id above it as anOption, so a row with nothing above it says that in the type rather than by being handed its own id.That takes the focused-root case with it. A rooted forest shortened every row against the bead it started at, which is this rule written for one depth only.
shortened_againstis deleted rather than left beside the general rule: the bead a rooted forest starts at is a row with nothing above it, and draws whole for the same reason a tree's root does.Walking up the rows and joining what each says gives the whole id back. That property is tested in the forest and not in
view::row, becauseabbreviatecannot promise it — handed a grandchild and the tree's root it sees a real string prefix, with no way to know the row above says something else. Choosing the parent is the layout's job, so the layout is where the property lives. It goes red when the layout is pointed back at the tree root.One existing test now tests what its name promises.
a_search_matches_the_shortened_id_the_row_drawsspelled its query by hand, as.1.1— a form no row draws under the new rule, and one that passed anyway because a search matches on the whole id, where any suffix is a substring. The query is now read off the row, so the drawn form and the thing searched for cannot drift apart. With the layout weakened so every row draws its whole id, the hand-spelled query still passes and the one taken off the row does not.