Skip to content

Commit c61ad5b

Browse files
Include .yml and .markdown in Drive import file picker (#9400)
### Description The Warp Drive import flow lets users pick workflow (YAML) and notebook (Markdown) files. The picker uses `FileType::Yaml` and `FileType::Markdown` from `warpui_core::platform::file_picker`, which previously listed only `yaml` and `md`. That doesn't match what the importer is willing to ingest: - [`app/src/drive/import/nodes.rs`](https://github.com/warpdotdev/warp/blob/main/app/src/drive/import/nodes.rs) (`TryFrom<&Path> for FileType`) accepts both `.yaml` and `.yml` for workflows. - [`warp_util::file_type::is_markdown_file`](https://github.com/warpdotdev/warp/blob/main/crates/warp_util/src/file_type.rs) recognises both `.md` and `.markdown` (`MARKDOWN_EXTENSIONS`). - The import modal's helper text in `modal_body.rs` already advertises `"md, yaml, yml"` to users. The result: a user can drag-and-drop a `.yml` workflow or `.markdown` notebook and it imports cleanly, but the file picker filter hides those same files when they click "Choose files…". This change brings the picker in line with what the rest of the import path already accepts. I left `FileType::Image` alone — that one has a separate user-facing contract (the theme creator body explicitly says \"(.png, .jpg)\"), so broadening it would need its own design decision. ### Testing - Added two unit tests covering both extensions for `FileType::Yaml` and `FileType::Markdown`. - `cargo fmt -p warpui_core -- --check` - Couldn't run the full `cargo nextest` locally (Metal toolchain not available on this machine), the change is well-scoped to a const-array literal so risk is low. ### Server API No server changes. ### Agent Mode Not applicable. ### Changelog Entries - Warp Drive import file picker now lists `.yml` and `.markdown` files in addition to `.yaml` and `.md`. --------- Co-authored-by: anshul-garg27 <anshul-garg27@users.noreply.github.com> Co-authored-by: anshul-garg27 <13553550+anshul-garg27@users.noreply.github.com>
1 parent 4dddda6 commit c61ad5b

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

crates/warpui_core/src/platform/file_picker.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ impl FileType {
2828
pub fn extensions(&self) -> &[&str] {
2929
match self {
3030
FileType::Image => &["png", "jpg", "jpeg"],
31-
FileType::Yaml => &["yaml"],
32-
FileType::Markdown => &["md"],
31+
FileType::Yaml => &["yaml", "yml"],
32+
FileType::Markdown => &["md", "markdown"],
3333
}
3434
}
3535

@@ -146,3 +146,7 @@ impl SaveFilePickerConfiguration {
146146
self
147147
}
148148
}
149+
150+
#[cfg(test)]
151+
#[path = "file_picker_tests.rs"]
152+
mod tests;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
use super::*;
2+
3+
#[test]
4+
fn yaml_file_type_accepts_both_yaml_and_yml() {
5+
assert_eq!(FileType::Yaml.extensions(), &["yaml", "yml"]);
6+
}
7+
8+
#[test]
9+
fn markdown_file_type_accepts_md_and_markdown() {
10+
assert_eq!(FileType::Markdown.extensions(), &["md", "markdown"]);
11+
}

0 commit comments

Comments
 (0)