feat(browser): best-fit zoom button + thicker (12px) grabbable scrollbars - #176
Merged
Merged
Conversation
…bars Two usability fixes for the embedded web-preview browser and the shared scrollbar track. - Bump scrollbarWidth 8 -> 12 so the ScrollView/Table/TreeView/Browser thumbs are comfortably grabbable with the mouse. Pre-existing ScrollView clamp/page/drag tests are re-expressed in terms of scrollbarWidth (viewport = bounds - scrollbarWidth, clamp = content - viewport) instead of literals derived from 8, and stale numeric comments updated. - Add Browser.FitZoom() plus CanFit(): sets the zoom so the whole current page/image fits the content rect on both axes (min(1, cr.W/dispW0, cr.H/dispH0), clamped to [BrowserMinZoom, BrowserMaxZoom]); no-op with no render or an empty content rect. - Add the FitIcon painter seam and a third best-fit button in the toolbar zoom group next to zoom-out/in, routed to FitZoom with correct layout and hit-testing. Full toolkit suite green at 100% statement coverage on every package. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
Two usability fixes for the embedded web-preview
Browserand the shared scrollbar track.scrollbarWidth8 → 12 so the ScrollView / Table / TreeView / Browser thumbs are comfortably grabbable with the mouse. Pre-existing ScrollView clamp / page / drag tests are re-expressed in terms ofscrollbarWidth(viewport = bounds − scrollbarWidth, clamp = content − viewport) rather than literals derived from 8; stale numeric comments updated.Browser.FitZoom()+CanFit(): sets the zoom so the whole current page/image fits the content rect on both axes —min(1, cr.W/dispW0, cr.H/dispH0)clamped to[BrowserMinZoom, BrowserMaxZoom]; no-op with no render or an empty content rect.FitIconpainter seam and a third button in the toolbar zoom group next to zoom-out / zoom-in, routed toFitZoom, with correct layout + hit-testing.Tests
TestBrowserFitZoom(tall→<1 clamped, 1.5×→strictly between min and 1, short→1, no-render / empty-rect no-ops) andTestBrowserClickFitButton(disabled no-op + fit-on-click + address defocus).Full toolkit suite green at 100% statement coverage on every package; cross-builds darwin/linux/windows.
🤖 Generated with Claude Code