Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .changeset/thin-pets-relate.md

This file was deleted.

13 changes: 0 additions & 13 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,6 @@ and lint issues across all packages. Pre-commit hooks handle this when
committing, but if you finish edits without committing, run `yarn lint:fix`
before stopping.

## Before Writing New Utility Functions

Before implementing a new parsing, formatting, or transformation function,
search for existing functions that already do the same thing or something close.
Common places to check:

- `packages/common-utils/src/core/metadata.ts` — key/column parsing utilities
(e.g. `parseKeyPath`)
- `packages/common-utils/src/queryParser.ts` — Lucene parsing (`parse`,
`decodeSpecialTokens`), AST type guards, serialization helpers
- `packages/common-utils/src/filters.ts` — filter state serialization and
parsing (`filtersToQuery`, `parseLuceneFilter`)

## Key Principles

1. **Multi-tenancy**: All data is scoped to `Team` - ensure proper filtering
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/utils/zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export type ExternalDashboardFilter = z.infer<
>;

export const externalDashboardSavedFilterValueSchema = z.object({
type: z.enum(['sql', 'lucene']).optional().default('sql'),
type: z.literal('sql').optional().default('sql'),
condition: z.string().max(10000),
});

Expand Down
20 changes: 5 additions & 15 deletions packages/app/src/ChartUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ import {
getAlignedDateRange,
Granularity,
} from '@hyperdx/common-utils/dist/core/utils';
import {
type FilterState,
filtersToQuery,
} from '@hyperdx/common-utils/dist/filters';
import { isBuilderChartConfig } from '@hyperdx/common-utils/dist/guards';
import {
AggregateFunction as AggFnV2,
Expand Down Expand Up @@ -927,19 +923,13 @@ export function buildEventsSearchUrl({

// Add group-by column filters
if (groupFilters && groupFilters.length > 0) {
const filterState: FilterState = {};
for (const { column, value } of groupFilters) {
groupFilters.forEach(({ column, value }) => {
if (column && value != null) {
if (!filterState[column]) {
filterState[column] = {
included: new Set(),
excluded: new Set(),
};
}
filterState[column].included.add(String(value));
// Can't use SQLString.escape here because the search endpoint relies on exist match for UI
const condition = `${column} IN (${SqlString.escape(value)})`;
additionalFilters.push({ type: 'sql', condition });
}
}
additionalFilters.push(...filtersToQuery(filterState));
});
}

// Add Y-axis value range filter (±threshold) for charts
Expand Down
Loading
Loading