Feature request: opt-in no-wrap / horizontal-scroll for long lines in split view
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- react, typescript
- 領域
- frontend
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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!
- 主要言語
- TypeScript
- スター
- 1k
- フォーク
- 88
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
otakustay/react-diff-view のほかの issue
-
pinned
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
otakustay/react-diff-view#101 · コメント 5 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
otakustay/react-diff-view#237 ·
-
跨行注释未闭合时的代码被高亮为注释了オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
otakustay/react-diff-view#233 · コメント 2 件 ·
-
Accessibility: Add screenreader-only text to table cells for status indicators対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
otakustay/react-diff-view#232 · コメント 1 件 ·
-
pinned
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
otakustay/react-diff-view#185 · コメント 15 件 ·
otakustay/react-diff-view の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
area:ui enhancement issue-form:feature platform:cross-platform review: high
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
1lck/Lithe-IDEA#1092 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
developmentseed/deck.gl-raster#693 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
Marker-Inc-Korea/AutoRAG#1801 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信