Skip to content

Commit 2196ce9

Browse files
zachlloydoz-agent
andauthored
Clarify create file palette item (#11799)
## Description Clarifies the command palette fallback item for creating a new file so it reads `Create a file named <file-name>…` instead of the more ambiguous `Create <file-name>…`. This keeps the existing create-file behavior unchanged and only updates the user-facing label plus nearby code comment. Agent conversation: https://staging.warp.dev/conversation/a701caac-682d-4561-9630-7450186a1d06 https://www.loom.com/share/ea05f1cd74fc4576a48a6b3f0d0604a2 ## Linked Issue - [ ] The linked issue is labeled `ready-to-spec` or `ready-to-implement`. - [ ] Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes). ## Testing - [x] `cargo fmt --manifest-path /Users/zach/Projects/warp_3/Cargo.toml --all` - [x] `cargo clippy --manifest-path /Users/zach/Projects/warp_3/Cargo.toml --workspace --all-targets --all-features --tests -- -D warnings` - [ ] I have manually tested my changes locally with `./script/run` ### Screenshots / Videos Not attached; this is a text-only command palette label update. ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode CHANGELOG-NONE Co-Authored-By: Oz <oz-agent@warp.dev> --------- Co-authored-by: Oz <oz-agent@warp.dev>
1 parent 2992d02 commit 2196ce9

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

app/src/search/command_palette/files/data_source.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use warpui::{AppContext, Entity, SingletonEntity};
1515
use super::search_item::{CreateFileSearchItem, FileSearchItem};
1616
use crate::code::opened_files::{OpenedFilesInRepo, OpenedFilesModel};
1717
use crate::search::command_palette::mixer::CommandPaletteItemAction;
18-
use crate::search::data_source::{Query, QueryResult};
18+
use crate::search::data_source::{Query, QueryFilter, QueryResult};
1919
use crate::search::files::model::FileSearchModel;
2020
use crate::search::files::search_item::FileSearchResult;
2121
use crate::search::mixer::{AsyncDataSource, BoxFuture, DataSourceRunErrorWrapper};
@@ -84,7 +84,11 @@ impl AsyncDataSource for FileDataSource {
8484
self.run_zero_state_query(app)
8585
} else {
8686
// Non-empty query: use fuzzy matching
87-
self.run_fuzzy_search_query(app, query_text)
87+
self.run_fuzzy_search_query(
88+
app,
89+
query_text,
90+
query.filters.contains(&QueryFilter::Files),
91+
)
8892
}
8993
}
9094
}
@@ -184,6 +188,7 @@ impl FileDataSource {
184188
&self,
185189
app: &AppContext,
186190
query_text: &str,
191+
allow_create_file: bool,
187192
) -> BoxFuture<
188193
'static,
189194
Result<Vec<QueryResult<CommandPaletteItemAction>>, DataSourceRunErrorWrapper>,
@@ -286,8 +291,8 @@ impl FileDataSource {
286291
.collect();
287292

288293
// If no files matched and we have a valid query and current directory,
289-
// add a "Create <filename>..." option
290-
if results.is_empty() && !query_file_name.trim().is_empty() {
294+
// add a "Create a file named <filename>..." option
295+
if allow_create_file && results.is_empty() && !query_file_name.trim().is_empty() {
291296
if let Some(current_dir) = current_directory {
292297
let create_item = CreateFileSearchItem {
293298
file_name: query_file_name,

app/src/search/command_palette/files/search_item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl SearchItem for CreateFileSearchItem {
161161
let text_color = highlight_state.sub_text_fill(appearance).into_solid();
162162

163163
let label = Text::new_inline(
164-
format!("Create {}…", &self.file_name),
164+
format!("Create a file named {}…", &self.file_name),
165165
appearance.ui_font_family(),
166166
appearance.monospace_font_size(),
167167
)

skills-lock.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"source": "warpdotdev/common-skills",
4848
"sourceType": "github",
4949
"skillPath": ".agents/skills/pr-walkthrough/SKILL.md",
50-
"computedHash": "990e8549611cff4b82036d4c7cc50d23eb2cbb27272926142d3fd8ad17a5e18f"
50+
"computedHash": "fd5ff2a22f4cc80ef8d0ab3a7bdef427d6463719f9e5fdf47f6fa1371fc4d3f9"
5151
},
5252
"reproduce-bug-report": {
5353
"source": "warpdotdev/common-skills",

0 commit comments

Comments
 (0)