Skip to content
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

Fix: when moving from 2 panel to 3 panel the left panel gets larger than expected #1148

Merged
merged 2 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading