Portal Community

PanelConstraints Interface

// flow-observer-core/src/types/panel.types.ts
export interface PanelConstraints {
  // Docked (right) constraints
  minWidth?: number;         // default: 320px
  maxWidth?: number;         // default: 800px
  defaultWidth?: number;     // default: 400px

  // Docked (bottom) constraints
  minHeight?: number;        // default: 200px
  maxHeight?: number;        // default: 500px
  defaultHeight?: number;    // default: 300px

  // Floating constraints
  minFloatWidth?: number;    // default: 360px
  minFloatHeight?: number;   // default: 280px

  // Allowed dock positions
  allowRightDock?: boolean;  // default: true
  allowBottomDock?: boolean; // default: true
  allowFloat?: boolean;      // default: true
}

Applying Constraints

// Embedding with custom constraints
<FlowObserverPanel
  executionId={executionId}
  constraints={{
    minWidth: 360,
    maxWidth: 600,
    defaultWidth: 420,
    allowBottomDock: false   // disable bottom dock for this deployment
  }}
/>

Default Constraints

PropertyDefault Value
minWidth (right dock)320px
maxWidth (right dock)800px
defaultWidth (right dock)400px
minHeight (bottom dock)200px
maxHeight (bottom dock)500px
defaultHeight (bottom dock)300px
minFloatWidth360px
minFloatHeight280px

Size Persistence

The user's last-set panel size is saved to localStorage with the key bfai:observer-panel-size. The stored value is clamped to the current PanelConstraints on restore — if constraints change between sessions, the stored size will be adjusted to fit.

Canvas Pushes with Right Dock When the panel is in right-dock mode, the React Flow canvas container receives a CSS padding-right equal to the panel width. This keeps the canvas usable and prevents the panel from overlapping nodes. The canvas re-fits the viewport when the panel width changes.