Files
zed/crates/markdown/Cargo.toml
T
JC DiamanteandMrSubidubi 51db7df750 markdown: Add horizontal scrollbars to wide tables (#61745)
## Objective

Add functional horizontal scrollbars to wide Markdown tables, matching
the existing code-block scrollbar pattern.

Fixes #61437

PR was talked about in https://github.com/zed-industries/zed/pull/61698

## Implementation:
- Added a `BTreeMap<usize, ScrollHandle>` to `Markdown` for table scroll
handles, keyed by source-range start.
- During `MarkdownElement` layout, each table container is connected to
a `Scrollbars` widget configured for the horizontal axis, using a stable
ID derived from `("markdown-table-scrollbar", range.start)`.
- The inner table div uses `overflow_x_scroll()` + `track_scroll()` with
`restrict_scroll_to_axis`.
- Handles for removed tables are discarded after re-rendering.
- No public API, setting, schema, or migration changes required.

## Recording


https://github.com/user-attachments/assets/cd0f635b-a485-4de8-9059-40a05f256fb1

## Release Notes:

- Improved navigation of wide Markdown tables with horizontal
scrollbars.

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
2026-08-06 15:18:02 +00:00

56 lines
1.4 KiB
TOML

[package]
name = "markdown"
version = "0.1.0"
edition.workspace = true
publish.workspace = true
license = "GPL-3.0-or-later"
[lints]
workspace = true
[lib]
path = "src/markdown.rs"
doctest = false
[features]
test-support = [
"gpui/test-support",
"util/test-support"
]
[dependencies]
anyhow.workspace = true
base64.workspace = true
collections.workspace = true
futures.workspace = true
gpui.workspace = true
html5ever.workspace = true
language.workspace = true
linkify.workspace = true
log.workspace = true
markup5ever_rcdom.workspace = true
mermaid_render = { path = "../mermaid_render" }
pulldown-cmark.workspace = true
settings.workspace = true
smallvec.workspace = true
stacksafe.workspace = true
sum_tree.workspace = true
theme.workspace = true
theme_settings.workspace = true
ui.workspace = true
util.workspace = true
[dev-dependencies]
assets.workspace = true
env_logger.workspace = true
fs = {workspace = true, features = ["test-support"]}
gpui = { workspace = true, features = ["test-support"] }
gpui_platform = { workspace = true, features = ["wayland", "x11"] }
image.workspace = true
indoc.workspace = true
language = { workspace = true, features = ["test-support"] }
languages = { workspace = true, features = ["load-grammars"] }
node_runtime.workspace = true
settings = { workspace = true, features = ["test-support"] }
util = { workspace = true, features = ["test-support"] }