Feature request: opt-in no-wrap / horizontal-scroll for long lines in split view
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Start by tracing split view rendering with viewType="split", including the single table, library-owned col elements, and the renderToken injection point described in the issue. Compare the existing renderToken workaround with the requested options, and consider the work complete when an opt-in no-wrap mode, stable per-line hook, or documented current-layout guidance supports the intended horizontal-scroll behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi, and thanks for the library — it powers the diff viewer in our code-review product.
Problem
In split (viewType="split") view, long code lines always soft-wrap onto multiple visual rows. We'd like the option to keep each line on one row and let it scroll horizontally instead. There doesn't appear to be a supported way to do this today.
Why it's hard to work around
The split view renders both panes inside a single 4-column
with table-layout: fixed; width: 100% and library-owned elements. As a result:- white-space: pre on the code cell just overflows/bleeds into the adjacent cell — the table never widens, so overflow-x: auto has nothing to scroll.
- min/max-width on
<td>is ignored per spec; only<col>widths constrain columns, and those are owned by the component template. - There's no per-line wrapper element around the code tokens (they render directly into the
<td>), so the only injection point is a synthetic token via renderToken — which works but is fragile.
We found a workaround using renderToken + a CSS transform driven by custom scrollbars, but it's brittle and fights the table layout.
What would help (any one of these):
- A prop like wrapLines={false} / nowrap that switches long lines to horizontal-scroll.
- A stable per-line wrapper element (or a documented render hook) so consumers can control overflow/scroll per code cell.
- Guidance on achieving independent per-pane horizontal scroll with the current single-table split layout, if it's already possible.
Environment: react-diff-view 3.3.3, React 18, split view, parseDiff + tokenize.
Happy to share a minimal repro or a PR sketch if that's useful. Thanks!
- Ngôn ngữ chính
- TypeScript
- Star
- 1k
- Fork
- 88
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của otakustay/react-diff-view
-
pinned
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
otakustay/react-diff-view#101 · 5 bình luận ·
-
Virtualization for diffsĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
otakustay/react-diff-view#237 ·
-
跨行注释未闭合时的代码被高亮为注释了Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
otakustay/react-diff-view#233 · 2 bình luận ·
-
Accessibility: Add screenreader-only text to table cells for status indicatorsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
otakustay/react-diff-view#232 · 1 bình luận ·
-
Multiline comments supportĐang mởpinned
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
otakustay/react-diff-view#185 · 15 bình luận ·
Tất cả issue của otakustay/react-diff-view
Issue tương tự
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
github/docs#46222 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent-ready area: config area: skills type: chore upstream: brain-kit
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
enhancement priority:low ready-for-dev
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug escritorio mapa
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
marcosferr/reporte-ciudadano#4 · 1 bình luận ·
-
area: material/sort gemini-triaged needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
angular/components#33933 ·
Maintainer thường phản hồi trong vòng 1 ngày