Repository navigation
feat: Add support for filter by parsed JSON string - #1213
Conversation
🦋 Changeset detectedLatest commit: 9cfc42e The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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.
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for filtering by parsed JSON string values in the database row JSON viewer. The enhancement allows users to interact with nested properties within JSON strings that have been parsed for display, enabling filtering, searching, and charting operations on these nested values.
Key changes:
- Extended the HyperJson component to track parsed JSON context and root paths
- Modified line action handlers to generate appropriate JSONExtractString queries for parsed JSON properties
- Added new optional parameters to track when content is within parsed JSON and its root path
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| packages/app/src/components/HyperJson.tsx | Added isInParsedJson and parsedJsonRootPath parameters to track parsed JSON context throughout the component hierarchy |
| packages/app/src/components/DBRowJsonViewer.tsx | Updated line action handlers to generate JSONExtractString queries for parsed JSON properties in filters, search, chart, and column operations |
| .changeset/young-tools-sneeze.md | Added changeset entry documenting the new feature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| // Build JSONExtractString query for the nested path | ||
| const baseColumn = | ||
| parsedJsonRootPath[parsedJsonRootPath.length - 1]; | ||
| const jsonPathArgs = nestedPath.map(p => `'${p}'`).join(', '); |
There was a problem hiding this comment.
The JSON path argument construction logic is duplicated in multiple places. Consider extracting this into a helper function to reduce code duplication and improve maintainability.
| if (nestedPath.length > 0) { | ||
| const baseColumn = | ||
| parsedJsonRootPath[parsedJsonRootPath.length - 1]; | ||
| const jsonPathArgs = nestedPath.map(p => `'${p}'`).join(', '); |
There was a problem hiding this comment.
The JSON path argument construction logic is duplicated in multiple places. Consider extracting this into a helper function to reduce code duplication and improve maintainability.
| if (nestedPath.length > 0) { | ||
| const baseColumn = | ||
| parsedJsonRootPath[parsedJsonRootPath.length - 1]; | ||
| const jsonPathArgs = nestedPath.map(p => `'${p}'`).join(', '); |
There was a problem hiding this comment.
The JSON path argument construction logic is duplicated in multiple places. Consider extracting this into a helper function to reduce code duplication and improve maintainability.
| if (nestedPath.length > 0) { | ||
| const baseColumn = | ||
| parsedJsonRootPath[parsedJsonRootPath.length - 1]; | ||
| const jsonPathArgs = nestedPath.map(p => `'${p}'`).join(', '); |
There was a problem hiding this comment.
The JSON path argument construction logic is duplicated in multiple places. Consider extracting this into a helper function to reduce code duplication and improve maintainability.
E2E Test Results✅ All tests passed • 21 passed • 3 skipped • 156s
|
Resolves HDX-1983 <img width="646" height="242" alt="image" src="https://github.com/user-attachments/assets/376c0e02-73b9-49e3-96f8-ebb3475a7e82" />
Resolves HDX-1983