Conversation
Extension-author feedback said windowing and selection follow were impossible without host internals. Investigation showed otherwise: everything the built-in sidebar does runs through the scrollbox ref from host-served @opentui/core — scrollChildIntoView over child id props, scrollTop/viewport.height reads, and the scrollbar/viewport change events. The gap was that none of it was documented or committed. Replace the guide's "not supportable today" caveat with the supported ref contract and a follow-selection recipe, note the pre-first-layout zero read, name the OpenTUI-version coupling honestly, and mark the bundled sidebar's scrollbox usage as load-bearing so changing it means updating the contract. A new AppHost test runs the exact published recipe from a TSX fixture extension: a 30-row list follows the selection to its last row, which is only on screen if the ref contract actually scrolled the pane. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M7EZpzieiVPdj6LZn4oBYJ
Contributor
Greptile SummaryThe PR establishes and tests a supported scrollbox-ref contract for custom extension sidebars.
Confidence Score: 4/5The PR appears safe to merge, with a non-blocking coverage gap for several members of the newly committed scrollbox contract. The documented API matches the built-in sidebar’s existing ref usage and the extension fixture validates the main follow-selection path, but regressions in Files Needing Attention: src/ui/AppHost.extension-sidebar.test.tsx Important Files Changed
Prompt To Fix All With AI### Issue 1
src/ui/AppHost.extension-sidebar.test.tsx:520-524
**Contract test omits event APIs**
The fixture exercises only `viewport.height` and `scrollChildIntoView`, leaving `scrollTop` and the three documented scrollbar/viewport event subscriptions without extension-runtime regression coverage. A later host or OpenTUI change can break geometry updates for extensions while this contract test remains green.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "docs(extensions): commit the scrollbox r..." | Re-trigger Greptile |
…t test Review feedback: the fixture proved scrollChildIntoView and a viewport read but left scrollTop and the three documented event subscriptions without extension-runtime coverage, so a host or OpenTUI change could break geometry updates for extensions while the contract test stayed green. The fixture now subscribes to the scrollbar change and viewport layout-changed/resized events exactly as the guide documents (including the .off cleanup) and reports scrollTop and viewport.height from each firing; the test asserts the events delivered a nonzero viewport height after layout and a nonzero scrollTop after the follow scrolled the pane. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M7EZpzieiVPdj6LZn4oBYJ
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
1 task
This branch was successfully 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.
What
Replaces the authoring guide's "pane geometry / selection follow are not supportable in a third-party sidebar" caveat with a documented, committed contract: the scrollbox ref. Custom sidebars hold a React ref to their
<scrollbox>, give rows stableidprops, and get:scrollChildIntoView(id)for selection following (with a full recipe in the guide),scrollTop/viewport.heightfor pane geometry — including the pre-first-layout zero-read caveat,verticalScrollBar/viewportchange events for reacting to scrolling and pane resizes.Why
Extension-author feedback (round 2, finding 1) claimed a third-party sidebar cannot reproduce the built-in sidebar's windowing or follow-selection without host internals. Investigation showed the claim was overstated: everything the built-in sidebar does with its scrollbox goes through host-served
@opentui/coreand plain refs, which extensions already receive — the only internal pieces are rendering helpers. The real gap was that none of this was documented or committed, so authors reasonably treated it as off-limits. The feedback itself suggested "a supported scrollbox ref contract" as the alternative; this PR makes that the answer, instead of new viewport props that would duplicate what the ref already exposes.How
id-on-box pattern), the committed ref surface, and an honest caveat that the contract rides on Hunk's pinned OpenTUI version — with the built-in sidebar exercising the same calls as the compatibility guarantee.scrollChildIntoViewscrolled; the fixture's ref reads prove the geometry side.Testing
src/ui/AppHost.extension-sidebar.test.tsx(suite now 8 passing).bun run typecheck,bun run lint,bun run check:pack, fullsrc/suite — all green.Changeset:
patchforhunkdiff.🤖 Generated with Claude Code
https://claude.ai/code/session_01M7EZpzieiVPdj6LZn4oBYJ
Generated by Claude Code