From d35d3a24d071cac05c79be91ac86653aa8497722 Mon Sep 17 00:00:00 2001 From: kary zheng Date: Sun, 4 Oct 2026 00:35:18 -0700 Subject: [PATCH] fix(frontend): dock the result panel at its default height The default height went from 300 to 500 while the docked offset stayed at -300px, so a panel that had never been moved, and every press of the dock button, left 200px of it below the window. The offset now comes from the same constant. Co-Authored-By: Claude Opus 5.5 --- .../component/result-panel/result-panel.component.html | 1 + .../component/result-panel/result-panel.component.scss | 1 - .../component/result-panel/result-panel.component.spec.ts | 7 +++++++ .../component/result-panel/result-panel.component.ts | 3 +++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/workspace/component/result-panel/result-panel.component.html b/frontend/src/app/workspace/component/result-panel/result-panel.component.html index d2c6a535493..5d5d7009c6e 100644 --- a/frontend/src/app/workspace/component/result-panel/result-panel.component.html +++ b/frontend/src/app/workspace/component/result-panel/result-panel.component.html @@ -55,6 +55,7 @@ [nzMinHeight]="250" [nzMaxWidth]="window.innerWidth" [nzMaxHeight]="window.innerHeight" + [style.top.px]="-defaultHeight" [style.width.px]="width" [style.height.px]="height" (nzResize)="onResize($event)" diff --git a/frontend/src/app/workspace/component/result-panel/result-panel.component.scss b/frontend/src/app/workspace/component/result-panel/result-panel.component.scss index 229857b4a44..17f54bd89b0 100644 --- a/frontend/src/app/workspace/component/result-panel/result-panel.component.scss +++ b/frontend/src/app/workspace/component/result-panel/result-panel.component.scss @@ -31,7 +31,6 @@ #result-container { position: absolute; - top: -300px; left: 0; background: white; border-radius: 5px; diff --git a/frontend/src/app/workspace/component/result-panel/result-panel.component.spec.ts b/frontend/src/app/workspace/component/result-panel/result-panel.component.spec.ts index abe5fe1eb2a..7608f7a2ba1 100644 --- a/frontend/src/app/workspace/component/result-panel/result-panel.component.spec.ts +++ b/frontend/src/app/workspace/component/result-panel/result-panel.component.spec.ts @@ -692,6 +692,13 @@ describe("ResultPanelComponent", () => { el.triggerEventHandler(event, payload); }; + // The return position is computed against the default height. Docked a different distance + // above the workspace's edge, a panel opened at that height runs off the bottom of the window. + it("docks the panel one default height above the workspace's bottom edge", () => { + const container: HTMLElement = fixture.debugElement.query(By.css("#result-container")).nativeElement; + expect(container.style.top).toBe(`-${DEFAULT_HEIGHT}px`); + }); + it("renders the docked panel chrome and wires the close / reset actions", () => { component.width = DEFAULT_WIDTH; fixture.detectChanges(); diff --git a/frontend/src/app/workspace/component/result-panel/result-panel.component.ts b/frontend/src/app/workspace/component/result-panel/result-panel.component.ts index 88c29eed760..38e9555c1f4 100644 --- a/frontend/src/app/workspace/component/result-panel/result-panel.component.ts +++ b/frontend/src/app/workspace/component/result-panel/result-panel.component.ts @@ -97,6 +97,9 @@ export class ResultPanelComponent implements OnInit, OnDestroy { componentOutlets!: ElementRef; frameComponentConfigs: Map; componentInputs: {} }> = new Map(); protected readonly window = window; + // The docked panel sits this far above the workspace's bottom edge. The return position is + // computed against the default height, so the two have to be the same number. + protected readonly defaultHeight = DEFAULT_HEIGHT; id = -1; width = DEFAULT_WIDTH; height = DEFAULT_HEIGHT;