Skip to content

fix(clipboard): preserve Windows line endings for result copies - #2909

Merged
openai0229 merged 1 commit into
mainfrom
fix/result-copy-crlf
Sep 14, 2026
Merged

openai0229 merged 1 commit into
mainfrom
fix/result-copy-crlf

Conversation

@openai0229

Copy link
Copy Markdown
Contributor

Related issue

N/A

Summary

Windows native applications such as SAP GUI expect clipboard text rows to use CRLF. Result-set copies previously wrote LF-only text, which caused SAP paste to collapse rows and display # markers. Normalize copied text to CRLF on Windows while preserving LF on macOS/Linux, and normalize internal result-grid matching so table paste keeps its cell metadata.

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

Verification

  • Commands and results:
    • yarn install --frozen-lockfile --non-interactive — passed in the PR worktree.
    • yarn test:sql-in-clipboard — passed (clipboard normalization, internal grid clipboard, SQL-in clipboard, insert defaults).
    • yarn lint — passed (ESLint and Stylelint).
    • git diff --check — passed.
    • Before PR creation, Community frontend build, Local frontend build/API contract, Local backend packaging, and browser VTable clipboard regression all passed.
  • Manual verification: Local Windows runtime was tested with SAP; result-set paste now works with rows preserved.
  • UI evidence: N/A

Risk and compatibility

  • Public API or stored data: N/A; clipboard serialization only.
  • Database or driver compatibility: N/A; no database code changed.
  • Network, privacy, or security: N/A.
  • Community / Local / Pro boundary: Shared Community frontend utility; Studio consumes the pinned Community source.
  • Backward compatibility: macOS/Linux retain original line endings; internal grid paste accepts LF and CRLF.

Reviewer map

  • Start here: chat2db-community-client/src/utils/clipboardText.ts and chat2db-community-client/src/utils/index.ts:292-325.
  • Failure condition: On Windows, result-set copy must contain \\r\\n between rows; internal result-grid paste must still recover the original matrix.
  • Rollback or disable path: Revert commit 34f061f56 to restore the previous clipboard serialization.

Contributor declaration

  • I linked the Issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below, or this PR contains no substantial AI-generated code.

AI assistance: Codex performed source investigation, implementation, tests, browser regression verification, and packaging validation under maintainer direction.

@openai0229
openai0229 requested a review from a team as a code owner September 14, 2026 05:58
@openai0229 openai0229 moved this to In Review in Chat2DB Community Sep 14, 2026
@openai0229
openai0229 merged commit cc89dc6 into main Sep 14, 2026
18 of 21 checks passed
@openai0229
openai0229 deleted the fix/result-copy-crlf branch September 14, 2026 06:10
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant