yangzhang75 commented on code in PR #8318:
URL: https://github.com/apache/texera/pull/8318#discussion_r3920519245


##########
frontend/src/app/workspace/component/property-editor/property-editor.component.ts:
##########
@@ -74,40 +83,169 @@ import { NzButtonComponent } from "ng-zorro-antd/button";
     NzResizeHandlesComponent,
   ],
 })
-export class PropertyEditorComponent implements OnInit, OnDestroy {
+export class PropertyEditorComponent implements OnInit, OnDestroy, OnChanges {
   @ViewChild("contentWrapper") contentWrapperRef!: ElementRef;
   protected readonly window = window;
   id = -1;
-  width = 260;
+  width = MIN_PANEL_WIDTH;
   height = Math.max(300, window.innerHeight * 0.6);
   currentComponent: Type<any> | null = null;
+  /**
+   * Set while an author is choosing which properties the Form View offers.
+   * Forwarded to the operator frame, which puts a tick box beside each 
property.
+   */
+  @Input() exposeChoosing = false;
+  /**
+   * Whether this panel owns the canvas panel's saved size/position. The Form 
View mounts
+   * this same component inline in a preview box; only the docked canvas panel 
persists, so
+   * the preview copy must not overwrite the shared geometry keys.
+   */
+  @Input() persistPlacement = true;
+  /** Set from the toolbar toggle on the operator canvas; the input covers the 
form view. */
+  private choosingFromToolbar = false;
+
+  /** The choose-what-to-expose affordance appears wherever the feature flag 
is on: any
+   *  workflow can expose inputs to its Form View, independent of the 
default-view bit. */
+  public get offersFormView(): boolean {
+    return this.config.env.formViewEnabled;
+  }
+
+  public toggleChoosing(): void {
+    this.formBindingService.setChoosing(!this.formBindingService.isChoosing());
+  }
+
+  public get choosing(): boolean {
+    return this.exposeChoosing || this.choosingFromToolbar;
+  }
   componentInputs = {};
   dragPosition = { x: 0, y: 0 };
-  returnPosition = { x: 0, y: 0 };
   constructor(
     public workflowActionService: WorkflowActionService,
     private changeDetectorRef: ChangeDetectorRef,
-    private panelService: PanelService
+    private panelService: PanelService,
+    private formBindingService: FormBindingService,
+    private config: GuiConfigService
   ) {
-    const width = localStorage.getItem("right-panel-width");
-    if (width) this.width = Number(width);
+    // A stored "0" is a truthy string, so a panel that was closed before a 
reload used
+    // to come back closed on every load afterwards -- and the button that 
reopens it is
+    // itself hidden until an operator is selected, so the panel simply looked 
broken.
+    // Anything narrower than the resize minimum is treated as no stored width 
at all.
+    const storedWidth = Number(localStorage.getItem("right-panel-width"));
+    if (storedWidth >= MIN_PANEL_WIDTH) this.width = storedWidth;
     this.height = Number(localStorage.getItem("right-panel-height")) || 
this.height;

Review Comment:
   Fixed. closePanel() stores the closed pair (width 0, height 65) together, so 
a sub-minimum stored width means the height beside it is the collapsed 65. 
Height is now restored only alongside a valid width; a closed panel reopens at 
defaults instead of a 65px sliver. Added the height assertion to the 
closed-panel regression test.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to