Repository navigation
Conversation
Add experimental_handleOpen to fileOpener registrations. When BB is about to open a tab for that opener through default resolution or the Settings pin, it asks the handler first; true means no tab, while false, a throw or a 3 second timeout open the normal tab. Explicit Open with choices and New Tab file search skip the handler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
patleeman
force-pushed
the
fileopener-handle-open
branch
from
October 16, 2026 23:53
16c8f54 to
3edd1d2
Compare
This branch has not been deployed
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.
Human comments
What was wrong
A plugin
fileOpenercan only show a file by rendering its component inside a new panel file tab. Openers that show files somewhere else have no way to claim the open. Studio Code's VS Code opener sends code files to the thread's single "VS Code" panel tab, so every file open also leaves a useless file tab ("Opened in VS Code beside this thread") next to it. The SDK has no way for an opener to skip the tab or close its own tab.What changed
app-contract.ts, collector):PluginFileOpenerRegistrationgets an optionalexperimental_handleOpen?: (args: PluginFileOpenerOpenArgs) => boolean | Promise<boolean>, wherePluginFileOpenerOpenArgsis{ path, source, lineRange }. The collector checks that it is a function.file-opener-tabs.ts,useThreadFileTabs.ts):createFileOpenerOpenForRequestresolves the opener exactly as before (Open with, Settings → Files pin, slot order) and returns the tab plus a bound handler.openResolvedTabcalls the handler before inserting the tab:true: no tab is created or focused.false, a throw/rejection, or no answer within 3 seconds: the normal opener tab is inserted, as today.openTabstill returns the tab synchronously, so callers likeopenFilePreviewkeep revealing the panel; the tab is inserted once the handler declines.frontend-core-slots.md,docs/api_to_audit.mdentry, Plugin Guide surface symbols.No server/daemon wire changes. Plugins built against older hosts are unaffected; on older hosts the field is ignored and
componentremains the fallback.How you verified
useThreadFileTabs.test.ts(handled → no tab and handler args include source and line range; declined/throwing → opener tab; explicit Open with → handler skipped),file-opener-tabs.test.ts(callFileOpenerHandleOpen: true/false, throw/reject, timeout).pnpm exec turbo run typecheck --filter=@bb/app --filter=@get-bb/plugin-sdk --filter=bb-plugin-plugin-api-docs: passed.vitest run src/components/plugin/file-opener-tabs.test.ts src/components/secondary-panelin apps/app: 57 files, 531 tests passed.turbo run test --filter=@get-bb/plugin-sdk --filter=bb-plugin-plugin-api-docs: 371 + 72 passed.🤖 Generated with Claude Code