Skip to content

Own text resources and clarify region selection state - #386

Merged
devmobasa merged 42 commits into
mainfrom
refactor/text-resources-region-selection
Sep 5, 2026
Merged

Own text resources and clarify region selection state#386
devmobasa merged 42 commits into
mainfrom
refactor/text-resources-region-selection

Conversation

@devmobasa

@devmobasa devmobasa commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

This refactor replaces ambient text resources with explicit ownership and consolidates region-selection state.

  • retain separate UI layout and shape measurement owners across rendering, input, toolbar, session, asynchronous, and export paths
  • make help-overlay interaction geometry owner-scoped
  • cache help content using the runtime inputs that affect it
  • centralize region-selection lifecycle, ownership, phase, and geometry
  • split picker, review-action, cut-history, and preview responsibilities
  • remove temporary thread-local resource bridges and internal compatibility adapters

No user-facing behavior change is intended.

Resource ownership

Runtime paths now reuse persistent UiTextEngine and TextMeasurer owners. Standalone public convenience APIs remain available where practical and create one call-local owner per operation.

This keeps mutable text caches isolated while avoiding repeated resource construction in internal loops.

Public API change

The ambient help hit-map functions were removed:

  • clear_help_overlay_hit_map
  • help_overlay_region_at

Standalone interactive callers should use render_help_overlay_result and query the returned HelpRenderResult::hit_map with HelpHitMap::region_at.

Region selection

The backend now owns the canonical selector lifecycle and geometry. Input state retains only a synchronized projection used for gating and painting.

The refactor preserves capture, OCR, measurement, review, cut editing, cancellation, stale-result rejection, and device ownership behavior.

Validation

Validated on Rust 1.98.1:

  • RUST_TEST_THREADS=1 ./tools/lint-and-test.sh
  • all-feature core tests: 4,534 passed, 1 ignored
  • no-default-feature core tests: 4,376 passed, 1 ignored
  • configurator tests: 481/480 passed
  • CLI, daemon fixture, UI integration, and doc tests passed
  • clippy passed with -D warnings in both feature configurations
  • Rust and Nix GitHub checks passed

@devmobasa
devmobasa merged commit 46c5a45 into main Sep 5, 2026
2 checks passed
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