Repository navigation
fix: keep backtick-quoted column names with commas intact when toggling columns - #3451
Conversation
…ECT lists splitAndTrimWithBracket now treats backtick-quoted identifiers as opaque, so toggling a search column no longer rewrites `a,b` as `a, b`. The column and sort editors drop their own splitClauseList wrapper and use the shared splitter. Text after an unclosed quote is kept instead of dropped. HDX-5797
🦋 Changeset detectedLatest commit: 4e44358 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Additional context: spans packages but only 57 prod lines — under the 100-line cross-layer bar Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
PR Review
2 finding(s): 🔴 0 critical · 🟠 0 major · 🔵 2 minor 2 posted as inline comment(s) on the changed lines. Severity is the reviewer's own estimate and is used for ordering, not filtering. No finding blocks merge automatically; a maintainer decides. |
[Medium impact] The PR appears safe to merge. SummaryKeeps commas inside backtick-quoted column names intact when users toggle columns.
Reviews (3) · Last reviewed commit: "Merge branch 'main' into jordansimonovsk..." · Reviewed by Greptile |
Deep Review✅ No critical issues found. The fix is correct for all valid inputs: a comma inside a backtick-quoted identifier ( 🟡 P2 — recommended
🔵 P3 nitpicks (3)
Reviewers (7): correctness, testing, maintainability, project-standards, kieran-typescript, adversarial, previous-comments. Testing gaps:
No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
E2E Test Results✅ All tests passed • 457 passed • 1 skipped • 1438s
Tests ran across 4 shards in parallel. |
| } | ||
| // An unclosed quote swallows the closing ','; keep its text so a half-typed | ||
| // name survives. Unclosed brackets still drop it, as parseToStartOfFunction expects. | ||
| if (inBacktick || inSingleQuote || inDoubleQuote) { |
There was a problem hiding this comment.
🔵 minor — Keeping the text after an unclosed quote lets the columns editor absorb columns added after it
ColumnsPopover rebuilds the draft with items.join(', ') and then splits it again (packages/app/src/components/SearchResultsToolbar/ColumnsPopover.tsx:86,93,110). Take the draft Timestamp, aand addBody. The draft becomes Timestamp, a, Body, which splits back into ['Timestamp', 'a, Body']. Bodynever shows up as its own row and stays in the options list, so each further click appends, Bodyagain. Dragging ``a `` above Timestamp has the same effect and merges the two into one item. Before this PR the dangling item was dropped instead. Two possible fixes: disable add and reorder while the last item has an open quote, or have the splitter tell callers which item is unterminated so the editor can block structural edits on it. Add a ColumnsPopover test that adds a column after an unclosed backtick.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
| } | ||
| // An unclosed quote swallows the closing ','; keep its text so a half-typed | ||
| // name survives. Unclosed brackets still drop it, as parseToStartOfFunction expects. | ||
| if (inBacktick || inSingleQuote || inDoubleQuote) { |
There was a problem hiding this comment.
🔵 minor — Unclosed-quote fallback also fires when brackets are unbalanced, which contradicts the comment and the PR description
The fallback only checks the quote flags. Input with an unclosed bracket that also has an open quote, such as Timestamp, count(aorx, f('y, now returns its last item. The same input without the quote, count(a, still drops it. The comment says unclosed brackets still drop the item, as parseToStartOfFunctionexpects, so this case breaks that contract. AddparenCount === 0 && squareCount === 0` to the condition, and add a test for an unclosed quote inside an open paren.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
Summary
Removing or adding a search column no longer breaks a backtick-quoted name that contains a comma. The shared SELECT splitter used to cut
`a,b`in two, so toggling any column from the table header rewrote it as`a, b`, which names a different column and breaks the query.Timestamp, `a, now keeps its text. Before, the text after the quote was dropped, and the columns editor erased it when you added or removed a column.Breaking changes
None. Inputs without backticks split as before. The one behaviour change: input ending in an unclosed
',"or`now returns its last item instead of dropping it. Unclosed brackets still drop it.Screenshots or video
I tested this locally against the demo server but couldn't attach images from the CLI. The author will add Before and After.
How to reproduce
Starting point:
yarn app:dev:local, onboarding, "Connect to Demo Server", Demo Logs source.On
main:Timestamp, Body AS `a,b`, ServiceNameand click Run.ServiceNamecolumn header and click the X.Timestamp, Body AS `a, b`.On this branch:
Timestamp, Body AS `a,b`and the table still loads.How to test on Vercel preview
Preview routes: /search
Steps:
Timestamp, Body AS `a,b`, ServiceNameand click Run.Timestamp, Body AS `a,b`and the results table shows ana,bcolumn.References