Skip to content

Commit

Permalink
Merge branch 'main' into code-context-menu-layout-stability
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsloan committed Dec 17, 2024
2 parents 986890c + 0ca0433 commit 0e48dc9
Show file tree
Hide file tree
Showing 62 changed files with 2,164 additions and 1,364 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions assets/icons/message_circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions assets/icons/person.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 12 additions & 6 deletions assets/keymaps/default-linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,10 @@
"ctrl-shift-r": "task::Rerun",
"ctrl-alt-r": "task::Rerun",
"alt-t": "task::Rerun",
"alt-shift-t": "task::Spawn"
"alt-shift-t": "task::Spawn",
"alt-shift-r": ["task::Spawn", { "reveal_target": "center" }]
// also possible to spawn tasks by name:
// "foo-bar": ["task::Spawn", { "task_name": "MyTask", "reveal_target": "dock" }]
}
},
// Bindings from Sublime Text
Expand Down Expand Up @@ -468,21 +471,24 @@
}
},
{
"context": "Editor && showing_completions",
"context": "Editor && !inline_completion && showing_completions",
"use_key_equivalents": true,
"bindings": {
"enter": "editor::ConfirmCompletion"
"enter": "editor::ConfirmCompletion",
"tab": "editor::ComposeCompletion"
}
},
{
"context": "Editor && !inline_completion && showing_completions",
"context": "Editor && inline_completion && showing_completions",
"use_key_equivalents": true,
"bindings": {
"tab": "editor::ComposeCompletion"
"enter": "editor::ConfirmCompletion",
"tab": "editor::ComposeCompletion",
"shift-tab": "editor::AcceptInlineCompletion"
}
},
{
"context": "Editor && inline_completion",
"context": "Editor && inline_completion && !showing_completions",
"use_key_equivalents": true,
"bindings": {
"tab": "editor::AcceptInlineCompletion"
Expand Down
21 changes: 13 additions & 8 deletions assets/keymaps/default-macos.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@
"use_key_equivalents": true,
"bindings": {
"cmd-n": "assistant2::NewThread",
"cmd-shift-h": "assistant2::OpenHistory"
"cmd-shift-h": "assistant2::OpenHistory",
"cmd-shift-m": "assistant2::ToggleModelSelector"
}
},
{
Expand Down Expand Up @@ -495,8 +496,9 @@
"bindings": {
"cmd-shift-r": "task::Spawn",
"cmd-alt-r": "task::Rerun",
"alt-t": "task::Spawn",
"alt-shift-t": "task::Spawn"
"ctrl-alt-shift-r": ["task::Spawn", { "reveal_target": "center" }]
// also possible to spawn tasks by name:
// "foo-bar": ["task_name::Spawn", { "task_name": "MyTask", "reveal_target": "dock" }]
}
},
// Bindings from Sublime Text
Expand Down Expand Up @@ -539,21 +541,24 @@
}
},
{
"context": "Editor && showing_completions",
"context": "Editor && !inline_completion && showing_completions",
"use_key_equivalents": true,
"bindings": {
"enter": "editor::ConfirmCompletion"
"enter": "editor::ConfirmCompletion",
"tab": "editor::ComposeCompletion"
}
},
{
"context": "Editor && !inline_completion && showing_completions",
"context": "Editor && inline_completion && showing_completions",
"use_key_equivalents": true,
"bindings": {
"tab": "editor::ComposeCompletion"
"enter": "editor::ConfirmCompletion",
"tab": "editor::ComposeCompletion",
"shift-tab": "editor::AcceptInlineCompletion"
}
},
{
"context": "Editor && inline_completion",
"context": "Editor && inline_completion && !showing_completions",
"use_key_equivalents": true,
"bindings": {
"tab": "editor::AcceptInlineCompletion"
Expand Down
10 changes: 7 additions & 3 deletions assets/settings/initial_tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@
// Whether to allow multiple instances of the same task to be run, or rather wait for the existing ones to finish, defaults to `false`.
"allow_concurrent_runs": false,
// What to do with the terminal pane and tab, after the command was started:
// * `always` — always show the terminal pane, add and focus the corresponding task's tab in it (default)
// * `no_focus` — always show the terminal pane, add/reuse the task's tab there, but don't focus it
// * `never` — avoid changing current terminal pane focus, but still add/reuse the task's tab there
// * `always` — always show the task's pane, and focus the corresponding tab in it (default)
// * `no_focus` — always show the task's pane, add the task's tab in it, but don't focus it
// * `never` — do not alter focus, but still add/reuse the task's tab in its pane
"reveal": "always",
// Where to place the task's terminal item after starting the task:
// * `dock` — in the terminal dock, "regular" terminal items' place (default)
// * `center` — in the central pane group, "main" editor area
"reveal_target": "dock",
// What to do with the terminal pane and tab, after the command had finished:
// * `never` — Do nothing when the command finishes (default)
// * `always` — always hide the terminal tab, hide the pane also if it was the last tab in it
Expand Down
9 changes: 4 additions & 5 deletions crates/assistant/src/slash_command_picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,10 @@ impl PickerDelegate for SlashCommandDelegate {
)),
)
.child(
div().overflow_hidden().text_ellipsis().child(
Label::new(info.description.clone())
.size(LabelSize::Small)
.color(Color::Muted),
),
Label::new(info.description.clone())
.size(LabelSize::Small)
.color(Color::Muted)
.text_ellipsis(),
),
),
),
Expand Down
23 changes: 15 additions & 8 deletions crates/assistant2/src/active_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,26 +213,33 @@ impl ActiveThread {

div()
.id(("message-container", ix))
.p_2()
.py_1()
.px_2()
.child(
v_flex()
.border_1()
.border_color(cx.theme().colors().border_variant)
.border_color(cx.theme().colors().border)
.bg(cx.theme().colors().editor_background)
.rounded_md()
.child(
h_flex()
.justify_between()
.p_1p5()
.py_1()
.px_2()
.border_b_1()
.border_color(cx.theme().colors().border_variant)
.child(
h_flex()
.gap_2()
.child(Icon::new(role_icon).size(IconSize::Small))
.child(Label::new(role_name).size(LabelSize::Small)),
.gap_1p5()
.child(
Icon::new(role_icon)
.size(IconSize::XSmall)
.color(Color::Muted),
)
.child(Label::new(role_name).size(LabelSize::XSmall)),
),
)
.child(v_flex().p_1p5().text_ui(cx).child(markdown.clone()))
.child(v_flex().px_2().py_1().text_ui(cx).child(markdown.clone()))
.when_some(context, |parent, context| {
parent.child(
h_flex().flex_wrap().gap_2().p_1p5().children(
Expand All @@ -249,6 +256,6 @@ impl ActiveThread {

impl Render for ActiveThread {
fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {
list(self.list_state.clone()).flex_1()
list(self.list_state.clone()).flex_1().py_1()
}
}
2 changes: 2 additions & 0 deletions crates/assistant2/src/assistant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ mod assistant_panel;
mod assistant_settings;
mod context;
mod context_picker;
mod context_store;
mod context_strip;
mod inline_assistant;
mod message_editor;
mod prompts;
Expand Down
Loading

0 comments on commit 0e48dc9

Please sign in to comment.