Skip to content

Commit

Permalink
Fix: when moving from 2 panel to 3 panel the left panel gets larger t…
Browse files Browse the repository at this point in the history
…han expected (#1148)

* onContainerResize shouldnt be called during unregister. It morphs the ratios

* defaultLengthFraction should sum to 1. Not necessarily as an api -- just a fix
  • Loading branch information
tintinthong authored Apr 8, 2024
1 parent 86f0516 commit 789e59d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ export default class ResizablePanelGroup extends Component<Signature> {
unregisterPanel(id: number) {
this.listPanelContext.delete(id);
this.calculatePanelRatio();
this.onContainerResize();
}

calculatePanelRatio() {
Expand Down
13 changes: 7 additions & 6 deletions packages/host/app/components/operator-mode/code-submode.gts
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,15 @@ type PanelHeights = {
type SelectedAccordionItem = 'schema-editor' | null;

const CodeModePanelWidths = 'code-mode-panel-widths';
const defaultLeftPanelWidth =
(14.0 * parseFloat(getComputedStyle(document.documentElement).fontSize)) /
(document.documentElement.clientWidth - 40 - 36);
const defaultPanelWidths: PanelWidths = {
// 14rem as a fraction of the layout width
leftPanel:
(14.0 * parseFloat(getComputedStyle(document.documentElement).fontSize)) /
(document.documentElement.clientWidth - 40 - 36),
codeEditorPanel: 0.4,
rightPanel: 0.4,
emptyCodeModePanel: 0.8,
leftPanel: defaultLeftPanelWidth,
codeEditorPanel: (1 - defaultLeftPanelWidth) / 2,
rightPanel: (1 - defaultLeftPanelWidth) / 2,
emptyCodeModePanel: 1 - defaultLeftPanelWidth,
};

const CodeModePanelHeights = 'code-mode-panel-heights';
Expand Down

0 comments on commit 789e59d

Please sign in to comment.