samuelwillyanto1 opened a new issue, #8139:
URL: https://github.com/apache/hop/issues/8139

   ### 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.
   
   <img width="1295" height="697" alt="Image" 
src="https://github.com/user-attachments/assets/f2122bd5-caad-47ca-810b-4766352cbc24";
 />
   
   3. **2nd open (after clicking OK and reopening):** The formula input area 
opens partially (truncated/half-size), requiring manual resizing again.
   
   <img width="1280" height="662" alt="Image" 
src="https://github.com/user-attachments/assets/6a15394a-43d9-40ee-aa07-1d50bf0d26b8";
 />
   
   3. **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:**
   ```java
   // Replace:
   rightSash.setWeights(new int[] {10, 80});
   
   // With:
   rightSash.setWeights(new int[] {40, 60});
   ```
   Results After Changing
   
   <img width="1162" height="740" alt="Image" 
src="https://github.com/user-attachments/assets/8cf97b96-3c36-4697-bffa-6b628e861b11";
 />
   
   ### Issue Priority
   
   Priority: 3
   
   ### Issue Component
   
   Component: Hop Gui


-- 
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