Simplify New Worktree to only restore active buffer or fullscreen agent panel (#51700)

Dramatically simplifies what "New Worktree" does when forking a
workspace.

Previously we captured the entire dock structure and all open file
paths, then restored them all in the new worktree workspace. Now the
behavior is:

- If you have an active buffer open, we reopen just that one file (no
other buffer state is carried over).
- If you do not have an active buffer open, we instead fullscreen (zoom)
the agent panel (equivalent to cmd-esc).

No other workspace state is carried over.

Implementation details:
- Replace `capture_dock_state` / `set_dock_structure` /
`open_item_abs_paths` with a single `active_file_path` lookup.
- Pass `None` for the `init` closure instead of restoring dock layout.
- Only reopen the single active file via `open_paths`, with proper error
logging (`detach_and_log_err`) instead of silent `.detach()`.
- Emit `PanelEvent::ZoomIn` on the agent panel when no active buffer
exists, after `focus_panel` to ensure the panel is properly activated
first.
- Warn when an active file exists but cannot be remapped to the new
worktree.

Closes AI-87

Release Notes:

- N/A
bfa5e88b66Richard Feldman committed on 3/16/2026, 9:22:11 PM· committed by GitHubparentc17bc26
1 file changedLine totals unavailable