Support configurable default viewport via BROWSE_VIEWPORT#874
Open
FredAmartey wants to merge 1 commit intogarrytan:mainfrom
Open
Support configurable default viewport via BROWSE_VIEWPORT#874FredAmartey wants to merge 1 commit intogarrytan:mainfrom
FredAmartey wants to merge 1 commit intogarrytan:mainfrom
Conversation
085f0e6 to
f8f6c91
Compare
The default viewport (1280x720) is now read from the BROWSE_VIEWPORT environment variable when set (format: "WIDTHxHEIGHT"). Falls back to 1280x720 if unset or malformed. Dimensions are clamped to sane bounds (320-7680 width, 240-4320 height). This lets users configure their preferred viewport without patching source. Works with gstack-config: gstack-config set browse_viewport 1920x1080 Then in SKILL.md preamble: export BROWSE_VIEWPORT=$(gstack-config get browse_viewport)
f8f6c91 to
0476efc
Compare
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
The default browse viewport (1280x720) is hardcoded in three places in
browser-manager.tsplus the responsive desktop preset. This adds aBROWSE_VIEWPORTenvironment variable so users can configure their preferred default without patching source.getDefaultViewport()function inbrowser-manager.tsreadsBROWSE_VIEWPORTenv var (format:WIDTHxHEIGHT)Usage with gstack-config:
gstack-config set browse_viewport 1920x1080Then in a skill preamble:
Files changed:
browse/src/browser-manager.ts— newgetDefaultViewport(), replaces 3 hardcoded viewportsbrowse/src/meta-commands.ts— responsive desktop preset usesgetDefaultViewport()browse/src/commands.ts— updated responsive descriptionbrowse/test/browser-manager-unit.test.ts— 4 new testsbrowse/SKILL.md,SKILL.md— auto-regenerated from templatesTest plan
bun test browse/test/browser-manager-unit.test.ts— 6/6)bun test browse/test/commands.test.ts— 195/195)bun test browse/test/security-audit-r2.test.ts— 77/77)BROWSE_VIEWPORT→ 1280x720 (backward compatible)BROWSE_VIEWPORT=1728x996→ 1728x996 viewport