mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-04-16 10:30:46 -07:00
Root cause on Windows was not the hide/show path, but the close+recreate path when tidgi mini window keeps the app alive while runOnBackground is false. What was actually happening: 1. The user closed the main window. 2. The app stayed alive because tidgi mini window still existed. 3. A second-instance launch recreated a new main BrowserWindow. 4. The old workspace WebContentsView still existed in ViewService. 5. But the new main window missed the automatic restore because the BrowserWindow 'show' event fired inside handleCreateBasicWindow() before registerBrowserViewWindowListeners() attached the 'show' listener. 6. If the user then clicked the workspace icon, showView() reattached the old view manually, but its resize listener was still bound to the old destroyed BrowserWindow, so resizing the new window no longer resized the view. Fix: - ViewService now rebinds the debounced resize handler every time showView() attaches an existing view to a BrowserWindow. - Window.open() now detects the recreate-main-window case for BrowserView windows and immediately calls refreshActiveWorkspaceView() if the active workspace already has an existing view instance. This restores the view without waiting for a workspace icon click. Why old E2E missed it: - It simulated hide/show (runOnBackground=true) instead of the real user path (main window close + app kept alive by tidgi mini window). - It only checked that the view was within visible bounds; it did not resize the window and assert the view filled the content area after the reopen. New E2E coverage: - Configures tidgiMiniWindow=true and runOnBackground=false before launch. - Closes the main window, reopens it via second-instance, verifies refresh/view-shown markers, verifies bounds, resizes the recreated main window, and asserts the BrowserView fills the content area after the debounced resize handler runs. - Scenario passes locally: 1 scenario, 20 steps, all green. |
||
|---|---|---|
| .. | ||
| agent.ts | ||
| application.ts | ||
| browserView.ts | ||
| cleanup.ts | ||
| logging.ts | ||
| menu.ts | ||
| sync.ts | ||
| tidgiMiniWindow.ts | ||
| ui.ts | ||
| wiki.ts | ||
| window.ts | ||