Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions app/src/terminal/input/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,15 @@ const CLOUD_MODE_V2_CHIPS_ROW_TOP_PADDING: f32 = 4.;

impl Input {
pub fn is_cloud_mode_input_v2_composing(&self, app: &AppContext) -> bool {
FeatureFlag::CloudModeInputV2.is_enabled()
&& FeatureFlag::CloudMode.is_enabled()
FeatureFlag::CloudModeInputV2.is_enabled() && self.is_composing_cloud_mode_prompt(app)
}

/// Returns true when the user is composing a cloud-mode prompt (i.e. configuring an
/// ambient agent before submitting the first request).
/// Unlike `is_cloud_mode_input_v2_composing`, this is not gated on the V2 input flag
/// so it covers both the old and new cloud-mode UIs.
pub(super) fn is_composing_cloud_mode_prompt(&self, app: &AppContext) -> bool {
FeatureFlag::CloudMode.is_enabled()
&& self
.ambient_agent_view_model()
.is_some_and(|model| model.as_ref(app).is_configuring_ambient_agent())
Expand Down
8 changes: 2 additions & 6 deletions app/src/terminal/input/slash_commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1127,9 +1127,7 @@ impl Input {
ctx,
)
}
SlashCommandEntryState::SkillCommand(_)
if self.is_cloud_mode_input_v2_composing(ctx) =>
{
SlashCommandEntryState::SkillCommand(_) if self.is_composing_cloud_mode_prompt(ctx) => {
false
}
SlashCommandEntryState::SkillCommand(detected_skill) => {
Expand Down Expand Up @@ -1225,9 +1223,7 @@ impl Input {
ctx,
)
}
SlashCommandEntryState::SkillCommand(_)
if self.is_cloud_mode_input_v2_composing(ctx) =>
{
SlashCommandEntryState::SkillCommand(_) if self.is_composing_cloud_mode_prompt(ctx) => {
false
}
SlashCommandEntryState::SkillCommand(detected_skill) => {
Expand Down
Loading