Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: a357775 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 |
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Additional context: spans packages but only 92 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 P0/P1 · 🟡 1 P2 · 🔵 1 P3 1 posted as inline comment(s) on the changed lines. 1 P3 folded at the bottom. 🔵 1 P3 — no action needed before merge
Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides. |
E2E Test Results✅ All tests passed • 474 passed • 1 skipped • 1188s
Tests ran across 4 shards in parallel. |
| onSubmit(); | ||
| // Keep the current time range: re-resolving a relative range would | ||
| // refetch the histogram for a column change. | ||
| onSubmit({ resolveTimeRange: false }); |
There was a problem hiding this comment.
🟡 P2 — Toggling a column now submits the drafted query but not the drafted time range
toggleColumn still runs handleSubmit, so any unsubmitted edits to the where/filters fields get applied. With resolveTimeRange: false, a range the user typed into the time input does not get applied. The result is a half-applied search: the time input shows a range that doesn't match the table or histogram. One fix is to skip onSearch only when displayedTimeInputValue still matches the searched range. The other is to also skip the draft where/filters in this path, setting only select/orderBy via setSearchedConfig.
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
Deep ReviewScope: 3 production files ( Both deep reviewers traced the three failure vectors (View Events links, ✅ No critical issues found. Recommended items below. 🟡 P2 -- recommended
🔵 P3 nitpicks (5)
Reviewers (11): correctness, adversarial, testing, maintainability, project-standards, performance, kieran-typescript, frontend-races, previous-comments, agent-native, learnings. 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 |
| // Everything but the table's select and sort can reference an alias, | ||
| // including the body, timestamp and sample-weight expressions. | ||
| with: getReferencedWithClauses(aliasWith, [ | ||
| JSON.stringify({ ...chartConfig, select: '', orderBy: '' }), |
There was a problem hiding this comment.
🟡 P2 — Alias matching runs over the whole config JSON, so many aliases are always kept and the histogram still refetches
getReferencedWithClauses checks whether an alias name appears anywhere in JSON.stringify({...chartConfig, select:'', orderBy:''}) (packages/common-utils/src/core/searchChartConfig.ts). That string always contains the field names (timestampValueExpression, databaseName/tableName, displayType, source, connection, where, select, orderBy, and bodyExpression on log sources) plus the hex ids for the source and connection. So an alias named time, name, type, table, source, body, value or search, or any one-letter alias such as c or a, is always kept. Toggling that column still changes the query key, and the histogram refetches anyway. Fix: build the text only from the parts that can actually reference an alias (where, filters, groupBy, implicitColumnExpression, bodyExpression, timestampValueExpression, the sample-weight expression), and match on identifier boundaries (e.g. (?<![\w.])name(?!\w)) instead of includes.
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
69f52c0 to
b2c7378
Compare
| // Preserve the original table select string for "View Events" links | ||
| // Everything but the table's select and sort can reference an alias, | ||
| // including the body, timestamp and sample-weight expressions. | ||
| with: getReferencedWithClauses(aliasWith, [ |
There was a problem hiding this comment.
🟡 P2 — Histogram still refetches, and briefly loses its alias, on a column toggle when the WHERE uses a table alias
aliasWith comes from useAliasMapFromChartConfig(dbSqlRowTableConfig) (packages/app/src/hooks/useChartConfig.tsx:571). That query is keyed on select and sets no placeholderData, so after a column toggle aliasMap is undefined until the new query finishes. If the search references an alias (e.g. service:api with ServiceName as service), the histogram's with goes from the clause to undefined and back. That runs one query with an unknown identifier and then a second one, which is the refetch this PR is meant to prevent. Fix: keep the previous alias map while the new one loads (placeholderData: keepPreviousData), or memoize the filtered with on the clause contents, not on the aliasWith reference.
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
b2c7378 to
6d64ef5
Compare
6d64ef5 to
a357775
Compare
Summary
The search histogram was rerendering on unnecessary operations, like adding a column or adding an alias. This fixes that.
Screenshots or video
Before
export-1795209359104.mp4
After
export-1795209486556.mp4
References