TidGi-Desktop/features/stepDefinitions
lin onetwo eaf205dd10 Fix reopened main window restore after recreation and rebind view resize
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.
2026-03-30 01:26:26 +08:00
..
agent.ts Fix/misc bug (#686) 2026-03-12 21:19:10 +08:00
application.ts Fix reopened main window restore after recreation and rebind view resize 2026-03-30 01:26:26 +08:00
browserView.ts Fix/misc bug2 (#689) 2026-03-24 18:28:38 +08:00
cleanup.ts Add mobile HTTP git sync tests & merge utilities 2026-02-24 16:50:08 +08:00
logging.ts Fix workspaceID case bug, esbuild outbase, autocomplete panel re-render, VIEW_LOADED handler, streaming status polling, and increase executeInBrowserView timeout for E2E stability. All 52 scenarios pass 2026-02-21 12:36:58 +08:00
menu.ts Feat/git chart (#651) 2025-11-08 15:04:34 +08:00
sync.ts Fix/misc bug1 (#688) 2026-03-23 02:48:46 +08:00
tidgiMiniWindow.ts Fix reopened main window restore after recreation and rebind view resize 2026-03-30 01:26:26 +08:00
ui.ts Fix/misc bug (#686) 2026-03-12 21:19:10 +08:00
wiki.ts Fix/misc bug1 (#688) 2026-03-23 02:48:46 +08:00
window.ts Fix reopened main window restore after recreation and rebind view resize 2026-03-30 01:26:26 +08:00