assistant2: Restrict directory context picker to development builds (#22302)

This PR temporarily restricts the directory context picker to
development builds until the implementation is finished.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-12-20 14:08:29 -05:00 committed by GitHub
parent d566792ae1
commit 7913b6a5a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 21 additions and 14 deletions

1
Cargo.lock generated
View file

@ -493,6 +493,7 @@ dependencies = [
"project", "project",
"proto", "proto",
"rand 0.8.5", "rand 0.8.5",
"release_channel",
"rope", "rope",
"schemars", "schemars",
"serde", "serde",

View file

@ -50,6 +50,7 @@ parking_lot.workspace = true
picker.workspace = true picker.workspace = true
project.workspace = true project.workspace = true
proto.workspace = true proto.workspace = true
release_channel.workspace = true
rope.workspace = true rope.workspace = true
schemars.workspace = true schemars.workspace = true
serde.workspace = true serde.workspace = true

View file

@ -10,6 +10,7 @@ use gpui::{
WeakModel, WeakView, WeakModel, WeakView,
}; };
use picker::{Picker, PickerDelegate}; use picker::{Picker, PickerDelegate};
use release_channel::ReleaseChannel;
use ui::{prelude::*, ListItem, ListItemSpacing}; use ui::{prelude::*, ListItem, ListItemSpacing};
use util::ResultExt; use util::ResultExt;
use workspace::Workspace; use workspace::Workspace;
@ -50,23 +51,27 @@ impl ContextPicker {
confirm_behavior: ConfirmBehavior, confirm_behavior: ConfirmBehavior,
cx: &mut ViewContext<Self>, cx: &mut ViewContext<Self>,
) -> Self { ) -> Self {
let mut entries = vec![ let mut entries = Vec::new();
ContextPickerEntry { entries.push(ContextPickerEntry {
name: "File".into(), name: "File".into(),
kind: ContextKind::File, kind: ContextKind::File,
icon: IconName::File, icon: IconName::File,
}, });
ContextPickerEntry { let release_channel = ReleaseChannel::global(cx);
// The directory context picker isn't fully implemented yet, so limit it
// to development builds.
if release_channel == ReleaseChannel::Dev {
entries.push(ContextPickerEntry {
name: "Folder".into(), name: "Folder".into(),
kind: ContextKind::Directory, kind: ContextKind::Directory,
icon: IconName::Folder, icon: IconName::Folder,
}, });
ContextPickerEntry { }
name: "Fetch".into(), entries.push(ContextPickerEntry {
kind: ContextKind::FetchedUrl, name: "Fetch".into(),
icon: IconName::Globe, kind: ContextKind::FetchedUrl,
}, icon: IconName::Globe,
]; });
if thread_store.is_some() { if thread_store.is_some() {
entries.push(ContextPickerEntry { entries.push(ContextPickerEntry {