mirror of
https://github.com/openai/codex.git
synced 2026-11-28 07:32:19 +00:00
Remove Astra sparkle animation from the TUI composer (#45137)
## What changed Remove the animated stars shown when selecting Astra, along with their input, terminal-focus, and model-selection hooks. ## Testing Retain draft text and live voice control snapshots in a standalone composer snapshot test, and remove sparkle-specific tests and snapshots. GitOrigin-RevId: cbe4396e8700cabfb1e0db9fbe8f997b94316c0f
This commit is contained in:
1 parent
b966240bea
commit
7efa9d96fb
17 files changed
+79
-1346
No files matched your search
@@ -5,72 +5,6 @@ use codex_config::LoaderOverrides;
|
||||
use codex_config::types::SessionPickerViewMode;
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
#[tokio::test]
|
||||
async fn system_reduced_motion_renders_astra_composer_without_sparkles() -> anyhow::Result<()> {
|
||||
use crate::app_event_sender::AppEventSender;
|
||||
use crate::bottom_pane::BottomPane;
|
||||
use crate::bottom_pane::BottomPaneParams;
|
||||
use crate::motion::MotionMode;
|
||||
use crate::render::renderable::Renderable;
|
||||
use crate::tui::FrameRequester;
|
||||
use ratatui::buffer::Buffer;
|
||||
use ratatui::layout::Rect;
|
||||
|
||||
let home = tempfile::tempdir()?;
|
||||
let config = ConfigBuilder::default()
|
||||
.codex_home(home.path().to_path_buf())
|
||||
.loader_overrides(LoaderOverrides {
|
||||
ignore_project_config: true,
|
||||
..LoaderOverrides::without_managed_config_for_tests()
|
||||
})
|
||||
.build()
|
||||
.await?;
|
||||
let settings = LocalSettings::with_system_motion(&config, MotionMode::Reduced);
|
||||
let (tx, _rx) = tokio::sync::mpsc::unbounded_channel();
|
||||
let mut pane = BottomPane::new(BottomPaneParams {
|
||||
app_event_tx: AppEventSender::new(tx),
|
||||
frame_requester: FrameRequester::test_dummy(),
|
||||
has_input_focus: true,
|
||||
enhanced_keys_supported: false,
|
||||
placeholder_text: "Ask Codex to do anything".into(),
|
||||
disable_paste_burst: true,
|
||||
animations_enabled: settings.tui.animations,
|
||||
skills: None,
|
||||
});
|
||||
pane.set_astra_sparkle("astra", &settings.tui);
|
||||
pane.set_composer_text("Explore the night sky".into(), Vec::new(), Vec::new());
|
||||
crate::terminal_palette::with_test_default_colors(
|
||||
crate::terminal_probe::DefaultColors {
|
||||
fg: (230, 216, 255),
|
||||
bg: (36, 27, 53),
|
||||
},
|
||||
|| {
|
||||
for width in [40, 80] {
|
||||
let area = Rect::new(
|
||||
/*x*/ 0,
|
||||
/*y*/ 0,
|
||||
width,
|
||||
pane.desired_height(width),
|
||||
);
|
||||
let mut buffer = Buffer::empty(area);
|
||||
pane.render(area, &mut buffer);
|
||||
let rows = buffer
|
||||
.content
|
||||
.chunks(usize::from(width))
|
||||
.map(|row| {
|
||||
row.iter()
|
||||
.map(ratatui::buffer::Cell::symbol)
|
||||
.collect::<String>()
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.join("\n");
|
||||
insta::assert_snapshot!(format!("system_reduced_motion_astra_{width}"), rows);
|
||||
}
|
||||
},
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn system_motion_suppresses_animations_without_changing_saved_preferences()
|
||||
-> anyhow::Result<()> {
|
||||
|
||||
Reference in new issue
Block a user