Skip to content

feat(selection): homegrown region overlay for area capture - #19

Merged
aryasadeghy merged 1 commit into
mainfrom
feat/selection-overlay-foundation
May 9, 2026
Merged

feat(selection): homegrown region overlay for area capture#19
aryasadeghy merged 1 commit into
mainfrom
feat/selection-overlay-foundation

Conversation

@aryasadeghy

Copy link
Copy Markdown
Contributor

Introduces a per-display transparent BrowserWindow that drives region selection ourselves, then hands the rect to screencapture -R. Replaces the OS screencapture -i path for "Capture Area" behind a new useCustomSelectionOverlay pref (default on, kept as a safety valve).

Unblocks "Capture Previous Area" (PR2) and v0.4 region recording, both of which need to know the chosen rectangle (which -i does not expose).

  • New selection IPC namespace + SnaporaApi bridge
  • src/main/selection/{overlay,geometry}.ts — windows + pure math
  • src/renderer/{selection.html,selection.tsx,components/Selection.tsx}
  • screencapture -R arg path with region passthrough
  • Geometry unit tests (17 cases)
  • ADR 0003 records the decision

Summary

Type

  • feat — new feature
  • fix — bug fix
  • docs — documentation only
  • refactor — code restructure, no behavior change
  • perf — performance improvement
  • test — adds or changes tests
  • chore / ci / build — tooling

Screenshots / recording

Test plan

  • npm run lint
  • npm run typecheck
  • npm test
  • Manual smoke: launched the app, exercised the changed feature
  • Manual smoke: nothing else regressed

Clean-room confirmation

  • I confirm this contribution is not derived from decompiled or leaked commercial software (see CONTRIBUTING.md).

Linked issues

Closes #

Introduces a per-display transparent BrowserWindow that drives region
selection ourselves, then hands the rect to `screencapture -R`. Replaces
the OS `screencapture -i` path for "Capture Area" behind a new
`useCustomSelectionOverlay` pref (default on, kept as a safety valve).

Unblocks "Capture Previous Area" (PR2) and v0.4 region recording, both
of which need to know the chosen rectangle (which `-i` does not expose).

- New `selection` IPC namespace + SnaporaApi bridge
- `src/main/selection/{overlay,geometry}.ts` — windows + pure math
- `src/renderer/{selection.html,selection.tsx,components/Selection.tsx}`
- `screencapture -R` arg path with region passthrough
- Geometry unit tests (17 cases)
- ADR 0003 records the decision

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@aryasadeghy
aryasadeghy enabled auto-merge (squash) May 9, 2026 23:05
@aryasadeghy
aryasadeghy merged commit a7813aa into main May 9, 2026
3 checks passed
@aryasadeghy
aryasadeghy deleted the feat/selection-overlay-foundation branch May 9, 2026 23:05
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