Repository navigation
fix(tui): put the diff side panel behind an experiment #55456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opencode bot explain these changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hunk undoes a layout change from #47152 for the full-screen diff only. The docked side panel keeps the new layout.
c0d41d2b2): it changed#diff-source-headerfromheight={1}with no vertical padding topaddingTop={1} paddingBottom={1} height={3}. That gives the header breathing room inside the docked panel. But the header renders whenever the file tree is hidden (<Show when={!showFileTree()}>, line 838), and that also covers the narrow full-screen diff (width < 90or tree turned off; see line 334). So the full-screen view also got a 3-row header, which pushed the diff down two rows.docked(), i.e.props.panel?.presentation === "panel"(line 325). Otherwise the header is back to a single row with no padding, exactly as before feat(tui): render diffs in plugin panel slots #47152.?hint change (line 1137): feat(tui): render diffs in plugin panel slots #47152 moved the absolutely positioned compactHelpShortcutfromtop={0}totop={1}so it lined up with the padded header. Now that the full-screen header is one row again, it goes back totop={0}. This block already has!docked()in its condition, so the panel isn't affected; the panel has its own footer (line 1101).Together these make the full-screen diff look the same as before #47152, which is what the experiment needs when it's off. The rest of the PR is the
/diffcommand change (line ~1297): it only callsui.panel.open(ROUTE)whenexperimental["diff-panel"] === true, and otherwise falls through to the full-screen route.To check this, I compared the PR diff against
c0d41d2b2and its parent, and the old values match. I didn't run the tests or render anything. I made no changes to the checkout.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but in the other PR, the docked mode is optional, you can also switch it to fullscreen mode. so it was buggy before in fullscreen mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not buggy, just a different look. When you switch the panel to fullscreen,
docked()is false, so it takes the same non-docked layout path as the standalone full-screen diff. #47152 padded the header for every view, so both of those views got the 3-row header with the?hint attop={1}. That was consistent and didn't break anything, but it changed the full-screen layout from what it was before #47152.How it fits together:
docked()is justprops.panel?.presentation === "panel"(diff-viewer.tsx:325).presentationturns into"fullscreen"when you toggle it (diff.toggle_fullscreen), or automatically whenwidth <= 80(context/panel.tsx:14-15).width >= 90when it's enabled (line 334). So the extra padding only showed up in non-docked views narrower than 90 columns or with the tree turned off, in both panel-fullscreen and standalone.?attop={0}. It matches the standalone full-screen diff again. Only the side-by-side docked panel keeps the padded 3-row header. That looks intentional, and I think it's right: fullscreen looks the same however you got there.I checked this by reading the code. I didn't render panel-fullscreen mode, and the PR's Drive runs don't mention panel→fullscreen at a narrow width either. The 80-column runs would hit the forced-fullscreen path, though. No changes made.