refactor: update CIStatusWidget dimensions and adjust layout in ChangesViewPane

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
mrleemurray
2026-03-26 15:30:40 +00:00
parent 388a59a15e
commit f7784f32af
3 changed files with 12 additions and 11 deletions

View File

@@ -440,13 +440,13 @@ export class ChangesViewPane extends ViewPane {
}));
// Shared constants for pane sizing
const ciMarginTop = 8; // matches margin-top on .ci-status-widget
const ciMinHeight = CIStatusWidget.HEADER_HEIGHT + CIStatusWidget.MIN_BODY_HEIGHT + ciMarginTop;
const ciMinHeight = CIStatusWidget.HEADER_HEIGHT + CIStatusWidget.MIN_BODY_HEIGHT;
const treeMinHeight = 3 * 22; // three tree rows (row height = 22)
// Top pane: file tree
const treePane: IView = {
element: this.contentContainer,
minimumSize: ciMinHeight,
minimumSize: treeMinHeight,
maximumSize: Number.POSITIVE_INFINITY,
onDidChange: Event.None,
layout: (height) => {
@@ -464,15 +464,14 @@ export class ChangesViewPane extends ViewPane {
maximumSize: Number.POSITIVE_INFINITY,
onDidChange: Event.map(this.ciStatusWidget.onDidChangeHeight, () => undefined),
layout: (height) => {
const innerHeight = Math.max(0, height - ciMarginTop);
ciElement.style.height = `${innerHeight}px`;
const bodyHeight = Math.max(0, innerHeight - CIStatusWidget.HEADER_HEIGHT);
ciElement.style.height = `${height}px`;
const bodyHeight = Math.max(0, height - CIStatusWidget.HEADER_HEIGHT);
ciWidget.layout(bodyHeight);
},
};
this.splitView.addView(treePane, Sizing.Distribute, 0, true);
this.splitView.addView(ciPane, CIStatusWidget.HEADER_HEIGHT + CIStatusWidget.MIN_BODY_HEIGHT + ciMarginTop, 1, true);
this.splitView.addView(ciPane, CIStatusWidget.HEADER_HEIGHT + CIStatusWidget.PREFERRED_BODY_HEIGHT, 1, true);
// Style the sash as a visible separator between sections
const updateSplitViewStyles = () => {