mattcasters opened a new pull request, #7695:
URL: https://github.com/apache/hop/pull/7695

   ## Summary
   
   Fixes [#7692](https://github.com/apache/hop/issues/7692): after changing a 
variable in an environment configuration file and accepting the reload prompt, 
Hop GUI closed all open files but never reopened them.
   
   ### Root cause
   
   On project/environment enable, `ProjectsGuiPlugin.enableHopGuiProject()` 
correctly:
   
   1. Saves the open-files audit list via `writeLastOpenFiles()`
   2. Closes all tabs via `closeAllFiles()`
   3. Reopens from that list via `openLastFiles()`
   
   During step 2, bulk close paths (especially 
`ExecutionPerspective.closeAllTabs()` → `closeTab()`) called 
`writeLastOpenFiles()` **again** after explorer tabs were already empty. That 
overwrote the just-saved list with an empty one, so step 3 had nothing to 
restore.
   
   Startup reopen still worked because `reOpeningFiles=true` skips those 
intermediate writes; mid-session environment reload did not set that flag.
   
   Related recent churn that made this easier to hit: editor split/detach 
restore (#6708 / #7580) and execution-tab close-all on project switch.
   
   ### Fix
   
   1. **Do not rewrite the open-files audit during bulk close**
      - `HopGuiAuditDelegate.writeLastOpenFiles()` returns early when 
`fileDelegate.isClosing()`
      - `closeTab` in Execution / Explorer / Metadata perspectives skips the 
audit write while closing en masse
   
   2. **Safer reopen**
      - `openLastFiles()` sets `reOpeningFiles` for the duration of restore 
(same pattern as GUI startup) so per-file open does not rewrite audit 
mid-restore
      - After restore completes, write the actual open set once
   
   3. **Project/environment enable ordering**
      - Save explorer layout **before** closing tabs (while the split layout 
still matches open files)
      - Reopen files **synchronously** after HopGui variables are final, 
**before** `ProjectActivated` listeners refresh the explorer (avoids async race 
with layout restore)
   
   ## Test plan
   
   - [x] Open one or more pipelines/workflows, optionally with Execution 
Information tabs open
   - [x] Edit a variable in an environment configuration file and accept the 
reload prompt
   - [x] Confirm files close and reopen correctly
   - [ ] Switch project/environment from the toolbar and confirm tabs restore
   - [ ] Restart Hop GUI with "Reopen tabs on startup" enabled and confirm last 
files still restore
   - [ ] Manually close a single tab and confirm the open-files list still 
updates (normal close path)


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