Add hidden prompt_to_focus field to OpenPromptLibrary action (#29062)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-04-18 14:39:40 -06:00 committed by GitHub
parent 327fee4d22
commit 73a767fc45
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 60 additions and 18 deletions

View file

@ -2965,6 +2965,11 @@ impl ActiveThread {
))
};
let first_default_user_rules_id = project_context
.default_user_rules
.first()
.map(|user_rules| user_rules.uuid);
let rules_files = project_context
.worktrees
.iter()
@ -3015,8 +3020,13 @@ impl ActiveThread {
.icon_color(Color::Ignored)
// TODO: Figure out a way to pass focus handle here so we can display the `OpenPromptLibrary` keybinding
.tooltip(Tooltip::text("View User Rules"))
.on_click(|_event, window, cx| {
window.dispatch_action(Box::new(OpenPromptLibrary), cx)
.on_click(move |_event, window, cx| {
window.dispatch_action(
Box::new(OpenPromptLibrary {
prompt_to_focus: first_default_user_rules_id,
}),
cx,
)
}),
),
)