mirror of
https://github.com/openai/codex.git
synced 2026-11-25 15:24:26 +00:00
Added feature switch to disable animations in TUI (#6870)
This PR adds support for a new feature flag `tui.animations`. By default, the TUI uses animations in its welcome screen, "working" spinners, and "shimmer" effects. This animations can interfere with screen readers, so it's good to provide a way to disable them. This change is inspired by [a PR](https://github.com/openai/codex/pull/4014) contributed by @Orinks. That PR has faltered a bit, but I think the core idea is sound. This version incorporates feedback from @aibrahim-oai. In particular: 1. It uses a feature flag (`tui.animations`) rather than the unqualified CLI key `no-animations`. Feature flags are the preferred way to expose boolean switches. They are also exposed via CLI command switches. 2. It includes more complete documentation. 3. It disables a few animations that the other PR omitted.
This commit is contained in:
1 parent
888c6dd9e7
commit
d909048a85
15 files changed
+326
-188
No files matched your search
@@ -962,6 +962,7 @@ impl ChatWidget {
|
||||
parsed,
|
||||
source,
|
||||
None,
|
||||
self.config.animations,
|
||||
)));
|
||||
}
|
||||
|
||||
@@ -1071,6 +1072,7 @@ impl ChatWidget {
|
||||
ev.parsed_cmd,
|
||||
ev.source,
|
||||
interaction_input,
|
||||
self.config.animations,
|
||||
)));
|
||||
}
|
||||
|
||||
@@ -1083,6 +1085,7 @@ impl ChatWidget {
|
||||
self.active_cell = Some(Box::new(history_cell::new_active_mcp_tool_call(
|
||||
ev.call_id,
|
||||
ev.invocation,
|
||||
self.config.animations,
|
||||
)));
|
||||
self.request_redraw();
|
||||
}
|
||||
@@ -1104,7 +1107,11 @@ impl ChatWidget {
|
||||
Some(cell) if cell.call_id() == call_id => cell.complete(duration, result),
|
||||
_ => {
|
||||
self.flush_active_cell();
|
||||
let mut cell = history_cell::new_active_mcp_tool_call(call_id, invocation);
|
||||
let mut cell = history_cell::new_active_mcp_tool_call(
|
||||
call_id,
|
||||
invocation,
|
||||
self.config.animations,
|
||||
);
|
||||
let extra_cell = cell.complete(duration, result);
|
||||
self.active_cell = Some(Box::new(cell));
|
||||
extra_cell
|
||||
@@ -1146,6 +1153,7 @@ impl ChatWidget {
|
||||
enhanced_keys_supported,
|
||||
placeholder_text: placeholder,
|
||||
disable_paste_burst: config.disable_paste_burst,
|
||||
animations_enabled: config.animations,
|
||||
}),
|
||||
active_cell: None,
|
||||
config: config.clone(),
|
||||
@@ -1220,6 +1228,7 @@ impl ChatWidget {
|
||||
enhanced_keys_supported,
|
||||
placeholder_text: placeholder,
|
||||
disable_paste_burst: config.disable_paste_burst,
|
||||
animations_enabled: config.animations,
|
||||
}),
|
||||
active_cell: None,
|
||||
config: config.clone(),
|
||||
|
||||
Reference in new issue
Block a user