Skip to content

Fix line navigation through plugin file openers - #3471

Merged
ymichael merged 3 commits into
mainfrom
bb/fix-issue-2770-file-line-targets-thr_y2ercp47s9
Sep 11, 2026
Merged

ymichael merged 3 commits into
mainfrom
bb/fix-issue-2770-file-line-targets-thr_y2ercp47s9

Conversation

@ymichael

@ymichael ymichael commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

File-opener tabs retained a linked line range in their owner, but the plugin props and mount omitted it. Monaco therefore opened line-linked files at the top and could not navigate subsequent targets. Tab equivalence also discarded identical targeted opens of an already active file. This reproduces on pristine main at b04091eca6 through a real seeded plugin: clicking line 80 and then range 120–124 leaves Monaco at line 1. See #2770 and its investigation report.

What changed

  • Add optional PluginFileOpenerProps.experimental_lineRange and forward the owner's one-based, inclusive range. Each targeted open supplies a new range object so plugins can observe identical repeat requests.
  • Preserve explicit targeted opener requests through tab deduplication while retaining tab identity and general persistence/equality behavior.
  • Apply the latest target after Monaco finishes loading and on subsequent requests, selecting/revealing lines without recreating the editor or losing unsaved edits. Clamp targets past EOF and leave untargeted opens alone.
  • Update the existing Plugin Guide card, authoring skill, exhaustive prop inventory, and API audit entry. Bump the Plugin SDK to 0.4.56 for the new public surface. The prop remains experimental and older hosts may omit it.

The boot payload measures 1,723,696 raw bytes, 79 bytes over the existing limit. Increase only the raw boot budget by 128 bytes (to 1,723,745) to accommodate the targeted-navigation handling. Compressed and route budgets and forbidden-package guards remain unchanged; the bundle gate passes.

The identical-target refresh extends the issue's proposed forwarding fix. No server-daemon wire changes, authentication or containment changes, or new CLI syntax; no HOST_DAEMON_PROTOCOL_VERSION bump is required. Existing SDK/CLI thread-open requests reach the same fixed boundary.

How you verified

  • Added fail-before regressions: two app tests failed at prop forwarding and identical-request retention; five Monaco tests failed at initial/repeated/pending/EOF navigation. All now pass.
  • 862 focused and adjacent tests passed across 72 files: app 241, Monaco 34, client core 264, Plugin API map 74, Plugin SDK 249. Covers line/range/absent/invalid targets, workspace/host/storage prop forwarding, repeated requests, pending target changes and cancellation, tab synchronization, Markdown parsing, and app WebSocket signals.
  • pnpm exec turbo run build typecheck lint --filter=@bb/app --filter=@bb/client-core --filter=@get-bb/plugin-sdk --filter=@bb/plugin-api-map --filter=bb-plugin-monaco-editor --filter=bb-plugin-plugin-api-docs passed; reran Monaco test/typecheck after the final refinement. SDK declarations and Monaco/Guide plugin bundles build successfully.
  • After reproducing the CI failures locally, the SDK version gate passed, all 111 tasks in the full pnpm exec turbo run build typecheck lint --concurrency=4 run passed, and the server authoring-contract tests (22) and SDK version test (1) passed.
  • Formatting and git diff --check passed. Lint has zero errors and existing warnings.
  • Started pnpm start:worktree in an isolated persistent BB terminal and drove the real installed plugin with dev-browser. Before/after screenshots and actual Monaco selections confirm initial line 80, range 120–124, identical repeats after moving the cursor, and rapid targets ending at line 140. With the read RPC delayed 700 ms, only the latest target is selected. An unsaved edit survives with the same editor/model IDs.
  • Verified CLI thread open ... --line 65, identical repeat, reload restoration, and the updated Guide card. Live traversal, untrusted-Origin, and line-zero requests remain rejected. Final served Monaco bundle hash matches a fresh source build.

Native platforms were not exercised. A Monaco close/disposal console exception also reproduces with the unchanged main plugin bundle; this patch leaves that pre-existing disposal behavior unchanged. Detailed logs, screenshots, and the seeded verification environment are retained in the originating BB thread.

Fixes #2770

AGENT GENERATED

@ymichael
ymichael merged commit fe53586 into main Sep 11, 2026
16 checks passed
@ymichael
ymichael deleted the bb/fix-issue-2770-file-line-targets-thr_y2ercp47s9 branch September 11, 2026 05:37
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.

Plugin file openers drop line ranges, so Monaco opens links at the file top

1 participant