Skip to content

[US-012] Modalita Rullo Continuo (Throttled OCR) #14

Description

@varro986

[US-012] Modalità Rullo Continuo (Throttled OCR)

  • Status: Draft
  • Author: Business Analyst
  • Created: 2026-07-28

1. Description

As an operator,
I want to activate a continuous OCR-and-translate mode with a second hotkey that updates the overlay at a configurable rate,
so that I can follow dynamically changing screens (e.g. scrolling AS/400 output) without repeatedly pressing the trigger hotkey.

2. Acceptance Criteria (DoD)

  • AC-01: The HotkeyRullo hotkey (from IAppSettings) toggles continuous mode: first press activates, second press deactivates.
  • AC-02: While active, OCR + translation is invoked at the sampling frequency defined in IAppSettings (default: every 500 ms).
  • AC-03: CPU usage does not spike: the next capture is not started until the previous one completes (no overlapping calls).
  • AC-04: The tray icon (or overlay) provides a visible indicator that continuous mode is active.
  • AC-05: Continuous mode is automatically deactivated on graceful shutdown.
  • AC-06: Aurora.Core owns the continuous-mode state machine; Aurora.UI exposes the toggle via the hotkey and reflects state — it does not own the state.

3. Architectural Guardrails

  • Modules involved: Aurora.Core (state machine IContinuousModeController, sampling frequency setting), Aurora.UI (hotkey binding for HotkeyRullo, state indicator), Aurora.App (DI wiring, coordinates OCR → Translation → UI pipeline on each tick)
  • Related ADRs: ADR-006 (module contracts — continuous mode state lives in Core), ADR-007 (composition root — Aurora.App drives the polling loop)
  • Isolation constraints:
    • The continuous mode state (active/inactive) and the throttle timer live in Aurora.Core under IContinuousModeController — not in Aurora.UI or Aurora.OCR.
    • Aurora.App is the only place where the pipeline OCR → Translation → publish overlay event is assembled; individual modules do not call each other.
    • The sampling frequency is read from IAppSettings — never hardcoded. It must be configurable at runtime without restart (reads the value on each tick).
    • Aurora.UI raises a Core event on HotkeyRullo press; Aurora.Core toggles state and adjusts the timer.

4. Expected Test Cases

  • Test 1 (Unit): IContinuousModeController.Toggle() alternates between Active and Inactive states on successive calls.
  • Test 2 (Unit): While active, the controller fires a CaptureTick event at the configured interval; no new tick fires while the previous one is being processed.
  • Test 3 (Unit): IContinuousModeController.Stop() deactivates continuous mode and stops the timer.
  • Test 4 (Integration): Pressing HotkeyRullo toggles the tray icon between "active" and "normal" state variants.
  • Test 5 (Architecture): Aurora.UI does not reference Aurora.OCR, Aurora.Translation, or Aurora.Admin (NetArchTest).
  • Test 6 (Architecture): The continuous mode state machine is defined in Aurora.Core, not in Aurora.UI or Aurora.OCR (NetArchTest).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions