storybook: Fix crash in Picker story (#10793)
@mikayla-maki approved my suggested change as noted in the issue below... Release Notes: - Fixed: [#10739 ](https://github.com/zed-industries/zed/issues/10739)
This commit is contained in:
parent
2677ec7568
commit
4ab48c689f
3 changed files with 4 additions and 0 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -9418,6 +9418,7 @@ dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"menu",
|
"menu",
|
||||||
"picker",
|
"picker",
|
||||||
|
"project",
|
||||||
"rust-embed",
|
"rust-embed",
|
||||||
"settings",
|
"settings",
|
||||||
"simplelog",
|
"simplelog",
|
||||||
|
|
|
@ -26,6 +26,7 @@ language.workspace = true
|
||||||
log.workspace = true
|
log.workspace = true
|
||||||
menu.workspace = true
|
menu.workspace = true
|
||||||
picker.workspace = true
|
picker.workspace = true
|
||||||
|
project.workspace = true
|
||||||
rust-embed.workspace = true
|
rust-embed.workspace = true
|
||||||
settings.workspace = true
|
settings.workspace = true
|
||||||
simplelog = "0.9"
|
simplelog = "0.9"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use fuzzy::StringMatchCandidate;
|
use fuzzy::StringMatchCandidate;
|
||||||
use gpui::{div, prelude::*, KeyBinding, Render, SharedString, Styled, Task, View, WindowContext};
|
use gpui::{div, prelude::*, KeyBinding, Render, SharedString, Styled, Task, View, WindowContext};
|
||||||
use picker::{Picker, PickerDelegate};
|
use picker::{Picker, PickerDelegate};
|
||||||
|
use project::Project;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use ui::{prelude::*, ListItemSpacing};
|
use ui::{prelude::*, ListItemSpacing};
|
||||||
use ui::{Label, ListItem};
|
use ui::{Label, ListItem};
|
||||||
|
@ -190,6 +191,7 @@ impl PickerStory {
|
||||||
]);
|
]);
|
||||||
delegate.update_matches("".into(), cx).detach();
|
delegate.update_matches("".into(), cx).detach();
|
||||||
|
|
||||||
|
Project::init_settings(cx);
|
||||||
let picker = Picker::uniform_list(delegate, cx);
|
let picker = Picker::uniform_list(delegate, cx);
|
||||||
picker.focus(cx);
|
picker.focus(cx);
|
||||||
picker
|
picker
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue