Skip to content

Add reopen closed tab shortcut - #2686

Open
brsbl wants to merge 10 commits into
mainfrom
bb/add-reopen-closed-tab-shortcut-thr_ufp89hj9ea
Open

Add reopen closed tab shortcut#2686
brsbl wants to merge 10 commits into
mainfrom
bb/add-reopen-closed-tab-shortcut-thr_ufp89hj9ea

Conversation

@brsbl

@brsbl brsbl commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The secondary panel had no command or state for restoring a closed tab, and the desktop-only Cmd+Shift+T binding was assigned to opening a terminal instead of the platform-standard reopen gesture. The first implementation also treated incomplete storage inventories as authoritative, rebuilt restored tabs from canonical rather than visible placement, and left browser WebContentsViews visible while the host renderer reloaded.

What changed

  • Added the panel.reopenClosedTab app command, a desktop default of Cmd+Shift+T, and a matching native File menu item.
  • Added a 25-entry LIFO history for closed file, browser, and plugin-panel tabs. Reopened tabs become active; launchers, fixed tabs, and destroyed terminal sessions are excluded.
  • Keyed history by one canonical panel-context identity—panel state, environment, project, project host, and file-owner thread—so each context has an independent stack. Ownership is enforced when recording; restoration only pops the current stack and validates resource liveness.
  • Preserved storage-inventory readiness and truncation. Restoration waits for an authoritative inventory, performs targeted existence checks when the inventory is truncated, skips deleted or foreign-owner entries, and continues to the next valid entry.
  • Preserved each tab's visible split-panel placement when it is temporarily removed and restored, independent of canonical fixed-panel ordering.
  • Hid browser WebContentsViews before native or keyboard renderer reloads so stale child views cannot cover or intercept the replacement renderer; the fresh renderer reattaches and shows them after startup.
  • Kept terminal opening on its existing cross-platform Cmd+Shift+Enter binding and documented the shared panel command for plugin surfaces.
  • Added focused regressions for history ordering and exclusions, environment/project/project-host/file-owner isolation, storage readiness and truncation, deleted and beyond-page storage files, visible tab placement, default bindings, native accelerators, the menu action, and desktop reload preparation.
  • Refreshed the tracked public SDK inventory for the additive command-ID value. No host-daemon wire contract changed, so HOST_DAEMON_PROTOCOL_VERSION is unchanged.

Before

The merge base has no reopen-closed-tab command.

Before: keyboard settings return no result for Reopen closed

Native View → Reload with an open browser view could leave the host renderer blank.

Before: blank renderer after native reload

After

The exact PR branch exposes the desktop shortcut as Cmd+Shift+T.

After: keyboard settings show Reopen closed panel tab with Shift Command T

Native View → Reload restores both the host renderer and embedded browser view.

After: host renderer and browser view restored after native reload

Exact-head desktop smoke evidence

Two browser tabs open:

Two browser tabs open

Both browser tabs closed:

Both browser tabs closed

First Cmd+Shift+T restores the most recently closed tab and its URL:

First tab restoration

Second Cmd+Shift+T restores the remaining tab:

Second tab restoration

A third Cmd+Shift+T is a no-op, and the original visible order remains Browser · Example Domain:

Restored tabs retain their original visible order

How you verified

  • Exact candidate: e82f32cb5d961299d69be7f2f1bfde80b49a1270 in the branch desktop app, Electron 41.7.0.
  • Pass: opened two browser tabs, closed both, and pressed the real Cmd+Shift+T gesture twice. The tabs returned in reverse close order, the URL was retained, the original visible placement was restored, and a third press was a no-op.
  • Pass: opened the exact Electron app's native File menu and confirmed its accessibility tree exposes Reopen Closed Tab. The OS-level menu capture was discarded because an unrelated system prompt contaminated the frame; accessibility evidence is used instead of presenting misleading visual evidence.
  • Pass: invoked native View → Reload with a live browser view. The replacement host renderer loaded, the child browser view reattached, and both remained interactive after settling.
  • Pass: regression coverage switches across environments and also distinguishes project, project host, panel state, and file-owner thread before restoring only the nearest entry owned by the active context.
  • Pass: storage regressions cover unresolved inventories, truncated inventories, valid paths beyond the first page, deleted files, foreign owners, and open storage tabs that must not be pruned from an incomplete inventory.
  • Reviewed every retained screenshot for clipping, layout shift, stale frames, and incorrect tab state. No visual defect remains in the captured flows.
  • Per repository policy, tests, typechecks, and lint were not run locally. Pull-request CI is fully green: checks, app/server/package/integration tests, Linux/macOS package smoke, and version checks all passed.

Final review and triage

One deliberate architecture and implementation review was run for this PR. Its findings were validated, then all confirmed product defects from the review and smoke pass were fixed:

  • P1 — fixed: native desktop reload could leave a live browser child view covering and intercepting the replacement host renderer.
  • P1 — fixed: closed-tab history could cross environment/checkout boundaries without using the complete panel, environment, project, project-host, and file-owner identity.
  • P2 — fixed: unresolved or truncated storage inventories could transiently restore a deleted file or permanently discard a valid entry beyond the inventory page.
  • P2 — fixed: the second restored tab could be appended instead of returning to its original visible split-panel placement.
  • P2 — fixed: deleted or foreign-owner thread-storage entries are skipped while restoration continues to the next valid history entry.

No known product defect remains from the review, smoke test, or screenshot inspection. One QA-infrastructure observation remains outside this feature: on a cold desktop-dev launch, the launcher's fixed readiness window can expire while branch packaging is still completing, producing a temporary blank window. Logs and the later automatic load established that this was service readiness timing rather than a renderer crash.

BB-Thread-ID: thr_ufp89hj9ea

AGENT GENERATED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant