Skip to content

feat(editor): resize CSV table columns - #13223

Open
hungrytech wants to merge 2 commits into
stablyai:mainfrom
hungrytech:feat/csv-column-resize
Open

hungrytech wants to merge 2 commits into
stablyai:mainfrom
hungrytech:feat/csv-column-resize

Conversation

@hungrytech

@hungrytech hungrytech commented Aug 8, 2026 •

Copy link
Copy Markdown

Summary

Part of #12915.

  • add draggable resize handles to CSV table headers
  • keep the header and virtualized body rows on the same column widths
  • preserve manual widths per file for the current app session, including tab and view remounts
  • support Arrow Left/Right resizing with an 80 px minimum and localized, column-specific separator labels
  • clean up resize state when the pointer is cancelled or the window loses focus

Direct cell editing and row or column operations remain out of scope for this PR.

Screenshots

CSV table before and after resizing the Name column

Captured from the Electron E2E app after dragging the first column boundary 120 px.

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test — 4,574 files passed, 48,419 tests passed, 100 skipped
  • Added interaction coverage for drag resizing, header/body width synchronization, keyboard resizing, minimum-width clamping, remount persistence, and interrupted-drag cleanup

Focused tests:

pnpm exec vitest run --config config/vitest.config.ts \
  src/renderer/src/components/editor/CsvViewer.test.tsx \
  src/renderer/src/components/editor/csv-parse.test.ts

Result before the follow-up hardening commit: 2 files passed, 18 tests passed.

The updated resize interaction suite was then rerun on the final commit: 1 file passed, 4 tests passed.

Electron proof:

  • 1 Playwright test passed against the E2E app
  • opened a real CSV file, dragged the first header boundary 120 px, and verified the shared grid template changed

Additional checks on the final commit:

  • full TypeScript check passed
  • focused Oxlint: 0 warnings and 0 errors
  • React Doctor: 0 warnings and 0 errors
  • localization audit passed
  • reliability gates and max-lines ratchet passed
  • git diff --check passed

A later local full-suite attempt on the final commit hit the command timeout after an unrelated omp-shell-wrapper.node-pty failure. No CSV test failed; the final focused CSV suite and full typecheck passed.

AI Review Report

The review checked pointer lifecycle and cancellation, cursor and selection cleanup, keyboard access, header/body alignment, tab and view remounts, duplicate headers, and localization coverage. The interaction stays in the renderer and uses standard pointer and keyboard events, so macOS, Windows, and Linux use the same path. SSH, remote runtimes, agents, integrations, and git providers are untouched. Row virtualization is unchanged, and resize work is limited to updating the shared column template. React Doctor reported 0 warnings and 0 errors.

Security Audit

No IPC, network access, dependencies, command execution, path handling, permissions, authentication, or secret handling were added. Column widths stay in a renderer-only, session-scoped cache and are not written to disk or to the CSV.

Contributor

X handle: not provided.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f3b5b897-2c4d-42f7-b859-f284bf96c070

📥 Commits

Reviewing files that changed from the base of the PR and between a894c67 and 14024fc.

📒 Files selected for processing (9)
  • src/renderer/src/components/editor/CsvColumnResizeHandle.tsx
  • src/renderer/src/components/editor/CsvViewer.test.tsx
  • src/renderer/src/components/editor/CsvViewer.tsx
  • src/renderer/src/components/editor/csv-column-widths.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes (7)
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/components/editor/CsvColumnResizeHandle.tsx
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/components/editor/csv-column-widths.ts
  • src/renderer/src/i18n/locales/ja.json

📝 Walkthrough

Walkthrough

The CSV viewer calculates column widths from headers and up to 200 body rows. Users can resize columns with pointer dragging or keyboard arrow keys. Widths are clamped during resizing and persisted per file across content updates and remounts. Header and row grid widths remain synchronized. Localized accessibility labels were added in five languages. Tests cover resizing, clamping, cleanup, persistence, and interrupted drags.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: adding CSV table column resizing.
Description check ✅ Passed The description covers the user-visible change, screenshot, testing, AI review, and security audit with sufficient detail.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hungrytech
hungrytech marked this pull request as draft August 8, 2026 16:38
@hungrytech
hungrytech marked this pull request as ready for review August 8, 2026 23:35
@nwparker nwparker removed the P2 label Aug 19, 2026

This branch has not been deployed

No deployments
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.

4 participants