feat(signals): Modify menu + dotted-field grammar#215
Merged
Conversation
Two coupled changes on the Signals page query builder: Modify menu (UX): the always-visible chip row was reading as one long sentence with five optional knobs (breakout, rollup, reject, fill, label) crowded next to the core `Show <agg> of <field> where ...`. Collapses to: Show <agg> of <field> where <filters> [+ Modify ▾] with each modifier described in the dropdown before you add it: Group by name Split results into one series per signal name Rollup interval Override the automatic bucket width Reject outliers Drop raw samples by value or sigma before aggregating Fill empty buckets Choose what to show when a bucket has no data Name series Label the result so axis controls / expressions can refer to it Once added, each modifier renders inline as a removable clause; once removed, it returns to the menu. Dotted-field grammar: aggregator fields now read `signal.name` / `signal.value` / `signal.raw_value` instead of bare `signal` / `value` / `raw_value`. Filter columns stay bare (`where name = "x"`) — once inside a where clause the `signal.` namespace is redundant. Reject metrics follow the aggregator: `signal.value` / `signal.raw_value` are dotted, computed `sigma` stays bare. Hard cutover — the bare form errors out cleanly. Both the TS parser/serializer and the Python parser learn the new shape; the executor strips the `signal.` prefix when going from MQL to ClickHouse column names via a small _column() helper. Also: removed all test files + test infrastructure across the repo (vitest in dashboard, pytest in query / mapache-py / rigby) and the matching CI Test jobs. Per project convention this repo doesn't carry automated tests.
- Renames the bucket-width method from `.every(...)` to `.rollup(...)`
in both parsers (TS + Python) and in the serializer. The reverse
migration helper (`{ rollup: "every" }` → unknown-method error) is
gone; this is a new system, no need to carry the migration stub.
- "Name series" comes out of the Modify menu and becomes an always-
visible labeled `Input` above the chip row. It's hidden while
breaking out by name, since `-> name` is mutually exclusive with
`.by(name)`. Deletes the LabelChip + its useEffect-driven popover
draft handling.
- Modify menu now has 4 entries: by / rollup / reject / fill, each
still showing a one-line description.
Restructures the chip row from the sentence form ("Show <agg> of
<field> where <filters> …") to Datadog's left-to-right layout:
[Signal] from [filter chips] [+ filter] | avg of signal.value
[optional modifiers: by name / rollup / reject / fill] Σ
- Source pill ("Signal") anchors the left edge.
- Filters cluster behind a `from` keyword, mirroring Datadog's
`from $service x` tag list.
- Vertical hairline separates filters from the aggregator/field block.
- Modifier chips render inline only when set; the function menu (Σ)
sits flush-right.
- "+ Modify" button becomes a Σ icon button, matching Datadog's
"Apply a function" affordance.
- Drops the now-unused Clause helper.
The "Name series" input above the row stays put — Datadog doesn't
need an equivalent because its metric names are unique by construction,
but Mapache derived expressions need a referenceable variable name.
User-facing renames; internal Reject* type names stay the same since they describe the AST shape (sigma comparison, value range, boolean tree) regardless of what the keyword is called. - MQL grammar: `.reject(...)` becomes `.filter(...)` in both parsers and the serializer. Error messages updated to match. No migration stub. - UI: the `reject` keyword in the inline clause and the Modify menu becomes `filter`. - The existing `+ filter` button on the signal-name chip cluster now reads `+ signal`, since `filter` is now claimed by the outlier- rejection clause. The chip cluster itself is what selects signals by name, so `signal` is the more direct label. Docstring examples updated to the new keywords + the dotted-field grammar that landed earlier.
Widget header used to carry 4-5 icon buttons crammed in the top-right
(chart-type, optional map toggle, optional export, hide, delete) with
mixed semantics — chart content vs widget operations competing for the
same corner.
- Widget-level operations collapse into a single MoreVertical kebab:
Export · Show/Hide map · Show/Hide chart · ── · Delete (destructive,
styled accordingly).
- ChartTypeSelect ("Bar ▾") drops out of the header and lands at the
top of CardContent, just above the canvas. Conceptually it's a
chart-content choice (what to draw), not a widget operation, so it
belongs with the chart-content controls.
- Header now reads "title / metadata · ⋮" — Datadog-shaped.
The chip-builder row already carries its own inline-editable MQL line at the bottom, so the global mode swap to a single-textarea editor was duplicate surface. Removes the toggle button + the `editAsMql` state + the `MqlEditor` import. The `textToQueries` helper from the same module is still used elsewhere so the module itself stays.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modify menu
Replaces the always-visible chip row of optional modifiers (breakout, rollup, reject, fill, label) with a Datadog-style + Modify ▾ dropdown that describes each option before you add it.
The always-visible part collapses to the core sentence:
The menu lists every modifier not already on the query, with a one-line description per entry. Once added, each modifier renders inline as a removable clause; the ❌ on the clause returns it to the menu.
Menu entries:
Dotted-field grammar
Aggregator fields are now explicit dotted references onto a signal row:
Filter columns stay bare — `where name = "ecu*"` — since the `signal.` namespace is redundant once you're inside a where clause.
Hard cutover: the parser only accepts the new dotted form. Both the TS parser/serializer and the Python parser learn the new shape. The executor maps `signal.value` back to the underlying ClickHouse column via a small `_column()` helper, so the SQL plan is unchanged.
Tests removed
All test files and test infrastructure deleted across the repo (vitest in dashboard, pytest in query / mapache-py / rigby), along with the corresponding CI Test jobs in `.github/workflows/query.yml` and `.github/workflows/mapache-py.yml`. Per project convention this repo doesn't carry automated tests.