Events
nque uses Tauri events for two asynchronous flows: PDF import progress and live
display synchronization. Event names are defined in src/lib/events.ts on the
frontend and emitted from Rust.
Import progress
| Event name | Direction | Payload |
|---|---|---|
ocr-import-progress | backend → UI | { phase, current, total } |
Emitted by import_pdf_show as the pipeline advances. phase is one of
detect, extract, render, ocr, or classify; current/total are
1-based page counters. The file-actions hook listens for this event and pushes
updates into the import slice, which drives the progress dialog.
Live display synchronization
| Event name | Direction | Payload |
|---|---|---|
cue-fired | main → displays | { cueText: string | null } |
request-active-cue | display → main | none |
respond-active-cue | main → displays | { cueText: string | null } |
Flow:
- When the operator fires a cue, perform mode emits
cue-firedwith the cue text (ornull). - Each live display listens for
cue-firedand renders the payload. - On mount, a display emits
request-active-cue. - Perform mode listens for that and re-emits
cue-firedwith the current active cue, so a display opened mid-show is immediately correct.
export const EVENTS = {
CUE_FIRED: "cue-fired",
REQUEST_ACTIVE_CUE: "request-active-cue",
RESPOND_ACTIVE_CUE: "respond-active-cue",
} as const;
note
RESPOND_ACTIVE_CUE is reserved for an explicit response channel; the current
implementation answers request-active-cue by re-emitting cue-fired.
See Live display for the user-facing behavior.