fix: discard without snapshots, move SLI to settings, fix version table#67
fix: discard without snapshots, move SLI to settings, fix version table#67TerrifiedBug merged 3 commits intomainfrom
Conversation
…le columns - Make discard changes work for versions without snapshots (restores globalConfig only, skips node/edge restore gracefully) - Remove SLI health badge from toolbar to reduce clutter; add per-SLI health status indicators (green/red dot) in Settings > Health SLIs - Fix version history table header overlap caused by max-w-0 on the Changelog column; move truncation to cell content instead
Greptile SummaryThis PR addresses three independent bug fixes in the pipeline editor: graceful handling of pre-snapshot
Confidence Score: 4/5
Last reviewed commit: e1fd3c2 |
| const healthQuery = useQuery( | ||
| trpc.pipeline.health.queryOptions( | ||
| { pipelineId }, | ||
| { enabled: slis.length > 0, refetchInterval: 30_000 }, | ||
| ), |
There was a problem hiding this comment.
Health query fires on draft/undeployed pipelines
The original toolbar version of this query guarded with !isDraft && !!deployedAt before enabling the health endpoint. The new SliSettings component only checks slis.length > 0, so if a pipeline has SLIs configured but has never been deployed (or is still a draft), this query will fire and likely return an error or empty payload from the server.
The UI handles the missing data gracefully (healthQuery.data?.slis ?? []), so there's no crash — but it will generate unnecessary failed requests every 30 seconds as long as the Settings panel is open.
Consider passing isDraft and deployedAt into SliSettings and mirroring the original guard:
| const healthQuery = useQuery( | |
| trpc.pipeline.health.queryOptions( | |
| { pipelineId }, | |
| { enabled: slis.length > 0, refetchInterval: 30_000 }, | |
| ), | |
| const healthQuery = useQuery( | |
| trpc.pipeline.health.queryOptions( | |
| { pipelineId }, | |
| { enabled: slis.length > 0 && !isDraft && !!deployedAt, refetchInterval: 30_000 }, | |
| ), | |
| ); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/components/flow/pipeline-settings.tsx
Line: 334-338
Comment:
Health query fires on draft/undeployed pipelines
The original toolbar version of this query guarded with `!isDraft && !!deployedAt` before enabling the health endpoint. The new `SliSettings` component only checks `slis.length > 0`, so if a pipeline has SLIs configured but has never been deployed (or is still a draft), this query will fire and likely return an error or empty payload from the server.
The UI handles the missing data gracefully (`healthQuery.data?.slis ?? []`), so there's no crash — but it will generate unnecessary failed requests every 30 seconds as long as the Settings panel is open.
Consider passing `isDraft` and `deployedAt` into `SliSettings` and mirroring the original guard:
```suggestion
const healthQuery = useQuery(
trpc.pipeline.health.queryOptions(
{ pipelineId },
{ enabled: slis.length > 0 && !isDraft && !!deployedAt, refetchInterval: 30_000 },
),
);
```
How can I resolve this? If you propose a fix, please make it concise.Return partial flag from discardChanges so the frontend can distinguish full restore (with snapshots) from partial (globalConfig only). Shows a toast explaining node configs weren't restored and to redeploy for full discard support.
…-snapshot versions
Summary
max-w-0on the Changelog columnTest plan