ZIm/crates
tims 8c92da45a9
terminal: Add scrollbar (#23256)
Closes #4798

This PR implements a scrollbar for the terminal by turning
`ScrollableHandle` into a trait, allowing us to implement a custom
scroll handle, `TerminalScrollHandle`. It works by converting terminal
lines into pixels that `ScrollableHandle` understands. When
`ScrollableHandle` provides a changed offset (e.g., when you drag the
scrollbar), we convert this pixel offset back into the number of lines
to scroll and update the terminal content accordingly.

While the current version works as expected, I believe the scrollbar's
offset updates could potentially be turned into an event. This event
could then be subscribed to in `TerminalView`, not needing to update the
terminal's offset in the `render` method as it might have performance
implications. Further ideas on this are welcome.

Preview:


https://github.com/user-attachments/assets/560f0aac-4544-4007-8f0b-8833386f608f

Todo:

- [x] Experiment with custom scrollbar responding to terminal mouse
scroll
- [x] Refactor existing scrollbar handle into a trait  
- [x] Update terminal to use the scrollbar trait instead of a custom
scrollbar implementation
- [x] Figure out how scrollbar events like mouse drag should notify the
terminal to update its state
- [x] Code clean up
- [x] Scrollbar hide setting for terminal

Release Notes:

- Added scrollbar to the terminal
2025-01-18 17:36:41 +01:00
..
activity_indicator chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
anthropic chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
assets chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
assistant chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
assistant2 assistant2: Adjust "generating" state design (#23299) 2025-01-17 20:22:27 -03:00
assistant_settings chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
assistant_slash_command chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
assistant_slash_commands chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
assistant_tool chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
assistant_tools chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
audio chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
auto_update chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
auto_update_ui chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
breadcrumbs chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
call chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
channel chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
cli chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
client chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
clock chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
collab Revert "lsp: Parse LSP messages on background thread - again (#23122)" (#23301) 2025-01-17 15:06:10 -07:00
collab_ui chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
collections chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
command_palette chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
command_palette_hooks chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
context_server chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
context_server_settings chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
copilot chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
db chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
diagnostics chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
docs_preprocessor chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
editor Fix accepting partial inline completion (#23312) 2025-01-18 10:27:12 +00:00
evals chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
extension chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
extension_api chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
extension_cli chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
extension_host chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
extensions_ui chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
feature_flags chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
feedback chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
file_finder chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
file_icons chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
fireworks chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
fs chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
fsevent chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
fuzzy chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
git git: Implement commit creation (#23263) 2025-01-17 18:51:20 +00:00
git_hosting_providers chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
git_ui git: Implement commit creation (#23263) 2025-01-17 18:51:20 +00:00
go_to_line chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
google_ai chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
gpui windows: Improve foreground task dispatching on Windows (#23283) 2025-01-18 23:43:56 +08:00
gpui_macros chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
html_to_markdown html_to_markdown: Restore ability to publish (#23293) 2025-01-17 17:57:13 +00:00
http_client chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
image_viewer chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
indexed_docs chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
inline_completion chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
inline_completion_button chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
install_cli chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
journal chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
language chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
language_extension chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
language_model chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
language_model_selector chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
language_models chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
language_selector chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
language_tools chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
languages chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
livekit_client chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
livekit_client_macos chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
livekit_server chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
lmstudio chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
lsp Revert "lsp: Parse LSP messages on background thread - again (#23122)" (#23301) 2025-01-17 15:06:10 -07:00
markdown chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
markdown_preview chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
media chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
menu chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
multi_buffer chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
node_runtime chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
notifications chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
ollama chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
open_ai chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
outline chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
outline_panel chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
paths chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
picker chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
prettier chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
project git: Implement commit creation (#23263) 2025-01-17 18:51:20 +00:00
project_panel git: Implement commit creation (#23263) 2025-01-17 18:51:20 +00:00
project_symbols chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
prompt_library chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
proto chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
recent_projects terminal: Add scrollbar (#23256) 2025-01-18 17:36:41 +01:00
refineable chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
release_channel chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
remote chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
remote_server chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
repl chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
reqwest_client chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
rich_text chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
rope chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
rpc chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
search chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
semantic_index chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
semantic_version chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
session chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
settings chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
settings_ui chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
snippet chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
snippet_provider chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
snippets_ui chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
sqlez chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
sqlez_macros chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
story chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
storybook chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
streaming_diff chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
sum_tree chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
supermaven chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
supermaven_api chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
tab_switcher chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
task chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
tasks_ui chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
telemetry chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
telemetry_events chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
terminal terminal: Add scrollbar (#23256) 2025-01-18 17:36:41 +01:00
terminal_view terminal: Add scrollbar (#23256) 2025-01-18 17:36:41 +01:00
text chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
theme chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
theme_extension chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
theme_importer chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
theme_selector chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
time_format chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
title_bar chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
toolchain_selector chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
ui terminal: Add scrollbar (#23256) 2025-01-18 17:36:41 +01:00
ui_input chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
ui_macros chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
util chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
vcs_menu chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
vim chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
vim_mode_setting chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
welcome chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
workspace Remove gap in layout of notifications (#23303) 2025-01-17 23:56:45 +00:00
worktree git: Implement commit creation (#23263) 2025-01-17 18:51:20 +00:00
zed chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
zed_actions chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
zeta chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00