Skip to content

Add inspectable plugin mention context - #1870

Open
brsbl wants to merge 16 commits into
bb/browser-page-runtime-final-thr_p9qmfkggwmfrom
bb/inspectable-plugin-mentions-thr_p9qmfkggwm
Open

Add inspectable plugin mention context#1870
brsbl wants to merge 16 commits into
bb/browser-page-runtime-final-thr_p9qmfkggwmfrom
bb/inspectable-plugin-mentions-thr_p9qmfkggwm

Conversation

@brsbl

@brsbl brsbl commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add an optional, provider-agnostic inspector hook to plugin mention providers
  • let composer and sent timeline mention pills reopen the same immutable context inspector
  • reuse BB tooltip, Dialog/Drawer, theme tokens, and scroll-boundary fades for preview and overflow states
  • keep ordinary mentions unchanged when no preview or inspector is provided
  • resolve captured context only at send time while keeping preview screenshots out of agent context
  • allow independent removal without changing adjacent authored text or other references

The hook is generic enough for Browser selections, files, comments, Figma nodes, and database records. Browser capture and selection behavior remains plugin-owned.

Safety

  • inspection uses authenticated JSON POST requests with cross-site request rejection
  • preview and inspection fields have shared per-field and total byte limits
  • raster previews validate media type, base64 encoding, signature, and decoded size
  • absent optional data remains absent rather than becoming false or null

Visual evidence

The before/after composer comparison uses the same 16-item Team members fixture, Inspectable mention visual QA route, 1280×900 desktop dev-app window, device scale, and matching crop. Before is the exact parent head dd66e0893; every after capture is from exact final head f740d15e7. Images and overlays were allowed to finish loading and animating before capture.

Dense composer: before

State: the parent layer renders all 16 plugin mentions as ordinary pills. They do not expose preview or inspector interaction.

Before: 16 ordinary plugin mention pills

Dense composer: after

Action: keyboard-focus the first inspectable mention.

Result: one opaque BB tooltip opens above that pill with the complete captured selector, role, bounds, nearby controls, and tab-revision context. The other 15 pills remain unchanged.

After: one settled preview tooltip in the same 16-pill composer

Settled inspector

Action: click the mention, or focus it and press Space.

Result: the inspector opens with its decoded 1800×1400 screenshot and description fully rendered. There is no ghost, loading shell, or partially rendered second modal.

After: fully settled inspectable mention dialog

Expanded preview: desktop

Action: click the screenshot in the inspector.

Result: the full image opens at 1280×900. The close button is flush with the displayed image's top-right corner: its top equals the image top and its right edge equals the image right edge.

After: expanded preview with close button flush to the image corner at desktop width

Expanded preview: narrow

Result at 768×900: the image scales without clipping, and the close button remains flush with the same top-right corner.

After: expanded preview with the same corner alignment at narrow width

Validation

  • pointer hover and keyboard focus expose the preview; keyboard Space reopens the inspector
  • top, middle, and bottom scroll states show the correct boundary fades; mid-scroll exposes both fades
  • composer comment remains editable next to the mention; the sent timeline pill reopens the same inspector
  • focused insertion, independent removal, immutable resolution, screenshot exclusion, overflow, and sent-mention coverage passed
  • exact image decode was 1800×1400 before each capture
  • at 1280×900, image bounds were x=165.57, y=81, width=948.85, height=737.99; the 36px close control had the same top and right edge
  • at 768×900, image bounds were x=38.40, y=181.20, width=691.20, height=537.59; the 36px close control again had the same top and right edge
  • five repeated inspector/open-image/Escape cycles preserved complete image decode and exact corner geometry
  • focused inspector, tooltip, and lightbox tests passed; app typecheck, affected-file lint, and git diff --check passed

Depends on the Browser runtime foundation PR and supersedes the inspectable-mention portion of #1643.

BB-Thread-ID: thr_p9qmfkggwm

AGENT GENERATED: by GPT-5.6-Sol

@brsbl
brsbl force-pushed the bb/inspectable-plugin-mentions-thr_p9qmfkggwm branch from f918b2d to 8283c85 Compare August 19, 2026 02:34
brsbl added 6 commits August 18, 2026 21:33
…r_p9qmfkggwm' into bb/inspectable-plugin-mentions-thr_p9qmfkggwm
…r_p9qmfkggwm' into bb/inspectable-plugin-mentions-thr_p9qmfkggwm
…r_p9qmfkggwm' into bb/inspectable-plugin-mentions-thr_p9qmfkggwm
…r_p9qmfkggwm' into bb/inspectable-mentions-refresh-thr_p9qmfkggwm

# Conflicts:
#	packages/templates/src/generated/plugin-sdk-dts.generated.ts
brsbl added 3 commits August 19, 2026 12:34
…nspectable-plugin-mentions-integration-thr_p9qmfkggwm

# Conflicts:
#	packages/templates/src/generated/plugin-sdk-dts.generated.ts
…nspectable-plugin-mentions-integration-thr_p9qmfkggwm
@brsbl
brsbl marked this pull request as ready for review August 19, 2026 19:45
@bb-slop-cop

bb-slop-cop Bot commented Aug 19, 2026

Copy link
Copy Markdown

🚨 SLOP COP 🚨 · review

I am SlopCop. I am reviewing this pull request for security, code quality, performance, architecture, and end-to-end behavior.

I will post one final review after the parallel checks and independent verification finish.

Comment thread apps/server/src/browser-request-guard.ts Outdated
Comment thread packages/domain/src/shared-types.ts Outdated
Comment thread apps/app/src/components/promptbox/mentions/PromptMentionInspector.tsx Outdated
Comment thread packages/plugin-sdk/src/backend-contract.ts Outdated

@bb-slop-cop bb-slop-cop Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 SLOP COP 🚨 · review

Plain English summary

This PR lets a plugin mention show a short preview. It also opens a detail panel with text, comments, metadata, and images. The design is useful, but five issues remain.

Findings

  1. High — The new Fetch Metadata check blocks a configured cross-site app. It returns 403 before the trusted-origin check. This can break API calls and browser WebSockets.
  2. Medium — The new prompt fields cross the host daemon command boundary. The protocol version remains at 135, so enrolled machines may not update.
  3. Medium — The inspector hides valid provider data. Image results can lose required metadata, comments without images do not appear, and some descriptions disappear.
  4. Medium — New public preview members do not use the required experimental_ prefix. This exposes unaudited stable SDK names.
  5. Low — The inspector casts its HTTP response without runtime validation. A null or malformed result can leave an incomplete dialog.

Architecture

The app, server, and SDK use separate inspection result types. These types already disagree about the comments field. A shared runtime schema can remove this drift and validate the HTTP boundary.

Security and performance

I reproduced the configured-origin 403 with a direct guard probe. The raster validation and React text render paths did not produce a retained injection finding. The final verifier removed performance claims that did not have a measured failure.

Validation

  • I reviewed head afe0376da5b0c4c490aed827e2aece06c8bf38fd against merge base eb7c3993de6434df9e05d94f290ffcdad53675f3.
  • git diff --check passed.
  • The focused inspector test passed all five tests.
  • Specialist checks passed 17 server tests, 113 app tests, 11 domain tests, and four SDK tests.
  • Exact-head GitHub CI passed all app, server, package, integration, and smoke checks.
  • The local dev server did not start after its SDK build. The repository also lacks an inspectable mention fixture. I could not complete the live browser path.
  • Five parallel specialist reviews and one GPT-5.6 verification gate produced these findings.

I left a line comment for each finding. I used a review comment only. I did not approve the pull request or request changes.

brsbl added 5 commits August 19, 2026 13:47
…r_p9qmfkggwm' into bb/inspectable-plugin-mentions-integration-thr_p9qmfkggwm

# Conflicts:
#	packages/plugin-sdk/bundled-types/bb-plugin-sdk-app.d.ts
#	packages/plugin-sdk/bundled-types/bb-plugin-sdk-provider-bridge.d.ts
#	packages/plugin-sdk/bundled-types/bb-plugin-sdk-testing.d.ts
#	packages/plugin-sdk/bundled-types/bb-plugin-sdk.d.ts
#	packages/templates/src/generated/plugin-sdk-dts.generated.ts
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