Repository navigation
fix: review fixes 01-1.3 - #4
Merged
Merged
Conversation
Split the whole text into rows in one RFC 4180 quote-aware pass instead of splitting by newline before parsing quotes, so quoted fields with embedded newlines no longer break rows. Remove the now unused parseCSVRow.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Review fixes for the
csvrepo from the 2026-10-11 review plan.01-1.3 CSV parser splits by newline before quotes (applied)
Commit
fcca090-fix(csv): 01-1.3 parse quoted newlinesWhat changed in
src/main.tsx:parseCSVText(text)does one RFC 4180 quote-aware pass over the whole text: quoted fields may contain commas,""and newlines;\routside quotes is droppedextractValidTableDatanow usesparseCSVText(rawText).filter(row => row.some(cell => cell !== ''))instead ofrawText.split(/\r?\n/)+parseCSVRowparseCSVRowhad no other callers (checked with grep), so it is removed per the plan; the header doc comment that named it is updatedWhy: a quoted field with a newline inside (Fidelity Activity/History descriptions) was split into two broken rows, and the "most frequent row length" heuristic silently dropped them. In the plan example the old parser also stopped recording at the broken row, so every row after it was lost too
How verified
Throwaway Bun script outside the repo: old
extractValidTableDatataken fromorigin/master, new one from this branch, both run on the same inputs (bun verify.ts):Inputs the old parser already handled give identical output; the two quoted-newline inputs are now parsed into 3 rows of 3 columns
Gate run locally:
bun install -E- 513 packages installedbun run build- built in 1.84s, no errorsgit diff --check- cleanKnown behavior differences (by design of the plan's parser, not tested in the browser):
,,) is now dropped as an empty row (before it was kept as a row of empty cells)\r\nin the cell value02-2.4 validate saved state shape (NOT applied)
Stopped per the plan rules: the anchor
const raw = localStorage.getItem(LOCALSTORAGE_DATA_KEY);matches twice insrc/main.tsx(inNEEDS_BOOT_RESTOREand inloadPersistedDataSets). Also the plan's check (d.rows,d.headers) does not match the real typeinterface DataSet { fileName: string; data: string[][]; }and would reject every valid saved dataset. Left for a follow-up once the plan is correctedManual checks still needed
bun run serve, load a real Fidelity Activity/History CSV with multi-line descriptions and check that no rows are missing and the multi-line cell renders