Repository navigation
Conversation
🦋 Changeset detectedLatest commit: ed42b33 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.
|
E2E Test Results✅ All tests passed • 414 passed • 1 skipped • 1225s
Tests ran across 4 shards in parallel. |
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
Knip - Unused Code Analysis🔴 1 issue found Unused exports (1)
Knip finds unused files, dependencies, and exports in your codebase. |
|
| queryKey: [ | ||
| 'adhoc-filter-keys', | ||
| source.id, | ||
| start, | ||
| end, | ||
| isFieldMetadataDisabled, | ||
| ], |
There was a problem hiding this comment.
Suggestions show the old table
Both suggestion query keys use source.id without the connection or table settings. Editing a source keeps its ID and only refreshes sources, so reopening the editor with the same time range can show columns and values from the old table for five minutes. Users may pick columns that no longer exist. Include the source settings in both query keys, or clear both caches when the source changes.
| const setAdhocConditions = useCallback( | ||
| (filterId: string, conditions: AdhocFilterCondition[]) => { | ||
| setFilterValueEntries(prev => { | ||
| const target = filters.find(f => f.id === filterId); | ||
| const name = target && getFilterVariableName(target); | ||
| if (!name) return prev; | ||
|
|
||
| const parsed = parseDashboardFilterValues(prev ?? []); | ||
| parsed.byVariable.set(name, { | ||
| type: 'adhoc', | ||
| conditions: uniqConditions(conditions), | ||
| }); | ||
| return rebuildEntries(filters, parsed); | ||
| }); | ||
| }, | ||
| [setFilterValueEntries, filters], | ||
| ); |
There was a problem hiding this comment.
This change grows useDashboardFilters.tsx from 294 to 350 lines, crossing the guide's required 300-line limit for non-test files. This requirement must be satisfied before merging. Move rebuildEntries and its supporting helpers into a sibling module to keep the hook below the limit.
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
TODO: re-use existing metadata hooks in useAdhocFilterValues
Screenshots or video
How to test on Vercel preview
Preview routes:
Steps:
References