Repository navigation
feat(app): edit chart alerts in a docked side panel - #3222
Conversation
The alert form sat inline between the series editor and the Save bar, which pushed the preview chart below the fold and made it hard to tune a threshold against the chart. The alert now lives in a panel docked beside the editor, so the chart stays in view while it is edited. - "Add alert" / "Edit alert" beside Add series opens the panel. A new alert is a draft until "Add alert" confirms it; closing discards it. Editing an existing alert keeps changes with "Update alert"; closing reverts them. "Create alert" saves an inline alert on the chart explorer. - The panel opens on request, except in the edit-alert modal, and reopens when a save fails on the alert. - The panel fills the height of the area it scrolls in (measured, so it fits centered modals and pages) and can be resized from its left edge. - Save and Cancel move to the chart name row.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: a90a655 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 |
[Medium impact] The PR appears safe to merge with a non-blocking issue in how alert confirmation shows errors.
|
E2E Test Results✅ All tests passed • 428 passed • 1 skipped • 1468s
Tests ran across 4 shards in parallel. |
# Conflicts: # packages/app/src/components/DBEditTimeChartForm/ChartEditorControls.tsx # packages/app/src/components/DBEditTimeChartForm/EditTimeChartForm.tsx
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
This comment has been minimized.
This comment has been minimized.
Removing an alert unmounts the side panel along with its discard control, so unlike other alert edits the removal could only be undone by cancelling the whole chart edit. Ask first with useConfirm.
🔴 Tier 4 — CriticalTouches authentication, tenancy data models, the public API or shipped database config — or substantially changes the query rendering engine, background tasks, the OTel pipeline, image build, or release CI. Why this tier:
Review process: Deep review from a domain expert. Synchronous walkthrough may be required. Stats
|
PR Review
3 finding(s): 🔴 0 critical · 🟠 1 major · 🔵 2 minor 2 posted as inline comment(s) on the changed lines. 1 listed below. Findings outside the changed lines1 minor
Severity is the reviewer's own estimate and is used for ordering, not filtering. No finding blocks merge automatically; a maintainer decides. |
Deep Review✅ No critical issues found. This is a careful, well-tested frontend refactor: the draft/confirm/revert state machine, panel lifecycle ( 🟡 P2 — recommended
🔵 P3 nitpicks (2)
Reviewers (10): correctness, adversarial, testing, maintainability, project-standards, kieran-typescript, frontend-races, previous-comments, agent-native, learnings. Testing gaps:
No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
…osed The alert's error and warning badges render in the side panel, which an existing alert opens closed, so an edit that broke the alert showed nothing. Mirror them on the alert button with an icon and tooltip. Also clear alert errors when the panel's changes are discarded, so a new draft or a reverted alert doesn't show errors from a failed confirm.
The edit-alert modal saves its alert by saving the chart, but the panel's "Update alert" only closed the panel, which also let alert errors from the save land in a closed panel. There the panel action now reads "Save alert" and saves. Also drop the raw gray color from the alert button, and replace a TileAlertEditor test that read as if closing the panel keeps edits.
Summary
The chart editor's alert form now opens in a side panel docked beside the editor, so the preview chart stays in view while you tune the alert.
Before, the alert form sat inline between the series editor and the Save bar. It pushed the preview chart below the fold, so checking a threshold against the chart meant scrolling back and forth.
useResizablegains optional bounds for this. Existing callers are unchanged.Screenshots or video
How to test on Vercel preview
N/A. The alert button is hidden in local mode, so the preview build can't show the panel.
Testing
AlertPanel,ChartSaveActions, theTileAlertEditorpanel behavior, and theuseResizablebounds.DBEditTimeChartFormflows: discarding a draft, update vs revert, reopening after a failed save.maintoo (the picked webhook ends up empty), so it's not fixed here.References
🤖 Generated with Claude Code