Skip to content

Renderdag column parts - #1483

Open
rockboynton wants to merge 2 commits into
meta:mainfrom
rockboynton:renderdag-column-parts
Open

rockboynton wants to merge 2 commits into
meta:mainfrom
rockboynton:renderdag-column-parts

Conversation

@rockboynton

@rockboynton rockboynton commented Oct 31, 2026 •

Copy link
Copy Markdown

Expose each graph-line segment's owning column so callers can color graph edges by column.

Here is example of what it looks like when used in jj:

image

jj PR: jj-vcs/jj#10548

A prefix line renderer joins all the columns of a link, term, or pad
line into one text part. So a caller cannot tell which column drew each
character, and it cannot style each edge, for example with one color for
each column.

Add a ColumnText part that carries the column of its edge, and make the
three renderers give one for each column. A connector between two
columns goes to the column whose line ends in the link line, or else to
the column farther from the node. That way a fork or a merge takes the
color of its branch.

The rendered text does not change.
The text output stage writes each line into a String, which drops the
column of each piece. A caller that styles each column through its own
writer, such as a CLI formatter, cannot use the stage. It also cannot
copy the stage, because the padding and message rules are private.

Add write_next_lines, which gives each line to a callback as a list of
pieces that keep their columns. The stage still trims trailing
whitespace, now across pieces. write_next_text keeps its signature and
calls the new method, so current callers see no change.
@meta-cla meta-cla Bot added the CLA Signed label Oct 31, 2026
@rockboynton rockboynton mentioned this pull request Oct 31, 2026
6 tasks done
@meta-codesync

meta-codesync Bot commented Oct 31, 2026

Copy link
Copy Markdown

This pull request has been imported. If you are a Meta employee, you can view this in D128852423. (Because this pull request was imported automatically, there will not be any future comments.)

This branch has not been deployed

No deployments
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.

1 participant