mirror of
https://github.com/openai/codex.git
synced 2026-11-24 07:20:27 +00:00
Remove terminal resize reflow flag gates (#27794)
## Why `terminal_resize_reflow` is now stable and should behave as always on. Keeping the disabled runtime paths around made the feature look configurable even though the rollout is complete, and old config could still suggest there was a supported off mode. ## What Changed - Marked `terminal_resize_reflow` as `Stage::Removed` while keeping it default-enabled for compatibility. - Ignored `[features].terminal_resize_reflow` config entries so stale `false` settings no longer affect the effective feature set. - Removed TUI branches that depended on the flag being disabled, so draw, replay buffering, stream finalization, and resize scheduling all assume resize reflow is active. - Simplified resize smoke coverage to exercise the always-on behavior only. ## Verification - `just test -p codex-features` - `just test -p codex-tui resize_reflow` - `just test -p codex-tui initial_replay_buffer thread_switch_replay_buffer`
This commit is contained in:
1 parent
1aa3e432cc
commit
8a6a039f26
11 files changed
+86
-272
No files matched your search
@@ -29,7 +29,6 @@ pub(crate) struct TranscriptReflowState {
|
||||
last_reflow_width: Option<u16>,
|
||||
pending_reflow_width: Option<u16>,
|
||||
pending_until: Option<Instant>,
|
||||
history_cell_refresh_requested: bool,
|
||||
ran_during_stream: bool,
|
||||
resize_requested_during_stream: bool,
|
||||
}
|
||||
@@ -37,9 +36,9 @@ pub(crate) struct TranscriptReflowState {
|
||||
impl TranscriptReflowState {
|
||||
/// Reset all width, pending deadline, and stream repair state.
|
||||
///
|
||||
/// Call this when resize reflow is disabled or when the app discards the transcript state that
|
||||
/// pending reflow work would have rebuilt. Leaving stale deadlines behind would make a later
|
||||
/// draw attempt to rebuild history from unrelated cells.
|
||||
/// Call this when the app discards the transcript state that pending reflow work would have
|
||||
/// rebuilt. Leaving stale deadlines behind would make a later draw attempt to rebuild history
|
||||
/// from unrelated cells.
|
||||
pub(crate) fn clear(&mut self) {
|
||||
*self = Self::default();
|
||||
}
|
||||
@@ -94,12 +93,6 @@ impl TranscriptReflowState {
|
||||
self.pending_until = Some(Instant::now());
|
||||
}
|
||||
|
||||
/// Schedule an immediate rebuild because an existing history cell changed its rendered output.
|
||||
pub(crate) fn schedule_history_cell_refresh(&mut self) {
|
||||
self.history_cell_refresh_requested = true;
|
||||
self.schedule_immediate();
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn set_due_for_test(&mut self) {
|
||||
self.pending_until = Some(Instant::now() - Duration::from_millis(1));
|
||||
@@ -117,14 +110,9 @@ impl TranscriptReflowState {
|
||||
self.pending_until.is_some()
|
||||
}
|
||||
|
||||
pub(crate) fn history_cell_refresh_requested(&self) -> bool {
|
||||
self.history_cell_refresh_requested
|
||||
}
|
||||
|
||||
pub(crate) fn clear_pending_reflow(&mut self) {
|
||||
self.pending_until = None;
|
||||
self.pending_reflow_width = None;
|
||||
self.history_cell_refresh_requested = false;
|
||||
}
|
||||
|
||||
/// Remember the terminal width that actually rebuilt transcript scrollback.
|
||||
@@ -274,17 +262,6 @@ mod tests {
|
||||
assert!(state.reflow_needed_for_width(/*width*/ 100));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn clear_pending_reflow_clears_history_cell_refresh_request() {
|
||||
let mut state = TranscriptReflowState::default();
|
||||
state.schedule_history_cell_refresh();
|
||||
|
||||
assert!(state.history_cell_refresh_requested());
|
||||
state.clear_pending_reflow();
|
||||
|
||||
assert!(!state.history_cell_refresh_requested());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mark_reflowed_width_reports_unchanged_width() {
|
||||
let mut state = TranscriptReflowState::default();
|
||||
|
||||
Reference in new issue
Block a user