feat: Render static value list filter inputs - #3022
Conversation
🦋 Changeset detectedLatest commit: 24da881 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.
|
Greptile SummaryThis PR displays static-list dashboard filters, preserves their authored option order, and exposes selected values to tiles as variables.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/app/src/DashboardFilters.tsx | Renders queried and static filters through the merged values hook, preserves static option order, and keeps linking limited to queried filters. |
| packages/app/src/hooks/useDashboardFilterValues.tsx | Splits filters by type, merges their value maps, and prevents empty queried-filter loading state from affecting static-only dashboards. |
| packages/app/src/hooks/useStaticDashboardFilterValues.tsx | Exposes static options synchronously with stable non-loading and non-error state. |
| packages/app/src/components/VirtualMultiSelect/VirtualMultiSelect.tsx | Adds an opt-out from alphabetical sorting so authored static-list order can be retained. |
| packages/app/tests/e2e/features/dashboard-static-filters.spec.ts | Covers authored option order, tile variable filtering, and URL-backed selection persistence. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
D[Dashboard filter definitions] --> T{Filter type}
T -->|Query expression| Q[Query available values]
T -->|Static list| S[Use authored options]
Q --> M[Merged values by filter ID]
S --> M
M --> U[Dashboard filter dropdown]
U --> V[URL-backed selection]
V --> C[Chart variable]
C --> R[Tile query rendering]
Reviews (2): Last reviewed commit: "feat: Display static value filters" | Re-trigger Greptile
E2E Test Results✅ All tests passed • 326 passed • 1 skipped • 1013s
Tests ran across 4 shards in parallel. |
b2ce038 to
24da881
Compare
| }; | ||
|
|
||
| /** Dropdown values for a dashboard's filters. */ | ||
| export function useDashboardFilterValues({ |
There was a problem hiding this comment.
The intention is that this will be a "router" hook that partitions filters by type, delegates to type-specific hooks that fetch values for the type, and then merges the results.
This should make it more straightforward to add new filter types in the near future.
🔵 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
|
Deep Review✅ No critical issues found. This is a small, well-tested, cleanly-typed change; the router-hook design matches the reviewer intent raised on the PR, and prior feedback is addressed. The items below are recommendations and nits. 🟡 P2 -- recommended
🔵 P3 nitpicks (5)
Agent-native note: This PR introduces no parity gap -- reading static options and selecting values already work over MCP (via the serialization schema and Reviewers (10): correctness, adversarial, testing, maintainability, project-standards, kieran-typescript, julik-frontend-races, agent-native, learnings-researcher, previous-comments. Testing gaps:
|
Summary
This PR extends support for static custom value filters (introduced in #3017) by showing such filters in the UI and exposing selected options as variables.
Followup work includes:
Screenshots or video
How to test locally
Importable Dashboard
{ "version": "0.1.0", "name": "Test Static Filters", "tiles": [ { "id": "bd61ewiiu2fs52pkhwe9u", "x": 0, "y": 10, "w": 8, "h": 10, "config": { "name": "", "source": "Logs", "displayType": "line", "granularity": "auto", "alignDateRangeToGranularity": true, "select": [ { "aggFn": "count", "aggCondition": "", "aggConditionLanguage": "lucene", "valueExpression": "" } ], "where": "", "whereLanguage": "lucene" } }, { "id": "hmlgrh1me14q19ewy9pci", "x": 8, "y": 10, "w": 8, "h": 10, "config": { "name": "", "source": "Demo Logs", "displayType": "line", "granularity": "auto", "alignDateRangeToGranularity": true, "select": [ { "aggFn": "count", "aggCondition": "", "aggConditionLanguage": "lucene", "valueExpression": "" } ], "where": "", "whereLanguage": "lucene" } }, { "id": "7jwjomsz0pdmigm0kyorgp", "x": 0, "y": 0, "w": 9, "h": 10, "config": { "displayType": "table", "granularity": "auto", "alignDateRangeToGranularity": true, "configType": "sql", "sqlTemplate": "SELECT $env", "connection": "Local ClickHouse", "source": "Logs", "name": "Selected $env values" } } ], "filters": [ { "id": "6a91d80f1e4e008c07f1c411", "name": "ServiceName (Traces)", "type": "QUERY_EXPRESSION", "expression": "ServiceName", "source": "JSON Traces" }, { "id": "6a91d7081e4e008c07f1c265", "name": "Environment", "variableName": "env", "type": "STATIC_LIST", "options": [ "dev", "staging", "prod" ], "isBroadcastEnabled": false, "isVariableEnabled": true }, { "id": "6a91d7af1e4e008c07f1c35d", "name": "Status (Traces)", "type": "QUERY_EXPRESSION", "expression": "StatusCode", "source": "JSON Traces" }, { "id": "7ca33140-cdfc-4434-bd29-62782c7aa3b0", "name": "Severity", "variableName": "Severity", "type": "QUERY_EXPRESSION", "expression": "SeverityText", "source": "Demo Logs", "appliesToSourceIds": [ "Demo Logs", "Demo Traces" ], "isBroadcastEnabled": true, "isVariableEnabled": true } ], "containers": [] }References