fix(annotate): hide the collapsed sidebar tab flags when tools are hidden - #1226
Merged
Conversation
The header's "Hide tools" toggle dropped the annotation toolstrip and the HtmlViewer action cluster, but the collapsed sidebar tab flags kept protruding from the left edge, so a rendered HTML page never actually got the whole viewport. Fold both overlay guards into one derived `htmlChromeHidden` and apply it to the SidebarTabs render. The flags unmount rather than fade, so nothing focusable stays in the tab order and no click target sits over the page. The toggle only exists on HTML surfaces, and both restore paths stay visible: "Show tools" lives in the header (never hidden), and Mod+B still opens the sidebar directly.
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.
TLDR
Hide toolson a rendered HTML annotate session left the collapsed sidebar tab flags stuck to the left edge, so the page never actually went full screen. They now unmount with the rest of the overlay chrome and come back withShow tools.Before / after
The header toggle is
htmlToolsHiddeninpackages/editor/App.tsx(label:Hide tools/Show tools, rendered byAppHeaderonly whenhtmlSurfaceis true). It already hid two things:AnnotationToolstripHtmlVieweraction cluster (hideControls)It did not hide
SidebarTabs(packages/ui/components/sidebar/SidebarTabs.tsx), the collapsed tab strip that rendersabsolute left-0 top-0whenever the sidebar is closed. Those are the "tongue" tabs: Table of Contents, Versions, Messages, Files, and the Agent TUI flag.After: the same toggle drops the tab strip too. Both guards now read one derived value:
The strip is unmounted, not faded or
pointer-events: none, so its buttons leave the tab order entirely and nothing invisible remains hoverable or clickable over the page.Scope decision
Applied to every surface where the toggle can exist, which today means HTML render sessions only.
htmlToolsHiddenis not a global chrome state.AppHeaderrenders the button behindhtmlSurface && onToggleHtmlTools, so plan review, markdown annotate, and archive have no hide-tools affordance at all and are untouched by this change. Keeping theisHtmlSurfacefactor in the derived value (rather than testinghtmlToolsHiddenalone) preserves that boundary if the state is ever reused, and it matches the guard the toolstrip was already using.I did not extend hide-tools to markdown surfaces. That would be a new feature, not this bug, and the centered markdown column does not have the same edge-to-edge claim on the viewport that a raw HTML page does.
No lockout
Two independent ways back, neither of which the toggle hides:
Show toolsin place.Mod+B(toggleContentsinpackages/ui/shortcuts/plan-review/sidebar.shortcuts.ts) still opens the sidebar while tools are hidden.Mod+Shift+Bfor Files andShift Shiftfor the Agent TUI are likewise unaffected.The second test in the new file asserts exactly this: hide tools, confirm the strip is gone, press
Mod+B, confirm the sidebar opens.Files touched
packages/editor/App.tsx- derivedhtmlChromeHidden; applied to theSidebarTabsrender and reused at the existing toolstrip guardpackages/editor/App.htmlHideTools.test.tsx- new DOM test, modeled onApp.archiveReadOnly.test.tsx.github/workflows/test.yml- registered the new file in theDOM_TESTS=1step (the defaultbun testrun skips DOM tests by design)Tests
bun run typecheckcleanbun test2938 pass, 271 skip, 0 failDOM_TESTS=1 bun test packages/editor/App.htmlHideTools.test.tsx2 passApp.tsx, so they are not vacuousApp.archiveReadOnly.test.tsx,planDiffAutoExit.test.tsx, andactionsLabelMode.test.tsto check for cross-file interferenceNo server change. The toggle is component-local state, never persisted and never sent anywhere, so the two-runtime rule does not apply.
apps/pi-extension/vendor.shvendors only server and shared modules, so Pi picks this up from the same editor build.Please eyeball in the browser
I cannot see the UI, so worth a quick look:
plannotator annotate somefile.html, hitHide tools, confirm the left edge is genuinely clean with no residual sliver or hover targetShow toolsrestores both the strip and the toolstripleft-3when the sidebar is open,left-10when closed) is unchanged, but confirm nothing shifted for the visible-tools case