Skip to content

Add screenshot capture settings for token and payload optimization#17

Open
antiartificial wants to merge 1 commit intofarzaa:mainfrom
antiartificial:feature/screenshot-capture-settings
Open

Add screenshot capture settings for token and payload optimization#17
antiartificial wants to merge 1 commit intofarzaa:mainfrom
antiartificial:feature/screenshot-capture-settings

Conversation

@antiartificial
Copy link
Copy Markdown

@antiartificial antiartificial commented Apr 8, 2026

Summary

  • Primary screen only toggle skips secondary monitors, saving ~1,300+ tokens per extra display
  • Active window only toggle captures just the frontmost window instead of the full screen, reducing noise and tokens
  • JPEG quality slider (30%-100%) lets users trade image quality for smaller upload payloads

All three settings live in a new "SCREENSHOT" section in the menu bar panel, persist via UserDefaults, and are wired into both the voice response and onboarding demo capture pipelines. Defaults match existing behavior (all screens, full screen, 80% quality) so nothing changes unless a user opts in.

Files changed

  • CompanionManager.swift three new @Published settings with UserDefaults persistence
  • CompanionScreenCaptureUtility.swift captureAllScreensAsJPEG() accepts new parameters for filtering screens, capturing active window via SCContentFilter(desktopIndependentWindow:), and configurable JPEG compression
  • CompanionPanelView.swift new "SCREENSHOT" settings section with two toggles and a slider
  • ScreenshotSettingsTests.swift 17 unit tests covering defaults, persistence, struct fields, and quality boundaries

Test plan

  • Verify the three new controls appear in the menu bar panel after onboarding
  • Toggle "Primary screen only" on a multi-monitor setup — only cursor screen should be captured
  • Toggle "Active window only" — screenshot should contain only the frontmost app window
  • Adjust JPEG quality slider — verify the printed payload size in console changes accordingly
  • Verify all settings survive app restart
  • Run unit tests (Cmd+U)

Expose three user-configurable settings in the menu bar panel:
- Primary screen only toggle (skips secondary monitors)
- Active window only toggle (captures frontmost window instead of full screen)
- JPEG quality slider (0.3–1.0, adjusts upload payload size)

Settings persist via UserDefaults and are wired through the capture
utility to both the voice response and onboarding demo pipelines.
Includes unit tests for defaults, persistence, and boundary values.
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