Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 7c3e6d2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
PR Review
3 finding(s): 🔴 0 critical · 🟠 0 major · 🔵 3 minor 3 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. |
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
[Medium impact] The PR appears safe to merge; no new actionable issues remain. SummarySorts nested filter keys alphabetically while keeping selected and pinned keys first.
Reviews (5) · Last reviewed commit: "Update packages/app/src/components/DBSea..." · Reviewed by Greptile |
Deep Review✅ No critical issues found. This is a small, well-scoped change: a new pure helper 🟡 P2 — recommended
🔵 P3 nitpicks (2)
Reviewers (9): correctness, testing, maintainability, project-standards, kieran-typescript, performance, previous-comments, agent-native, learnings-researcher. 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 • 431 passed • 1 skipped • 1457s
Tests ran across 4 shards in parallel. |
6a351e8 to
5133ebe
Compare
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
| }); | ||
| } | ||
|
|
||
| sortNestedFacetKeys(_facets); |
There was a problem hiding this comment.
🔵 minor — Nested groups in the Shared Filters section are still unsorted
sortNestedFacetKeys only runs inside shownFacets. sharedFacets (line 1296) is built in sharedFilterKeys insertion order and passed to the same renderFacetList (line 1779), so a team-pinned LogAttributes group lists its keys in pin order while the same group under Filters lists them A–Z. Call sortNestedFacetKeys on the sharedFacets result too, or do the sort inside renderFacetList before the priority ordering so both sections get it.
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
| groupOrder.set(baseName, groupOrder.size); | ||
| } | ||
| } | ||
| facets.sort((a, b) => { |
There was a problem hiding this comment.
🔵 minor — Comparator re-parses both keys on every comparison
parseMapFieldName (which calls cleanClickHouseExpression, two regexes and parseKeyPath) runs twice per comparison, so about 2·n·log n times. shownFacets recomputes on every filterState change (every checkbox click), and hooks.ts:148 always includes every Map/JSON sub-field, so n can be large. Parse each key once, e.g. build a Map<key, parsed> in the first loop and read from it in the comparator.
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
| }); | ||
| }); | ||
|
|
||
| describe('sortNestedFacetKeys', () => { |
There was a problem hiding this comment.
🔵 minor — Test doesn't cover the ordering the changeset promises or toString()-wrapped JSON keys
The test only calls the helper on its own. The changeset says alphabetical keys come after keys with a selected value and pinned keys, which depends on the later stable sorts in DBSearchPageFilters.tsx:1373-1407. Nothing checks that, so moving the call below those sorts would still pass. JSON keys are also rewritten to toString(...) at line 1335, and the test has none. Add a case with toString(...) keys, and a component-level or extracted test showing that a checked or pinned child still sorts ahead of A–Z children in its group.
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
Sorts keys in NestedFilterGroups alphabetically.
Screenshots or video
Before
After
References