Skip to content

[Bug]: Formula transform editor layout collapses when reopening formula dialog #8139

Description

@samuelwillyanto1

Apache Hop version?

2.20

Java version?

21

Operating system

Windows

What happened?

What happened?

In the Formula transform dialog (inside a pipeline), opening the formula editor multiple times causes the formula text area to collapse or resize inconsistently due to improper SashForm default weights.

When opening the formula editor dialog repeatedly:

  1. 1st open: The formula input area and bottom description pane open normally.
Image
  1. 2nd open (after clicking OK and reopening): The formula input area opens partially (truncated/half-size), requiring manual resizing again.
Image
  1. Subsequent opens: The cycle repeats.

Steps to Reproduce

  1. Create or open a pipeline in Hop GUI.
  2. Add a Formula transform and open it.
  3. Add a new row in the Fields table and click on the Formula cell to open the Formula Expression Editor dialog.
  4. Close the dialog (click OK/Cancel).
  5. Open the Formula Expression Editor again for the same row.
  6. Observe that the top text editor area has collapsed or hidden its text input box until the divider is manually dragged.

Suggested Fix / Root Cause

The issue is caused by the initial weight distribution in the right sash layout (rightSash.setWeights(new int[] {10, 80});), which gives too little initial vertical space to the upper text area and causes it to collapse on subsequent renders.

Adjusting the weights to allocate more proportion to the formula editor area resolves the collapse:

Files:

  • plugins/transforms/formula/src/main/java/org/apache/hop/pipeline/transforms/formula/editor/FormulaEditor.java
  • plugins/transforms/janino/src/main/java/org/apache/hop/pipeline/transforms/janino/editor/FormulaEditor.java

Change:

// Replace:
rightSash.setWeights(new int[] {10, 80});

// With:
rightSash.setWeights(new int[] {40, 60});

Results After Changing

Image

Issue Priority

Priority: 3

Issue Component

Component: Hop Gui

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions