Skip to content

Commit d0eca5b

Browse files
committed
Revert "feat: fuzzy select profiles (aws#1388)"
This reverts commit 99b8eef.
1 parent 99b8eef commit d0eca5b

2 files changed

Lines changed: 2 additions & 56 deletions

File tree

crates/q_chat/src/context.rs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -229,40 +229,6 @@ impl ContextManager {
229229
Ok(profiles)
230230
}
231231

232-
/// List all available profiles using blocking operations.
233-
///
234-
/// Similar to list_profiles but uses synchronous filesystem operations.
235-
///
236-
/// # Returns
237-
/// A Result containing a vector of profile names, with "default" always first
238-
pub fn list_profiles_blocking(&self) -> Result<Vec<String>> {
239-
let mut profiles = Vec::new();
240-
241-
// Always include default profile
242-
profiles.push("default".to_string());
243-
244-
// Read profile directory and extract profile names
245-
let profiles_dir = directories::chat_profiles_dir(&self.ctx)?;
246-
if profiles_dir.exists() {
247-
for entry in std::fs::read_dir(profiles_dir)? {
248-
let entry = entry?;
249-
let path = entry.path();
250-
if let (true, Some(name)) = (path.is_dir(), path.file_name()) {
251-
if name != "default" {
252-
profiles.push(name.to_string_lossy().to_string());
253-
}
254-
}
255-
}
256-
}
257-
258-
// Sort non-default profiles alphabetically
259-
if profiles.len() > 1 {
260-
profiles[1..].sort();
261-
}
262-
263-
Ok(profiles)
264-
}
265-
266232
/// Clear all paths from the context configuration.
267233
///
268234
/// # Arguments

crates/q_chat/src/skim_integration.rs

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ use tempfile::NamedTempFile;
2525

2626
use super::context::ContextManager;
2727

28-
pub fn select_profile_with_skim(context_manager: &ContextManager) -> Result<Option<String>> {
29-
let profiles = context_manager.list_profiles_blocking()?;
30-
31-
launch_skim_selector(&profiles, "Select profile: ", false)
32-
.map(|selected| selected.and_then(|s| s.into_iter().next()))
33-
}
34-
3528
pub struct SkimCommandSelector {
3629
context_manager: Arc<ContextManager>,
3730
tool_names: Vec<String>,
@@ -275,18 +268,9 @@ pub fn select_command(context_manager: &ContextManager, tools: &[String]) -> Res
275268
* command */
276269
}
277270
},
278-
Some(cmd @ CommandType::Profile(_)) if cmd.needs_profile_selection() => {
279-
// For profile operations that need a profile name, show profile selector
280-
match select_profile_with_skim(context_manager)? {
281-
Some(profile) => {
282-
let full_cmd = format!("{} {}", selected_command, profile);
283-
Ok(Some(full_cmd))
284-
},
285-
None => Ok(Some(selected_command.clone())), // User cancelled profile selection
286-
}
287-
},
288271
Some(CommandType::Profile(_)) => {
289-
// For other profile operations (like create), just return the command
272+
// For profile operations, we'd need to prompt for the name
273+
// For now, just return the command and let the user type the name
290274
Ok(Some(selected_command.clone()))
291275
},
292276
None => {
@@ -308,10 +292,6 @@ enum CommandType {
308292
}
309293

310294
impl CommandType {
311-
fn needs_profile_selection(&self) -> bool {
312-
matches!(self, CommandType::Profile("set" | "delete" | "rename"))
313-
}
314-
315295
fn from_str(cmd: &str) -> Option<CommandType> {
316296
if cmd.starts_with("/context add") {
317297
Some(CommandType::ContextAdd(cmd.to_string()))

0 commit comments

Comments
 (0)