feat: show rule-based trends in ResultGrid - #613
Merged
Merged
Conversation
Web Console deploy preview
|
A row rule counts as a match for every cell of its row, so the first matching rule in the list wins per cell. A row rule listed first paints the whole row; a cell rule listed first keeps its cell and the row rule fills the rest. Schema and prompt describe the same order. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The drawer shell keeps its nodes for a slide-out before unmounting, and both drawers let the shell own visibility. A maximize or restore remounts the cell, so the open state and the unsaved draft (rules, expanded rule, chart config) live in a per-cell session store and come back in place without replaying the entrance. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Row rule listed after a matching cell rule on the same column now paints the rest of the row - Between bounds accept auto (null): the engine reads the column's current min/max on every result; new between rules default to auto - Text equality ignores case like contains; previous-result rules compare timestamps as instants - Wire default unit is percent like the drawer; wire rejects a flat gradient and a reversed range - Trend store moves into NotebookProvider behind ResultTrendContext, so maximize/restore keeps the baseline - Trend capture has one writer, run from the cells store before render; the grid only reads - Field validation lives once in the engine and serves the drawer and the wire; loaded configs pass a deep structural guard - ResultGridPanel event-bus effect gets deps; the highlight drawer writes its draft from setters; the tool reports its own AI status Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A `newRow` rule paints the whole row of a row whose identity key was not in the previous result. It carries only a color and a display, needs no column, and defaults to a flash. The drawer offers it as "new row" under the previous-result conditions and hides the column and applies-to fields for it. The condition select no longer waits for a column; a missing column is flagged on Save. The agent wire, tool schema, prompt, structural guard, and shared field validation cover the new kind. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A step now carries `from` and a value takes the highest step it reaches; the rule's base color covers values below the lowest step. This matches threshold lists elsewhere. The editor shows the base line first, then each step as ">= N". The wire uses `steps[].from` and `base_color`. The old shape is dropped on load by the structural guard; no migration. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- test each regex match from the start, so g and y no longer skip rows - keep no trend rows for released cells or cells without comparison rules - reject agent rules that the load check would drop on reload - offer highlight rules only when the active result renders a grid Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Match regex rules with RE2 so no pattern can stall the grid; validation, the AI wire, the schema and the prompt describe the RE2 dialect - Read zone-less timestamp bounds as UTC, in the engine and in validation - Treat DECIMAL(p,s) columns as numeric - Time flashes from the result capture, so late-mounted cells do not replay - Close drawer sessions on the view toggle, the mode change and cell delete - Signal a user edit on highlight save and clear for the AI stale gate - Cover persistence, import, buildAppliedCells and multi-statement capture - Route chart draft edits through one updater instead of an effect - Drop the unused inline variant and props from SearchableSelect - Add Given/When/Then markers to the new tests Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Keeps the query key in queryKey.ts and pins capitalize: false there, so saved grid layouts keep their hash whatever the keyword-casing setting is. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Key the trend baseline by the effective SQL, never baseline a truncated snapshot, and bring a discarded run back to the result it replaced. Keep a released statement's baseline for its rehydrate, time a restored result from its save, and start over when a run lands on a released cell. Make the sliding-out drawer inert, close it when the assistant changes the rules, and control the threshold and step inputs so Save flags bad values. Accept only ISO timestamps, compare instants at full precision, clamp a gradient with one automatic bound at its fixed end, and compare array cells by content. Offer per column kind only the conditions that can match. Load re2js on demand, evaluate rows on first lookup, paint the flash as a layer over a pinned cell's opaque base, and keep the flash delay per result. Escape angle brackets in the prompt JSON so rules copy back unchanged. Drop the test-only parameters, the alpha field and the unused helpers. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Highlight engine - Compare fractional DECIMAL past double precision as scaled bigints; =, >, > previous and changedBy now see a change at the 18th decimal - Report an unmatched quote on a bound instead of saving a rule that never matches; one quotes helper for the evaluator and the validator Drawers - Kebab entries only open a drawer; the spotlight gear toggles, so a second menu pick keeps the open draft - A save that waits on the regex engine is dropped after a dismiss, shows a spinner, and saves the draft as edited during the wait - Chart settings OPEN telemetry fires on a real open only; the gear close reports a cancel - Overlay slot is the first wrapper child, so grid layout grows the editor again Agent tools - Validate wire rules against the columns the cell has shown; a cell whose SQL the request rewrites is checked loosely - A /…/flags pattern saves as plain RE2 and the result notes how it reads, pointing at (?i) - Schema and prompt: high-scale numbers as strings, no regex flags Trend store - A discarded run restores the prior result with its landing time and keeps its statement keys until the run settles, so nothing reflashes Tests - e2e: kebab keeps highlight and chart drafts; toast text updated Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…s, snapshot columns) - changedBy compares as decimals so a change of exactly the threshold matches - agent tools check rules against the snapshot columns of a released cell - duplicate-key warning follows the draft identity in the drawer - Enter on an empty picker search keeps the selection - drawers take focus on open and return it to the opener on close - one useSettingsDrawerSession hook for chart and highlight drawers Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
Author
Review: PR #613 "feat: show rule-based trends in ResultGrid"Reviewed at level 3. Head Issues
Adjacent findings (not blocking — file as issues)None proved. SummaryVerdictApprove with comments. Please address these Moderate items before merge:
Gates
Distribution
Regressions and tradeoffs
PR titleThe title follows Conventional Commits. It names an internal component and omits the custom refresh intervals. Suggestion: |
emrberk
marked this pull request as ready for review
September 30, 2026 10:01
mtopolnik
approved these changes
Sep 30, 2026
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.
Highlight rules for notebook result grids
Result grids in notebook cells can now color cells and rows by rule, so a notebook can serve as a live dashboard: watchlists that flash on price moves, threshold breaches that stay colored, heatmap columns, and event tapes that flash new rows.
What you can do
symbolandside. Then use> previous,< previous,changed, orchanged by at leastan absolute or percent amount. Matching cells flash, and> previous/< previousshow a ▲ or ▼ glyph. Timestamps compare as instants.>,≥,<,≤,=,between,is null,contains, andmatchesa regular expression. Text comparisons ignore case. A rule can target one column or all numeric columns.betweenrule with the gradient fill shades every cell of the column from one color at the low bound to another at the high bound, mixed in between and clamped beyond the ends. Leave a bound empty for auto: it follows the column's current minimum or maximum on every refresh, so a heatmap column keeps its full spread as data moves.Custom auto-refresh intervals
Auto-refresh is no longer limited to five presets. A cell or a notebook can poll at any fixed interval from 50ms to 60m.
250ms,500ms,1s,5s,10s,30s,1m, next to Auto and Off.ms,sorm), for example750msor15m, and press Enter. Spaces and case do not matter. A value outside 50ms–60m shows a hint and is not applied. A custom interval in use appears in the menu as a checked option.Behavior that follows the interval
Fast intervals need a different UI from a 30s dashboard, so several things now scale with the cell's effective interval (the cell override, or the notebook default):
changedrule at 250ms flashes for 200ms, so each tick reads on its own instead of merging into one long highlight.Agent and MCP
The assistant and the MCP bridge can set or clear a cell's rules with
set_cell_highlight_config, andapply_notebook_statecarrieshighlight_configper cell. Notebook snapshots include the rules.set_cell_autorefresh,set_notebook_autorefreshand theauto_refresh/auto_refresh_defaultfields ofapply_notebook_stateaccept any interval matching^[1-9][0-9]*(ms|s|m)$within 50ms–60m, in place of the previous enum. Validation errors name the accepted form.Also in this PR
🤖 Generated with Claude Code