Skip to main content

RenderState

Struct RenderState 

Source
pub struct RenderState {
Show 47 fields pub input_buffer: String, pub input_cursor: usize, pub transcript: Vec<TranscriptLine>, pub scroll_offset: usize, pub header_context: InlineHeaderContext, pub input_enabled: bool, pub footer_left: Option<String>, pub footer_right: Option<String>, pub prompt_prefix: String, pub placeholder: Option<String>, pub shutdown_requested: bool, pub message_buffer: String, pub agent_hub_open: bool, pub hub_entries: Vec<(String, HubEntry)>, pub pending_quit: bool, pub slash_popup: SlashPopup, pub reasoning_stage: Option<String>, pub overlay: Option<OverlayState>, pub overlay_model_ids: Vec<String>, pub overlay_catalog_models: Vec<(String, String)>, pub overlay_providers: Vec<String>, pub catalog: Option<Arc<dyn ModelCatalog>>, pub queued_inputs: Vec<String>, pub queue_panel_open: bool, pub queue_selected: usize, pub shell_mode: bool, pub follow_ups: Vec<String>, pub todo_items: Vec<(String, TodoStatus)>, pub todo_provider: Option<Arc<dyn TodoStateProvider>>, pub vim_state: VimState, pub vim_clipboard: String, pub search: Option<SearchState>, pub block_display: HashMap<usize, BlockDisplayMode>, pub last_esc_at: Option<Instant>, pub multiline_mode: bool, pub autonomy_mode: Mode, pub prompt_history: Vec<String>, pub history_pos: Option<usize>, pub next_block_id: usize, pub cancel_grace_until: Option<Instant>, pub confirmation: Option<ModalConfirmation>, pub tip: Option<EphemeralTip>, pub cwd: PathBuf, pub file_search: Option<FileSearchState>, pub seen_tips: HashMap<&'static str, u32>, pub file_commands: Vec<FileCommand>, pub secure_input_target: Option<String>,
}
Expand description

Mutable state the input thread edits (text buffer, scroll, footer) and the main loop reads for rendering.

Fields§

§input_buffer: String

Editable text in the composer.

§input_cursor: usize

Cursor position inside input_buffer (byte index).

§transcript: Vec<TranscriptLine>

Transcript lines, in display order.

§scroll_offset: usize

Index of the line currently pinned at the top of the viewport. usize::MAX means “follow the tail” (auto-scroll).

§header_context: InlineHeaderContext

Header context mirrored from InlineHeaderContext.

§input_enabled: bool

Composer enabled state — mirrored from SetInputEnabled.

§footer_left: Option<String>

Footer status (left + right) — mirrored from SetInputStatus.

§footer_right: Option<String>§prompt_prefix: String

Composer prompt prefix — mirrored from SetPrompt.

§placeholder: Option<String>

Composer placeholder — mirrored from SetPlaceholder.

§shutdown_requested: bool

Shutdown signal received from the harness.

§message_buffer: String

Accumulated text for markdown rendering at message end.

§agent_hub_open: bool

Agent Hub overlay open.

§hub_entries: Vec<(String, HubEntry)>

Hub entries snapshotted when the overlay was opened (/agents).

§pending_quit: bool

First Ctrl+C armed a quit; a second press exits (two-press quit).

§slash_popup: SlashPopup

Slash-command autocomplete popup state.

§reasoning_stage: Option<String>

Current reasoning/tool stage (e.g. “tool: read”), shown above the composer.

§overlay: Option<OverlayState>

Overlay modal/list state — Some when an overlay is open.

§overlay_model_ids: Vec<String>

Model IDs for the /model overlay picker (ordered same as overlay items).

§overlay_catalog_models: Vec<(String, String)>

(provider, model_id) pairs backing the /models catalog browser overlay (ordered same as overlay items).

§overlay_providers: Vec<String>

Provider names backing the /providers overlay (ordered same as items).

§catalog: Option<Arc<dyn ModelCatalog>>

Model catalog port handle, captured once at TUI startup so slash commands (/models, /providers) can browse the full catalog.

§queued_inputs: Vec<String>

Queued input prompts (waiting to be processed).

§queue_panel_open: bool

Queued input prompts — interactive panel open (Ctrl+; toggles).

§queue_selected: usize

Selected index within the queue panel (when interactive).

§shell_mode: bool

Shell mode — ! prefix for direct bash commands (grok-build parity).

§follow_ups: Vec<String>

Follow-up suggestion chips.

§todo_items: Vec<(String, TodoStatus)>

Todo checklist items (text, status) — refreshed from the live provider.

§todo_provider: Option<Arc<dyn TodoStateProvider>>

Live todo state provider — the same source the todo agent tool writes to. None when todos are disabled; the pane stays hidden.

§vim_state: VimState

Vim editing state (enabled by /vim command).

§vim_clipboard: String

Vim clipboard buffer.

§search: Option<SearchState>

In-transcript search state — None when no search is active.

§block_display: HashMap<usize, BlockDisplayMode>

Per-block display override. An absent entry means the default (`BlockDisplayMode::Truncated).

§last_esc_at: Option<Instant>

Last Esc press timestamp (for double-Esc detection).

§multiline_mode: bool

Multiline input mode — Enter inserts newline, Shift+Enter sends.

§autonomy_mode: Mode

Autonomy mode mirror for display. The authoritative value lives in the shared AskBridge mode atomic (toggled by Shift+Tab); this field is kept in lock-step so the render loop can draw a badge.

§prompt_history: Vec<String>

Submitted prompt history (most-recent-first).

§history_pos: Option<usize>

Current position in history navigation (None = not navigating).

§next_block_id: usize

Next block ID to assign when appending transcript lines.

§cancel_grace_until: Option<Instant>

Cancel grace window — Esc pressed within this window after a cancel is ignored (grok-build post-cancel grace, ~1s). Prevents mashing.

§confirmation: Option<ModalConfirmation>

Active y/n/x confirmation dialog — Some while a modal confirmation is open. The input thread resolves it; the render loop paints it centered on top of everything else.

§tip: Option<EphemeralTip>

Active ephemeral tip banner — Some for a bounded number of render ticks, then auto-dismissed by expiry.

§cwd: PathBuf

Workspace root — used by the @ file picker to walk + fuzzy-match.

§file_search: Option<FileSearchState>

Active @-file-search dropdown — Some while the picker is open.

§seen_tips: HashMap<&'static str, u32>

Per-tip-key show counter — suppresses ambient tips after SEEN_CAP views.

§file_commands: Vec<FileCommand>

User-defined slash commands loaded once at startup from .oxicode/commands/ and ~/.oxicode/commands/.

§secure_input_target: Option<String>

Provider name targeted by the currently open secure prompt. Set before opening the prompt; cleared on OverlaySubmission::SecureInput after the key is written. None outside the /providers key-entry flow so a stray SecureInput cannot leak into a different provider.

Implementations§

Source§

impl RenderState

Start a new transcript search, collecting all matching line indices.

Source

pub fn search_next(&mut self)

Advance to the next search match (wraps around).

Source

pub fn search_prev(&mut self)

Go to the previous search match (wraps around).

Source

pub fn block_mode(&self, block_id: usize) -> BlockDisplayMode

The display mode for a block — explicit override or the Truncated default.

Source

pub fn cycle_block_at_view(&mut self)

Cycle the display mode of the block at (or nearest above) the current scroll offset: Collapsed → Truncated → Expanded → Collapsed.

Source

pub fn expand_all(&mut self)

Expand every block (show every line at full weight).

Source

pub fn fold_all(&mut self)

Collapse every block (first line only).

Source

pub fn truncate_all(&mut self)

Reset every block to the default Truncated mode.

Source

pub fn jump_next_turn(&mut self)

Jump the scroll to the start of the next assistant (Agent) block.

Source

pub fn jump_prev_turn(&mut self)

Jump the scroll to the start of the previous user block.

Source

pub fn drain_queue_head(&mut self)

Drop the head of the queued-input list. Called when a turn ends so the queue pane stops showing the prompt that is now running.

Source

pub fn show_tip( &mut self, key: &'static str, text: &str, ttl: u64, ambient: bool, )

Show an ephemeral tip if the per-session seen-cap hasn’t been reached. Each unique key can show at most SEEN_CAP times per session.

Trait Implementations§

Source§

impl Default for RenderState

Source§

fn default() -> RenderState

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> GetSetFdFlags for T

Source§

fn get_fd_flags(&self) -> Result<FdFlags, Error>
where T: AsFilelike,

Query the “status” flags for the self file descriptor.
Source§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>
where T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
Source§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>
where T: Sized + AsFilelike,

Set the “status” flags for the self file descriptor. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Pointer = u32

Source§

fn debug( pointer: <T as Pointee>::Pointer, f: &mut Formatter<'_>, ) -> Result<(), Error>

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more