Files
SubMiner/backlog/tasks/task-20.2 - Add-renderer-to-main-IPC-contract-for-measured-overlay-content-bounds.md

1.9 KiB

id, title, status, assignee, created_date, updated_date, labels, dependencies, parent_task_id, priority
id title status assignee created_date updated_date labels dependencies parent_task_id priority
TASK-20.2 Add renderer-to-main IPC contract for measured overlay content bounds Done
2026-02-12 08:47 2026-02-12 02:45
TASK-20 medium

Description

Add renderer-to-main IPC for content measurement reporting, so main process can size each overlay window from post-layout DOM bounds.

Acceptance Criteria

  • #1 Preload exposes a typed API for reporting overlay content bounds with layer metadata.
  • #2 Main-process IPC handler validates payload shape/range and stores latest measurement per layer.
  • #3 Renderer emits measurement updates on subtitle, mode, style, and render-metric changes with throttling/debounce.
  • #4 No crashes or unbounded logging when measurements are missing/empty/invalid; fallback behavior is explicit.

Implementation Notes

Added a typed OverlayContentMeasurement IPC contract exposed in preload and Electron API typings. Implemented a main-process measurement store with strict payload validation and rate-limited warning logs for invalid reports. Added renderer-side debounced measurement reporting that emits updates on subtitle content/mode/style/render-metric and resize changes, explicitly sending contentRect: null when no measured content exists to signal fallback behavior.

Added unit coverage for measurement validation and store behavior.

Final Summary

Implemented renderer-to-main measurement reporting for overlay content bounds with per-layer metadata. Main now validates and stores latest measurements per layer safely, renderer emits debounced updates on relevant state changes, and invalid/missing payload handling is explicit and non-spammy.