-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Have a coding mode and only show coding and plan #9802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+99
−44
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| you are now in code mode. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -122,7 +122,7 @@ const DEFAULT_MODEL_DISPLAY_NAME: &str = "loading"; | |
| const PLAN_IMPLEMENTATION_TITLE: &str = "Implement this plan?"; | ||
| const PLAN_IMPLEMENTATION_YES: &str = "Yes, implement this plan"; | ||
| const PLAN_IMPLEMENTATION_NO: &str = "No, stay in Plan mode"; | ||
| const PLAN_IMPLEMENTATION_EXECUTE_MESSAGE: &str = "Implement the plan."; | ||
| const PLAN_IMPLEMENTATION_CODING_MESSAGE: &str = "Implement the plan."; | ||
|
|
||
| use crate::app_event::AppEvent; | ||
| use crate::app_event::ExitMode; | ||
|
|
@@ -932,10 +932,10 @@ impl ChatWidget { | |
| } | ||
|
|
||
| fn open_plan_implementation_prompt(&mut self) { | ||
| let execute_mode = collaboration_modes::execute_mode(self.models_manager.as_ref()); | ||
| let (implement_actions, implement_disabled_reason) = match execute_mode { | ||
| let code_mode = collaboration_modes::code_mode(self.models_manager.as_ref()); | ||
| let (implement_actions, implement_disabled_reason) = match code_mode { | ||
| Some(collaboration_mode) => { | ||
| let user_text = PLAN_IMPLEMENTATION_EXECUTE_MESSAGE.to_string(); | ||
| let user_text = PLAN_IMPLEMENTATION_CODING_MESSAGE.to_string(); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: CODING still in this name |
||
| let actions: Vec<SelectionAction> = vec![Box::new(move |tx| { | ||
| tx.send(AppEvent::SubmitUserMessageWithMode { | ||
| text: user_text.clone(), | ||
|
|
@@ -944,13 +944,13 @@ impl ChatWidget { | |
| })]; | ||
| (actions, None) | ||
| } | ||
| None => (Vec::new(), Some("Execute mode unavailable".to_string())), | ||
| None => (Vec::new(), Some("Code mode unavailable".to_string())), | ||
| }; | ||
|
|
||
| let items = vec![ | ||
| SelectionItem { | ||
| name: PLAN_IMPLEMENTATION_YES.to_string(), | ||
| description: Some("Switch to Execute and start coding.".to_string()), | ||
| description: Some("Switch to Code and start coding.".to_string()), | ||
| selected_description: None, | ||
| is_current: false, | ||
| actions: implement_actions, | ||
|
|
@@ -3549,7 +3549,7 @@ impl ChatWidget { | |
| } | ||
|
|
||
| pub(crate) fn open_collaboration_modes_popup(&mut self) { | ||
| let presets = self.models_manager.list_collaboration_modes(); | ||
| let presets = collaboration_modes::presets_for_tui(self.models_manager.as_ref()); | ||
| if presets.is_empty() { | ||
| self.add_info_message( | ||
| "No collaboration modes are available right now.".to_string(), | ||
|
|
@@ -3563,6 +3563,7 @@ impl ChatWidget { | |
| .map(|preset| { | ||
| let name = match preset.mode { | ||
| ModeKind::Plan => "Plan", | ||
| ModeKind::Code => "Code", | ||
| ModeKind::PairProgramming => "Pair Programming", | ||
| ModeKind::Execute => "Execute", | ||
| ModeKind::Custom => "Custom", | ||
|
|
@@ -4641,6 +4642,7 @@ impl ChatWidget { | |
| } | ||
| match self.stored_collaboration_mode.mode { | ||
| ModeKind::Plan => Some("Plan"), | ||
| ModeKind::Code => Some("Code"), | ||
| ModeKind::PairProgramming => Some("Pair Programming"), | ||
| ModeKind::Execute => Some("Execute"), | ||
| ModeKind::Custom => None, | ||
|
|
@@ -4653,6 +4655,7 @@ impl ChatWidget { | |
| } | ||
| match self.stored_collaboration_mode.mode { | ||
| ModeKind::Plan => Some(CollaborationModeIndicator::Plan), | ||
| ModeKind::Code => Some(CollaborationModeIndicator::Code), | ||
| ModeKind::PairProgramming => Some(CollaborationModeIndicator::PairProgramming), | ||
| ModeKind::Execute => Some(CollaborationModeIndicator::Execute), | ||
| ModeKind::Custom => None, | ||
|
|
@@ -4664,7 +4667,7 @@ impl ChatWidget { | |
| self.bottom_pane.set_collaboration_mode_indicator(indicator); | ||
| } | ||
|
|
||
| /// Cycle to the next collaboration mode variant (Plan -> PairProgramming -> Execute -> Plan). | ||
| /// Cycle to the next collaboration mode variant (Plan -> Code -> Plan). | ||
| fn cycle_collaboration_mode(&mut self) { | ||
| if !self.collaboration_modes_enabled() { | ||
| return; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: still says coding