Skip to content

Fix the rule below a pull request's header being rendered with the wrong width - #6091

Merged
stefanhaller merged 3 commits into
masterfrom
fix-pr-header-rule-width
Oct 5, 2026
Merged

stefanhaller merged 3 commits into
masterfrom
fix-pr-header-rule-width

Conversation

@stefanhaller

Copy link
Copy Markdown
Collaborator

When selecting a branch that has a pull request associated with it, the main view shows a PR header and a rule below it that separates the header from the branch log. That rule didn't always have the correct width: one scenario where it didn't was when you look at a diff with both staged and unstaged changes whose view is split side-by-side (e.g. because you use gui.mainPanelSplitMode: horizontal), and then jumping to the branches panel with a PR branch selected. In that case, the rule was still rendered to the shorter width of the split view.

stefanhaller and others added 3 commits October 5, 2026 16:38
The next commit checks whether the task was stopped once more before
the command starts. Use the same check there as in the loop that reads
the command's output.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The rule below the header of a branch's pull request is drawn as wide as
the main view. Its width is read when the render is asked for, before
the layout has settled it. If the layout then changes the width of the
main view, for example because it unsplits the view for the content
that comes next, the rule comes out as wide as the view used to be.

Make a prefix a function that is called with the width the render is
laid out to, once the layout has run. The function it returns produces
the text on the render's own goroutine before the command starts. This
way a prefix that takes a while to produce, such as one that runs
commands of its own, holds up only the render and not the UI.

All prefixes are still static here; the next commit lays out the rule
of the pull request header to the width.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The rule was as wide as the main view was when the render was asked
for. If the layout then changed the width of the main view, the rule
came out too long or too short.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@stefanhaller stefanhaller added the bug Something isn't working label Oct 5, 2026
@stefanhaller
stefanhaller merged commit 257b375 into master Oct 5, 2026
14 checks passed
@stefanhaller
stefanhaller deleted the fix-pr-header-rule-width branch October 5, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant