Skip to content

Add native word wrap toggle with cutoff as the default - #129

Merged
jonaraphael merged 2 commits into
mainfrom
codex/word-wrap-toggle
Oct 18, 2026
Merged

jonaraphael merged 2 commits into
mainfrom
codex/word-wrap-toggle

Conversation

@jonaraphael

@jonaraphael jonaraphael commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Long multiline values force tall rows even after users drag them smaller. Add an icon-only word-wrap action immediately beside CSV: Switch Between Table and Text in the native editor title bar. Hover shows CSV: Enable Word Wrap or CSV: Disable Word Wrap, according to the active table’s state. Remove the separate in-grid toolbar row.

Each file starts with wrap off, displaying single-line cutoff with an ellipsis at the existing automatic width cap. An explicit wrap choice is retained in that view’s webview state. The action preserves the selected cell/range, reveals its endpoint after reflow, and retains manual sizes and full values for editing, clipboard, Find and saving. A live range is no longer collapsed to its anchor when focus returns from a title action. Saved and untitled editable tables share this action; text, preview and comparison views omit it.

Native commands csv.enableWordWrap and csv.disableWordWrap provide state-dependent hover text and Command Palette actions. No global setting is added. The test installer is version 1.5.1.

Cutoff retains opaque frozen-row dividers and the high-contrast selection/Find outline colors. Also correct a fractional collapsed-border resize probe found during testing, keeping its grab area narrow.

Validation:

  • npm test: 705 passed, zero failures; includes CSV/TSV selection, complete clipboard values, live drafts/caret, focus-return ranges, state restoration, viewport following, command routing and title-action contributions.
  • npm run lint: zero errors; 82 existing warnings.
  • Installed candidate in an isolated VS Code 1.142.0 profile: native enable/disable commands received live webview acknowledgments for saved CSV, TSV and untitled tables; new files defaulted off, two editor groups retained independent choices, and contents remained unchanged.
  • Browser check using actual provider HTML, shipped scripts and registered command bridge: cutoff starts on, the extra toolbar is absent, a selected range at source rows 80–81 survives enabling/disabling, and its endpoint remains inside the viewport in both modes.
  • Earlier browser verification of the same cutoff CSS covers manual sizing, long multiline values and four theme classes, including opaque frozen seams under selection and Find states.

Actual webview captures below exclude the native editor title bar:

Cutoff, the default

Wrapping enabled

@jonaraphael jonaraphael changed the title Add word wrap toggle with selection-preserving cutoff Add native word wrap toggle with cutoff as the default Oct 18, 2026
@jonaraphael
jonaraphael merged commit 58a7809 into main Oct 18, 2026
1 check passed
@jonaraphael
jonaraphael deleted the codex/word-wrap-toggle branch October 19, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant