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:
charley-oai authored and GitHub committed 2026-01-22 17:31:11 +00:00
1 parent b511c38ddb
commit 4210fb9e6c
6 files changed
+210 -42

No files matched your search

+24 -12
View File
@@ -131,6 +131,7 @@ use crate::bottom_pane::BetaFeatureItem;
use crate::bottom_pane::BottomPane;
use crate::bottom_pane::BottomPaneParams;
use crate::bottom_pane::CancellationEvent;
use crate::bottom_pane::CollaborationModeIndicator;
use crate::bottom_pane::DOUBLE_PRESS_QUIT_SHORTCUT_ENABLED;
use crate::bottom_pane::ExperimentalFeaturesView;
use crate::bottom_pane::InputResult;
@@ -1937,6 +1938,7 @@ impl ChatWidget {
widget.bottom_pane.set_collaboration_modes_enabled(
widget.config.features.enabled(Feature::CollaborationModes),
);
widget.update_collaboration_mode_indicator();
widget
}
@@ -2055,6 +2057,7 @@ impl ChatWidget {
widget.bottom_pane.set_collaboration_modes_enabled(
widget.config.features.enabled(Feature::CollaborationModes),
);
widget.update_collaboration_mode_indicator();
widget
}
@@ -4330,6 +4333,7 @@ impl ChatWidget {
} else {
CollaborationMode::Custom(settings)
};
self.update_collaboration_mode_indicator();
}
}
@@ -4415,6 +4419,25 @@ impl ChatWidget {
}
}
fn collaboration_mode_indicator(&self) -> Option<CollaborationModeIndicator> {
if !self.collaboration_modes_enabled() {
return None;
}
match &self.stored_collaboration_mode {
CollaborationMode::Plan(_) => Some(CollaborationModeIndicator::Plan),
CollaborationMode::PairProgramming(_) => {
Some(CollaborationModeIndicator::PairProgramming)
}
CollaborationMode::Execute(_) => Some(CollaborationModeIndicator::Execute),
CollaborationMode::Custom(_) => None,
}
}
fn update_collaboration_mode_indicator(&mut self) {
let indicator = self.collaboration_mode_indicator();
self.bottom_pane.set_collaboration_mode_indicator(indicator);
}
/// Cycle to the next collaboration mode variant (Plan -> PairProgramming -> Execute -> Plan).
fn cycle_collaboration_mode(&mut self) {
if !self.collaboration_modes_enabled() {
@@ -4439,18 +4462,7 @@ impl ChatWidget {
}
self.stored_collaboration_mode = mode;
let label = self.collaboration_mode_label();
if let Some(label) = label {
let flash = Line::from(vec![
label.bold(),
" (".dim(),
key_hint::shift(KeyCode::Tab).into(),
" to change mode)".dim(),
]);
const FLASH_DURATION: Duration = Duration::from_secs(2);
self.bottom_pane.flash_footer_hint(flash, FLASH_DURATION);
}
self.update_collaboration_mode_indicator();
self.request_redraw();
}