pub struct RenderState {Show 70 fields
pub composer: TextArea,
pub transcript: Vec<TranscriptLine>,
pub scroll_offset: usize,
pub committed_entries: usize,
pub viewport_width: u16,
pub last_viewport_height: u16,
pub glyph_set: GlyphSet,
pub image_previews: ImagePreviews,
pub header_context: InlineHeaderContext,
pub input_enabled: bool,
pub prompt_prefix: String,
pub placeholder: Option<String>,
pub shutdown_requested: bool,
pub message_buffer: String,
pub thinking_buffer: String,
pub md_cache: MdRenderCache,
pub stream_anchor: Option<usize>,
pub agent_hub_open: bool,
pub hub_entries: Vec<(String, HubEntry)>,
pub hub: Option<Arc<HubRegistry>>,
pub pending_quit: bool,
pub slash_popup: SlashPopup,
pub reasoning_stage: Option<String>,
pub stream_reveal: usize,
pub thinking_level: String,
pub context_tokens: Option<usize>,
pub context_window: usize,
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_phases: Vec<TodoPhase>,
pub todo_expanded: bool,
pub todo_clear_deadline: Option<Instant>,
pub todo_clear_delay_secs: i64,
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 issue_store: Option<Arc<FileIssueStore>>,
pub ownership_session_id: String,
pub seen_tips: HashMap<&'static str, u32>,
pub file_commands: Vec<FileCommand>,
pub secure_input_origin: Option<SecureInputOrigin>,
pub session_swapper: Option<Arc<SessionSwapper>>,
pub pending_resume: Option<PathBuf>,
pub session_state: Option<SessionState>,
pub settings_active_tab: SettingsTab,
pub settings_map_rows: Vec<Option<SettingsMapRow>>,
pub keymap: Arc<RwLock<Keymap>>,
pub git_tui: Option<GitTuiState>,
pub git_tui_viewport: (u16, u16),
/* private fields */
}Fields§
§composer: TextAreaEditable text in the composer. Source of truth for the prompt line.
transcript: Vec<TranscriptLine>Transcript lines, in display order.
scroll_offset: usizeIndex of the line currently pinned at the top of the viewport.
usize::MAX means “follow the tail” (auto-scroll).
committed_entries: usizeTranscript entries [0, committed) are frozen in the host
terminal’s real scrollback (printed above the viewport via
Terminal::insert_before). They never render in the live
viewport again — native scroll-up reads them.
viewport_width: u16Last known terminal width — omp-style tool boxes size their borders to it. Refreshed each render pass; frozen transcript lines keep the width they were built at (printed text does not rewrap either).
last_viewport_height: u16Last known terminal height — paired with viewport_width for
resize-change detection (only width changes invalidate the
frozen scrollback).
glyph_set: GlyphSetSnapshot of the user’s glyph-set setting — nerd swaps the
composer context labels for Nerd Font icons (never emoji).
image_previews: ImagePreviewsInline image previews (kitty/iTerm2): protocol detection,
inline_images kill-switch, transmit budget, and the pending
live placements. Owned here so both the agent-event hook
(enqueue) and the post-draw step (emit) share one budget.
header_context: InlineHeaderContextHeader context mirrored from InlineHeaderContext.
input_enabled: boolComposer enabled state — mirrored from SetInputEnabled.
prompt_prefix: StringComposer prompt prefix — mirrored from SetPrompt.
placeholder: Option<String>Composer placeholder — mirrored from SetPlaceholder.
shutdown_requested: boolShutdown signal received from the harness.
message_buffer: StringAccumulated text for markdown rendering at message end.
thinking_buffer: StringAccumulated reasoning text for the dimmed thinking block.
md_cache: MdRenderCacheCache for the streaming assistant markdown render. Held on
RenderState so the cache survives across the many per-frame
render_streamed_message calls; the equality fast-path makes
most frames return without re-parsing.
stream_anchor: Option<usize>Transcript index where the in-flight assistant message’s streamed
lines begin. None while nothing is streaming. The markdown
re-render at MessageEnd replaces from this anchor — a blind
tail-count would duplicate raw streamed lines whenever markdown
collapses the paragraph structure differently.
agent_hub_open: boolAgent Hub overlay open.
hub_entries: Vec<(String, HubEntry)>Hub entries snapshotted when the overlay was opened (/agents).
hub: Option<Arc<HubRegistry>>Live Hub registry for per-frame subagent status (matched todo
highlight + auto-reconcile). None when the session provides none.
pending_quit: boolFirst Ctrl+C armed a quit; a second press exits (two-press quit).
slash_popup: SlashPopupSlash-command autocomplete popup state.
reasoning_stage: Option<String>Current reasoning/tool stage (e.g. “tool: read”), shown above the composer.
stream_reveal: usizeTypewriter reveal for the streamed body: how many BYTES of
message_buffer have been painted into the transcript.
usize::MAX = fully revealed (idle / finalized). The render tick
advances this so streamed text appears as a smooth flow instead
of per-network-chunk lumps.
thinking_level: StringSelected reasoning effort, reflected in the composer’s context bar.
context_tokens: Option<usize>Provider-reported prompt tokens for the most recently completed turn. This is the closest available snapshot of the live context size.
context_window: usizeContext capacity configured for the active agent session.
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: boolQueued input prompts — interactive panel open (Ctrl+; toggles).
queue_selected: usizeSelected index within the queue panel (when interactive).
shell_mode: boolShell mode — ! prefix for direct bash commands (grok-build parity).
follow_ups: Vec<String>Follow-up suggestion chips.
todo_phases: Vec<TodoPhase>Live todo phases — refreshed from the live provider each frame.
todo_expanded: boolWhether the todo HUD is expanded (all phases) vs collapsed.
todo_clear_deadline: Option<Instant>HUD-only auto-clear deadline; does not mutate the underlying TodoState.
todo_clear_delay_secs: i64Auto-clear delay (seconds) once the todo list settles (all closed).
< 0 disables auto-clear. Wired from settings at TUI startup.
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: VimStateVim editing state (enabled by /vim command).
vim_clipboard: StringVim 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::Expanded] — chat responses must show their full text; elision (Truncated`) is opt-in via block cycling).
last_esc_at: Option<Instant>Last Esc press timestamp (for double-Esc detection).
multiline_mode: boolMultiline input mode — Enter inserts newline, Shift+Enter sends.
autonomy_mode: ModeAutonomy 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: usizeNext 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: PathBufWorkspace root — used by the @ file picker to walk + fuzzy-match.
file_search: Option<FileSearchState>Active @-file-search dropdown — Some while the picker is open.
issue_store: Option<Arc<FileIssueStore>>Cached issue store handle, opened lazily on first /issue use.
ownership_session_id: StringThis TUI process’s liveness identity (tui-<pid>-<uuid>), injected
from App::ownership_session_id at startup. Every issue-panel /
slash-command write names the flock holder through this field — NOT
a shared constant — so parallel TUIs claim issues independently.
Empty only in tests that build a bare RenderState::default().
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_origin: Option<SecureInputOrigin>Provider name and origin for the currently open secure prompt.
Set before opening the prompt; cleared on OverlaySubmission::SecureInput
after the key is written. None outside the secure-prompt flows
(/providers row action, /providers add, programmatic rekey) so a
stray SecureInput cannot leak into a different provider.
The SecureInputOrigin variant lets the consumer of the submitted
key know whether to greet the user (“just added a provider”) or
simply acknowledge (“key replaced”) — both write to the same auth
storage slot, but the surrounding UX differs.
session_swapper: Option<Arc<SessionSwapper>>Live-session swapper. None until the TUI startup wires it.
The render loop and the agent worker both call current() per
dispatch; the resume tokio::spawn calls swap(new_handle).
Option because #[derive(Default)] requires it.
pending_resume: Option<PathBuf>Some(path) when the slash command wants the event loop to
drain a resume job on the next Submitted arm. The
Submitted arm calls state.pending_resume.take() and
enqueues the resume.
session_state: Option<SessionState>§settings_active_tab: SettingsTabActive /settings tab. Persisted across overlay reopens within
the session; drives both the tab-switch rebuild and the sidebar
highlight.
settings_map_rows: Vec<Option<SettingsMapRow>>Row-kind table for the settings panel’s map editors
(Keybindings / Model roles), index-aligned with
overlay.items while the tabbed panel is open. Built by the
same pass that builds the items; consulted by the input thread
to route Enter / d / n on map rows. Empty (or stale —
every consumer re-checks length alignment) for non-settings
overlays.
keymap: Arc<RwLock<Keymap>>Live global-shortcut resolver, seeded from
Settings::keybindings at TUI startup and swapped in place by
the keybindings editor. parking_lot::RwLock (not ArcSwap) — no
new dependency, and the per-keystroke read-lock cost is
negligible.
git_tui: Option<GitTuiState>Git TUI overlay — Some while /git is open. The render loop
paints the overlay over the scrollback+composer region when set;
the input thread routes keys through match_git_key and never
lets them reach the composer.
git_tui_viewport: (u16, u16)Width/height of the git TUI overlay viewport (mirrored from the last render pass so resize events can be detected without a round-trip into the ratatui Frame).
Implementations§
Source§impl RenderState
impl RenderState
Sourcepub fn swapper(&self) -> Arc<SessionSwapper> ⓘ
pub fn swapper(&self) -> Arc<SessionSwapper> ⓘ
Get a clone of the live SessionSwapper. Panics if the TUI
wasn’t initialized properly (the run_tui startup wires it
before any user input is processed, so the panic is
unreachable in normal use).
Sourcepub fn start_search(&mut self, query: &str)
pub fn start_search(&mut self, query: &str)
Start a new transcript search, collecting all matching line indices.
Sourcepub fn search_next(&mut self)
pub fn search_next(&mut self)
Advance to the next search match (wraps around).
Sourcepub fn search_prev(&mut self)
pub fn search_prev(&mut self)
Go to the previous search match (wraps around).
Sourcepub fn block_mode(&self, block_id: usize) -> BlockDisplayMode
pub fn block_mode(&self, block_id: usize) -> BlockDisplayMode
The display mode for a block — explicit override or the Expanded default. Chat content hides nothing by default: middle-elision made long responses unreadable and unscrollable past the gap.
Sourcepub fn cycle_block_at_view(&mut self)
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.
Sourcepub fn expand_all(&mut self)
pub fn expand_all(&mut self)
Expand every block. Expanded is the default, so this simply drops all overrides.
Sourcepub fn truncate_all(&mut self)
pub fn truncate_all(&mut self)
Reset every block to the default Truncated mode.
Sourcepub fn jump_next_turn(&mut self)
pub fn jump_next_turn(&mut self)
Jump the scroll to the start of the next assistant (Agent) block.
Sourcepub fn jump_prev_turn(&mut self)
pub fn jump_prev_turn(&mut self)
Jump the scroll to the start of the previous user block.
Sourcepub fn drain_queue_head(&mut self)
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.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RenderState
impl !RefUnwindSafe for RenderState
impl !Sync for RenderState
impl !UnwindSafe for RenderState
impl Send for RenderState
impl Unpin for RenderState
impl UnsafeUnpin for RenderState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
impl<T> MaybeSendSync for T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.