ZIm/crates/assistant2/src
Dino e0fc767c11
Display case-sensitive keybindings for vim commands (#24322)
This Pull Request tackles the issue outline in #14287 by changing the
way `KeyBinding`s for vim mode are displayed in the command palette.
It's worth pointing out that this whole thing was pretty much
implemented by Conrad Irwin during a pairing session, I just tried to
clean up some other changes introduced for a different issue, while
improving some comments.

Here's a quick list of the changes introduced:

- Update `KeyBinding` with a new `vim_mode` field to determine whether
the keybinding should be displayed in vim mode.
- Update the way `KeyBinding` is rendered, so as to detect if the
keybinding is for vim mode, if it is, only display keys in uppercase if
they require the shift key.
- Introduce a new global state – `VimStyle(bool)` - use to determine
whether `vim_mode` should be enabled or disabled when creating a new
`KeyBinding` struct. This global state is automatically set by the `vim`
crate whenever vim mode is enabled or disabled.
- Since the app's context is now required when building a `KeyBinding` ,
update a lot of callers to correctly pass this context.

And before and after screenshots, for comparison:

| before | after |
|--------|-------|
| <img width="1050" alt="SCR-20250205-tyeq"
src="https://github.com/user-attachments/assets/e577206d-2a3d-4e06-a96f-a98899cc15c0"
/> | <img width="1050" alt="SCR-20250205-tylh"
src="https://github.com/user-attachments/assets/ebbf70a9-e838-4d32-aee5-0ffde94d65fb"
/> |

Closes #14287 

Release Notes:

- Fix rendering of vim commands to preserve case sensitivity

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-02-14 22:03:59 -07:00
..
context_picker Omit gitignored files from context file picker (#23777) 2025-01-28 11:40:42 -03:00
ui Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
active_thread.rs assistant2: Add tiny visual adjustments (#23748) 2025-01-27 20:26:34 -03:00
assistant.rs Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
assistant_configuration.rs assistant2: Tweak the settings UI (#23845) 2025-01-29 16:20:09 -03:00
assistant_model_selector.rs Fix hover tooltips appearing after related element is pressed (#24540) 2025-02-10 00:16:12 +00:00
assistant_panel.rs Display case-sensitive keybindings for vim commands (#24322) 2025-02-14 22:03:59 -07:00
buffer_codegen.rs Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
context.rs Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
context_picker.rs Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
context_store.rs Rename model based variable names to entity (#24198) 2025-02-04 10:24:35 -08:00
context_strip.rs Display case-sensitive keybindings for vim commands (#24322) 2025-02-14 22:03:59 -07:00
inline_assistant.rs edit predictions: Cache settings across renders (#24581) 2025-02-10 20:57:25 +00:00
inline_prompt_editor.rs Display case-sensitive keybindings for vim commands (#24322) 2025-02-14 22:03:59 -07:00
message_editor.rs Display case-sensitive keybindings for vim commands (#24322) 2025-02-14 22:03:59 -07:00
terminal_codegen.rs Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
terminal_inline_assistant.rs Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
thread.rs Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
thread_history.rs assistant2: Add tiny visual adjustments (#23748) 2025-01-27 20:26:34 -03:00
thread_store.rs assistant2: Don't block ThreadStore initialization on reloading the threads (#23728) 2025-01-27 12:59:28 -05:00
ui.rs assistant2: Sketch in sending file context to model (#21829) 2024-12-10 16:35:53 -05:00