Skip to content

Defer OCR work after overlay exit#58

Merged
yvette-carlisle merged 11 commits into
mainfrom
y/deferred-background-ocr
Apr 5, 2026
Merged

Defer OCR work after overlay exit#58
yvette-carlisle merged 11 commits into
mainfrom
y/deferred-background-ocr

Conversation

@yvette-carlisle
Copy link
Copy Markdown
Member

Summary

  • move OCR handoff out of the overlay lifecycle so the overlay exits immediately and OCR continues in an app-level background task
  • move non-scroll frozen export preparation into the deferred OCR path and keep per-phase OCR timing logs
  • keep drag-region OCR working under matte alpha modes by falling back to the frozen-image crop path and add regression coverage

Verification

  • cargo make fmt
  • cargo test -p rsnap-overlay --lib
  • cargo build -p rsnap --release

@yvette-carlisle
Copy link
Copy Markdown
Member Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d1dbd2c3bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/rsnap/src/app/capture.rs Outdated
@yvette-carlisle
Copy link
Copy Markdown
Member Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0426de58cd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/rsnap-overlay/src/overlay.rs
@yvette-carlisle
Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@yvette-carlisle
Copy link
Copy Markdown
Member Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27dde5683f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/rsnap/src/app/capture.rs Outdated
Comment thread packages/rsnap-overlay/src/deferred_text_recognition.rs
@yvette-carlisle
Copy link
Copy Markdown
Member Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a7cda05b7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/rsnap/src/app/capture.rs Outdated
@yvette-carlisle
Copy link
Copy Markdown
Member Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 46d6a55a42

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/rsnap/src/app/capture.rs
@yvette-carlisle
Copy link
Copy Markdown
Member Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aae3ebb5fb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/rsnap-overlay/src/deferred_text_recognition.rs
@yvette-carlisle
Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@yvette-carlisle
Copy link
Copy Markdown
Member Author

@codex review

…:"defer OCR work after overlay exit","intent":"remove the user-visible OCR pause by letting the overlay hand text recognition off to an app-level background task while preserving the existing recognition settings and repairing the matte-mode drag-region regression found in review","impact":"the overlay now exits immediately for OCR, frozen export preparation and recognition run in the background with per-phase timing logs, and drag-region OCR keeps working under matte alpha modes with regression coverage","breaking":false,"risk":"low","authority":"review","delivery_mode":"status-only","refs":[]}
…:"repair background OCR CI gates","intent":"restore the PR head after CI surfaced stricter workspace lint and style checks than the local targeted test loop covered","impact":"deferred OCR exports now carry the required public docs, exit cleanup and OCR processing helpers are split to satisfy line-count rules, and the affected files are normalized to the repository vstyle contract without changing OCR behavior","breaking":false,"risk":"low","authority":"review","delivery_mode":"status-only","refs":[]}
…:"gate exit OCR metadata helper on macos","intent":"repair the PR head after Linux CI flagged the OCR request-id metadata helper as dead code because it is only reachable from the macOS deferred-OCR exit arm","impact":"the exit metadata builder now keeps the OCR request-id setter behind the same macOS gate as its only call site, preserving overlay logging behavior while unblocking workspace lint on Linux CI","breaking":false,"risk":"low","authority":"review","delivery_mode":"status-only","refs":[]}
…:"normalize OCR repair formatting for CI","intent":"repair the PR head after the Rust format check revealed that the previous repair commits had not been run through the nightly rustfmt path used by CI","impact":"the touched app and overlay files now match the repository rustfmt contract so Rust checks stop failing on formatting-only diffs, without changing OCR behavior","breaking":false,"risk":"low","authority":"review","delivery_mode":"status-only","refs":[]}
…:"suppress stale deferred OCR clipboard writes","intent":"repair the PR head after review pointed out that concurrent background OCR requests could let an older capture overwrite a newer clipboard result","impact":"the app now tracks the latest capture generation, deferred OCR only publishes clipboard text for the newest generation, stale requests finish silently with an explicit outcome, and regression coverage locks the publish gate behavior","breaking":false,"risk":"low","authority":"review","delivery_mode":"status-only","refs":[]}
…:"abort deferred OCR when drag crop resolves empty","intent":"repair the PR head after review pointed out that an out-of-bounds deferred OCR crop could silently fall back to the full frozen image instead of skipping OCR for an invalid selection","impact":"drag-region deferred OCR now returns no request when the computed crop is empty, existing drag-region tests use in-bounds selections, and regression coverage locks the out-of-bounds skip behavior","breaking":false,"risk":"low","authority":"review","delivery_mode":"status-only","refs":[]}
…:"tighten stale deferred OCR gating","intent":"repair the PR head after review pointed out that stale deferred OCR requests were published as current before a failed capture start and could still spend full Vision time before later suppression","impact":"latest deferred OCR generation now advances only after a capture session starts successfully, and stale background OCR requests now fast-fail before export or Vision work while preserving the latest-only clipboard guarantee","breaking":false,"risk":"low","authority":"review","delivery_mode":"status-only","refs":[]}
…:"block stale OCR publishes during capture startup","intent":"repair the PR head after review pointed out that older deferred OCR jobs could still publish while a newer capture was starting, even though failed startups also must not suppress valid older OCR results","impact":"deferred OCR now waits for any newer capture startup to resolve before deciding whether an older request may publish, while successful startups still suppress stale results and failed startups still allow the previous request to finish","breaking":false,"risk":"low","authority":"review","delivery_mode":"status-only","refs":[]}
…:"recover deferred OCR when thread spawn fails","intent":"repair the PR head after review pointed out that a deferred OCR request could be silently dropped if the detached worker thread failed to start","impact":"the app now keeps ownership of the deferred OCR request until either the background worker successfully consumes it or the main thread synchronously runs the same OCR path after a spawn failure, preserving the user-triggered OCR guarantee without cloning the request image","breaking":false,"risk":"low","authority":"review","delivery_mode":"status-only","refs":[]}
…:"recheck OCR publish gate before clipboard write","intent":"repair the PR head after review pointed out that a stale OCR request could still overwrite the clipboard if a newer capture started after the earlier gate check but before the clipboard write","impact":"deferred OCR now re-evaluates the latest-capture publish gate immediately before writing recognized text to the clipboard so startup races suppress stale results at the last publish step as well","breaking":false,"risk":"low","authority":"review","delivery_mode":"status-only","refs":[]}
…:"shrink deferred OCR stale publish helper","intent":"repair the PR head after CI failed the vibe-style function-length gate on recognized_text_outcome","impact":"the deferred OCR publish path keeps both stale publish checks while reusing a single helper for stale suppression logging and outcome construction","breaking":false,"risk":"low","authority":"ci","delivery_mode":"status-only","refs":[]}
@yvette-carlisle yvette-carlisle force-pushed the y/deferred-background-ocr branch from 0334cb5 to 4930311 Compare April 5, 2026 04:18
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@yvette-carlisle
Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@yvette-carlisle yvette-carlisle added this pull request to the merge queue Apr 5, 2026
Merged via the queue into main with commit 3526489 Apr 5, 2026
7 checks passed
@yvette-carlisle yvette-carlisle deleted the y/deferred-background-ocr branch April 5, 2026 04:28
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