pub struct ReviewRequest {
pub original: String,
pub corrected: String,
pub trailing: String,
pub chars_before_caret: usize,
pub chars_after_caret: usize,
pub window_address: String,
pub suggestions: Vec<WordSuggestions>,
pub pending: bool,
pub screen_width: f32,
pub llm_available: bool,
pub from_llm: bool,
}Expand description
A pending review request — what the user typed, what the smart provider suggested, and where to emit the result.
Fields§
§original: StringThe sentence as it sits in the focused window’s buffer.
corrected: StringThe smart provider’s proposed correction.
trailing: StringWhitespace between the sentence’s right edge and the caret — preserved so the emit lands with the user’s spacing intact.
chars_before_caret: usizeHow many characters of original sit BEFORE the caret —
determines the BackSpace count when the apply path emits.
chars_after_caret: usizeHow many characters of original sit AFTER the caret —
determines the Delete count when the apply path emits.
Zero for the common case where the caret is at the end of
(or in trailing whitespace after) the sentence.
window_address: StringHyprland address of the window the request originated from — the daemon uses it to update that window’s buffer when the user accepts.
suggestions: Vec<WordSuggestions>Ranked backup suggestions for each changed word, ordered by the
word’s position in corrected so it lines up with the popup’s
editable fields. Empty when no provider offered alternatives.
pending: booltrue while the daemon is still computing the correction (e.g.
an in-flight LLM call). The popup is spawned immediately in this
state — showing the original text and a “Checking…” line — and
re-reads the request until the daemon writes the finished one
with pending: false.
screen_width: f32Logical width (points) of the monitor the source window sits on, so the popup can grow with the sentence up to half the screen. Zero when unknown — the popup then falls back to a fixed cap.
llm_available: boolWhether the daemon has an LLM provider configured. The popup shows its “Ask LLM” escalation button only when this is true.
from_llm: boolWhether the LLM produced the corrected text shown. When true
the popup hides the “Ask LLM” button — the result is already the
LLM’s, so there’s nothing to escalate. Keyed on the provider that
actually produced the correction, so an LLM miss that fell back to
LanguageTool/Spellbook still offers the button.
Trait Implementations§
Source§impl Clone for ReviewRequest
impl Clone for ReviewRequest
Source§fn clone(&self) -> ReviewRequest
fn clone(&self) -> ReviewRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more