mirror of
https://github.com/openai/codex.git
synced 2026-11-25 07:23:22 +00:00
Modes label below textarea (#9645)
# Summary - Add a collaboration mode indicator rendered at the bottom-right of the TUI composer footer. - Style modes per design (Plan in #D72EE1, Execute matching dim context style, Pair Programming using the same cyan as text elements). - Add shared “(shift+tab to cycle)” hint text for all mode labels and align the indicator with the left footer margin. NOTE: currently this is hidden if the Collaboration Modes feature flag is disabled, or in Custom mode. Maybe we should show it in Custom mode too? I'll leave that out of this PR though # UI - Mode indicator appears below the textarea, bottom-right of the footer line. - Includes “(shift+tab to cycle)” and keeps right padding aligned to the left footer indent. <img width="983" height="200" alt="Screenshot 2026-01-21 at 7 17 54 PM" src="https://github.com/user-attachments/assets/d1c5e4ed-7d7b-4f6c-9e71-bc3cf6400e0e" /> <img width="980" height="200" alt="Screenshot 2026-01-21 at 7 18 53 PM" src="https://github.com/user-attachments/assets/d22ff0da-a406-4930-85c5-affb2234e84b" /> <img width="979" height="201" alt="Screenshot 2026-01-21 at 7 19 12 PM" src="https://github.com/user-attachments/assets/862cb17f-0495-46fa-9b01-a4a9f29b52d5" />
This commit is contained in:
1 parent
b511c38ddb
commit
4210fb9e6c
6 files changed
+210
-42
No files matched your search
@@ -93,13 +93,17 @@ use super::command_popup::CommandItem;
|
||||
use super::command_popup::CommandPopup;
|
||||
use super::command_popup::CommandPopupFlags;
|
||||
use super::file_search_popup::FileSearchPopup;
|
||||
use super::footer::CollaborationModeIndicator;
|
||||
use super::footer::FooterMode;
|
||||
use super::footer::FooterProps;
|
||||
use super::footer::esc_hint_mode;
|
||||
use super::footer::footer_height;
|
||||
use super::footer::footer_hint_items_width;
|
||||
use super::footer::footer_line_width;
|
||||
use super::footer::inset_footer_hint_area;
|
||||
use super::footer::render_footer;
|
||||
use super::footer::render_footer_hint_items;
|
||||
use super::footer::render_mode_indicator;
|
||||
use super::footer::reset_mode_after_activity;
|
||||
use super::footer::toggle_shortcut_mode;
|
||||
use super::paste_burst::CharDecision;
|
||||
@@ -229,6 +233,7 @@ pub(crate) struct ChatComposer {
|
||||
/// When enabled, `Enter` submits immediately and `Tab` requests queuing behavior.
|
||||
steer_enabled: bool,
|
||||
collaboration_modes_enabled: bool,
|
||||
collaboration_mode_indicator: Option<CollaborationModeIndicator>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
@@ -289,6 +294,7 @@ impl ChatComposer {
|
||||
dismissed_skill_popup_token: None,
|
||||
steer_enabled: false,
|
||||
collaboration_modes_enabled: false,
|
||||
collaboration_mode_indicator: None,
|
||||
};
|
||||
// Apply configuration via the setter to keep side-effects centralized.
|
||||
this.set_disable_paste_burst(disable_paste_burst);
|
||||
@@ -313,6 +319,13 @@ impl ChatComposer {
|
||||
self.collaboration_modes_enabled = enabled;
|
||||
}
|
||||
|
||||
pub fn set_collaboration_mode_indicator(
|
||||
&mut self,
|
||||
indicator: Option<CollaborationModeIndicator>,
|
||||
) {
|
||||
self.collaboration_mode_indicator = indicator;
|
||||
}
|
||||
|
||||
fn layout_areas(&self, area: Rect) -> [Rect; 3] {
|
||||
let footer_props = self.footer_props();
|
||||
let footer_hint_height = self
|
||||
@@ -545,6 +558,7 @@ impl ChatComposer {
|
||||
self.footer_hint_override = items;
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn show_footer_flash(&mut self, line: Line<'static>, duration: Duration) {
|
||||
let expires_at = Instant::now()
|
||||
.checked_add(duration)
|
||||
@@ -2510,15 +2524,25 @@ impl Renderable for ChatComposer {
|
||||
} else {
|
||||
popup_rect
|
||||
};
|
||||
let mut left_content_width = None;
|
||||
if self.footer_flash_visible() {
|
||||
if let Some(flash) = self.footer_flash.as_ref() {
|
||||
flash.line.render(inset_footer_hint_area(hint_rect), buf);
|
||||
left_content_width = Some(flash.line.width() as u16);
|
||||
}
|
||||
} else if let Some(items) = self.footer_hint_override.as_ref() {
|
||||
render_footer_hint_items(hint_rect, buf, items);
|
||||
left_content_width = Some(footer_hint_items_width(items));
|
||||
} else {
|
||||
render_footer(hint_rect, buf, footer_props);
|
||||
left_content_width = Some(footer_line_width(footer_props));
|
||||
}
|
||||
render_mode_indicator(
|
||||
hint_rect,
|
||||
buf,
|
||||
self.collaboration_mode_indicator,
|
||||
left_content_width,
|
||||
);
|
||||
}
|
||||
}
|
||||
let style = user_message_style();
|
||||
|
||||
Reference in new issue
Block a user