Repository navigation
Browser panel tabs, with tab tools for Claude - #26
Merged
Merged
Conversation
…w tab, tab tools for Claude Every tab is its own WebView2 on the panel's one CoreWebView2Environment. window.open and target=_blank open a new tab in front (still gated by SchemeAllowed, max 20 tabs). The Browser tool gains tabs, new_tab, switch_tab and close_tab; the other tools act on the front tab, captured once per call, with both page checks on that tab.
… closed, environment retried, tab strip scrolls, smoke checks a refused popup
…se closes only pop-up tabs, WPF's WebView2 no longer closes the window on window.close
…er; a test guards the WebView2 names the close fix reflects on
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Browser panel gets real tabs, and Claude's Browser tool can use them.
target=_blank,window.open) opens in a new tab in front. The page that opened it keeps its window object, so sign-in popups work.window.close()closes only popup tabs, and the tab that opened the popup comes back to the front.tabs,new_tab,switch_tabandclose_tab.Fixes a bug that is already on main
WPF's WebView2 control has its own
WindowCloseRequestedhandler, which closes the whole parent window. So today, a page in the Browser panel that callswindow.close()can close the CCWrapper window and every session in it.DropControlsCloseHandlerremoves that handler. There's no public setting for this, so it uses reflection on the package's private code. A review checked the behavior against the package's compiled code.A new unit test, which CI runs, fails if a WebView2 update renames the private names it relies on. This matters because Dependabot bumps WebView2 weekly.
Checks
dotnet build -c Release: 0 warnings.dotnet test -c Release: 441/441 passed (was 422).--smoke: exit 0. The new tab steps:new_tab,switch_tab,tabsandclose_tab;window.close()closes only the popup tab, and the front goes back to the tab that opened it.Each of these guards was removed once on purpose, and smoke then failed.
Three review rounds by opus. All findings are fixed except one I accepted: a popup a page opens more than about 5 s after the click is dropped with no sign. Chrome does the same, but shows an icon.
Not tested yet: please try before merging
tabs,new_tabandswitch_tab.🤖 Generated with Claude Code