Feature request: opt-in no-wrap / horizontal-scroll for long lines in split view
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 42/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- react, typescript
- Área
- frontend
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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!
- Lenguaje dominante
- TypeScript
- Estrellas
- 1k
- Forks
- 88
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de otakustay/react-diff-view
-
pinned
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
otakustay/react-diff-view#101 · 5 comentarios ·
-
Virtualization for diffsAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
otakustay/react-diff-view#237 ·
-
跨行注释未闭合时的代码被高亮为注释了Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
otakustay/react-diff-view#233 · 2 comentarios ·
-
Accessibility: Add screenreader-only text to table cells for status indicatorsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
otakustay/react-diff-view#232 · 1 comentario ·
-
Multiline comments supportAbiertopinned
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
otakustay/react-diff-view#185 · 15 comentarios ·
Todos los issues de otakustay/react-diff-view
Issues similares
-
Add: YRF Music NepalAbiertostreams:add
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
walletbeat/walletbeat#1558 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
hawk-digital-environments/HAWKI#438 ·
Los mantenedores suelen responder en 1 día
-
Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
GiganticMinecraft/seichi-portal-frontend#1165 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día