[PR #4912] [MERGED] fix(test): make the summary reorder regression robust to line endings #6539

Closed
opened 2026-10-23 04:11:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4912
Author: @kolacheee
Created: 8/11/2026
Status: ✅ Merged
Merged: 8/11/2026
Merged by: @kolacheee

Base: staging ← Head: fix/summary-reorder-regression-crlf


📝 Commits (2)

  • 22076e2 fix(test): make the summary reorder regression robust to line endings (#4911)
  • 708cb61 test: assert the summary reorder surface on one element incl. its persisted index (#4911)

📊 Changes

2 files changed (+8 additions, -2 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 scripts/regressions/open-issues.regression.ts (+7 -2)

📄 Description

Linked issue

Closes #4911

Why this change

The open-issues regression fails on Windows checkouts at the assertion "Summary entries must expose a shared desktop and touch reorder surface", even on a clean staging tree. It passes in Linux CI.

Root cause is a brittle proximity check, not a real regression. The assertion required data-summary-entry-root and the nearest following data-touch-reorder-item to be within 3000 characters:

/data-summary-entry-root[\s\S]{0,3000}data-touch-reorder-item/u

After the entry row was extracted into the SummaryEntryRow sub-component, those two markers sit ~52 lines apart in SummaryPopover.tsx. On the committed LF blob the gap is 2998 chars — 2 under the limit — so CI passes. But the repo uses * text=auto and core.autocrlf defaults to true on Windows, so a Windows working tree has CRLF; the ~52 extra carriage-return bytes push the gap to 3050, over the limit, and readFileSync(..., "utf8") reads those CRLF bytes. So the check passed in Linux CI and failed for every Windows contributor.

The reorder feature is fully intact — the SummaryEntryRow root element carries data-touch-reorder-item="summary-entry" together with draggable, onDragStart, onDragOver, onDrop, and onDragEnd, and the container root wires onDragOver/onDrop for desktop drops.

What changed

  • scripts/regressions/open-issues.regression.ts — replaced the single 3000-char cross-component proximity match with two tight assertions that verify the actual shared surface, independent of line endings and of where the row component is defined:
    • the container root is the desktop drop target (data-summary-entry-root → onDrop={handleSummaryDrop});
    • the row element is both a touch-reorder item and desktop-draggable (data-touch-reorder-item={reorderable ? "summary-entry" → draggable={reorderable && dragReady} → onDragStart={onDragStart}).
  • CHANGELOG.md — one entry under Fixed.

No production code changed.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Automated, done by me:

  • pnpm check passes (exit 0).
  • pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/open-issues.regression.ts now passes end-to-end on a Windows (CRLF) working tree ("Open-issue regressions passed."), where it previously aborted on this assertion.
  • Verified both new regexes match the current SummaryPopover.tsx on both CRLF and LF-normalized content.

No app/runtime behavior changed, so there is nothing to click through in a browser.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

CHANGELOG.md updated. No docs/ change and no version bump.

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes

    • Fixed a Windows regression affecting chat-summary entry reordering.
    • Improved desktop drag-and-drop and touch reordering, including more reliable drag-over, drop, draggable-state, and drag-start behavior.
    • Reordering now works consistently across supported input methods without being affected by Windows line-ending differences.
  • Documentation

    • Added a changelog entry documenting the Windows reordering fix.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/4912 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 8/11/2026 **Status:** ✅ Merged **Merged:** 8/11/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `fix/summary-reorder-regression-crlf` --- ### 📝 Commits (2) - [`22076e2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/22076e24309e9917f6bd4292ea23d926776e2029) fix(test): make the summary reorder regression robust to line endings (#4911) - [`708cb61`](https://github.com/Pasta-Devs/Marinara-Engine/commit/708cb6164064a5293031ddc1a7fa8a9e3977051a) test: assert the summary reorder surface on one element incl. its persisted index (#4911) ### 📊 Changes **2 files changed** (+8 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `scripts/regressions/open-issues.regression.ts` (+7 -2) </details> ### 📄 Description ## Linked issue Closes #4911 ## Why this change The `open-issues` regression fails on **Windows checkouts** at the assertion "Summary entries must expose a shared desktop and touch reorder surface", even on a clean `staging` tree. It passes in Linux CI. Root cause is a brittle proximity check, not a real regression. The assertion required `data-summary-entry-root` and the nearest following `data-touch-reorder-item` to be within 3000 characters: ```js /data-summary-entry-root[\s\S]{0,3000}data-touch-reorder-item/u ``` After the entry row was extracted into the `SummaryEntryRow` sub-component, those two markers sit ~52 lines apart in `SummaryPopover.tsx`. On the committed LF blob the gap is **2998** chars — 2 under the limit — so CI passes. But the repo uses `* text=auto` and `core.autocrlf` defaults to true on Windows, so a Windows working tree has **CRLF**; the ~52 extra carriage-return bytes push the gap to **3050**, over the limit, and `readFileSync(..., "utf8")` reads those CRLF bytes. So the check passed in Linux CI and failed for every Windows contributor. The reorder feature is fully intact — the `SummaryEntryRow` root element carries `data-touch-reorder-item="summary-entry"` together with `draggable`, `onDragStart`, `onDragOver`, `onDrop`, and `onDragEnd`, and the container root wires `onDragOver`/`onDrop` for desktop drops. ## What changed - `scripts/regressions/open-issues.regression.ts` — replaced the single 3000-char cross-component proximity match with two tight assertions that verify the *actual* shared surface, independent of line endings and of where the row component is defined: - the container root is the desktop drop target (`data-summary-entry-root` → `onDrop={handleSummaryDrop}`); - the row element is both a touch-reorder item and desktop-draggable (`data-touch-reorder-item={reorderable ? "summary-entry"` → `draggable={reorderable && dragReady}` → `onDragStart={onDragStart}`). - `CHANGELOG.md` — one entry under Fixed. No production code changed. ## Validation - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes Automated, done by me: - `pnpm check` passes (exit 0). - `pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/open-issues.regression.ts` now passes end-to-end on a **Windows (CRLF)** working tree ("Open-issue regressions passed."), where it previously aborted on this assertion. - Verified both new regexes match the current `SummaryPopover.tsx` on both CRLF and LF-normalized content. No app/runtime behavior changed, so there is nothing to click through in a browser. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) `CHANGELOG.md` updated. No `docs/` change and no version bump. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit * **Bug Fixes** * Fixed a Windows regression affecting chat-summary entry reordering. * Improved desktop drag-and-drop and touch reordering, including more reliable drag-over, drop, draggable-state, and drag-start behavior. * Reordering now works consistently across supported input methods without being affected by Windows line-ending differences. * **Documentation** * Added a changelog entry documenting the Windows reordering fix. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:11:23 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6539
No description provided.