Skip to content

fix: show save button in VRL snippet form#17

Merged
TerrifiedBug merged 5 commits intomainfrom
fix/snippet-save-button
Mar 5, 2026
Merged

fix: show save button in VRL snippet form#17
TerrifiedBug merged 5 commits intomainfrom
fix/snippet-save-button

Conversation

@TerrifiedBug
Copy link
Owner

Summary

  • Hide snippet list when creation/edit form is open so Cancel/Create buttons are visible
  • The overflow-hidden container was clipping the buttons below the max-h-64 boundary

Test plan

  • Click + to open snippet form, verify Cancel/Create buttons are visible
  • Fill in name + code, click Create, verify snippet is saved
  • Click Cancel, verify snippet list reappears

Hide the snippet list when the creation form is open so the
Cancel/Create buttons aren't clipped by the container overflow.
Use dev-<sha> version string in Docker agent builds to match the
binary release format, enabling proper version detection in the
fleet UI. The image still uses a single rolling 'dev' tag.
@greptile-apps
Copy link

greptile-apps bot commented Mar 5, 2026

Greptile Summary

This PR fixes a long-standing UX bug in the VRL snippet drawer where the Cancel/Create buttons were invisible because the max-h-64 overflow-hidden container clipped content below the fold. The fix is clean: the height constraint is removed when showForm is true, and the snippet list (ScrollArea) is unmounted while the form is open so both panels never compete for the same constrained space.

The PR also bundles two legitimate improvements:

  • Environment selector (environment-selector.tsx): new handleEnvironmentChange redirects users from detail pages (e.g., /pipelines/<id>) back to the corresponding list page when they switch environments, preventing stale detail views.
  • Pipelines page + dashboard router: Math.max(0, ...) added to both the frontend getReductionPercent helper and the server-side stats query to prevent negative reduction values being displayed for amplifying pipelines.
  • CI/workflows: Agent image dev-build version now includes short SHA (dev-${GITHUB_SHA::7}), consistent with the dev-binaries job for easier build correlation.

Confidence Score: 5/5

  • This PR is safe to merge — it's a focused UI fix with no security, data integrity, or API contract implications.
  • All changes are purely presentational (height constraint / conditional rendering) or cosmetic number-clamping. No new tRPC procedures, no schema changes, no mutations added, and no middleware is bypassed. The environment selector redirect only pushes to hardcoded paths. No files require special attention.
  • No files require special attention

Important Files Changed

Filename Overview
src/components/flow/vrl-snippet-drawer.tsx Core fix: conditionally removes max-h-64 overflow-hidden when the form is open and unmounts ScrollArea while the form is visible, ensuring Cancel/Create buttons are never clipped. Logic is correct.
src/components/environment-selector.tsx Adds handleEnvironmentChange to redirect users from detail pages back to their list page when the environment is switched. Implementation is functionally correct and prevents stale detail views.
src/app/(dashboard)/pipelines/page.tsx Clamps getReductionPercent to a minimum of 0 to prevent negative display values for amplifying pipelines; purely presentational fix with no logic regressions.
src/server/routers/dashboard.ts Mirrors the frontend clamping change server-side in the stats procedure; correctly guarded by withTeamAccess("VIEWER") middleware and no new procedures are introduced.
.github/workflows/ci.yml Agent image dev-build version appends the short SHA (dev-${GITHUB_SHA::7}), improving build correlation with the dev-binaries job.

Last reviewed commit: 35bbe81

When sinks retry failed events, eventsOut can exceed eventsIn,
producing negative reduction values like -201%. Clamp to 0%.
When changing environment while viewing a pipeline editor or fleet
detail page, redirect to the parent list page to avoid showing
stale data from a different environment.
Apply max-h-64 and overflow-hidden only when browsing snippets.
When the form is open, remove constraints so buttons are visible.
@TerrifiedBug TerrifiedBug merged commit 7687e6d into main Mar 5, 2026
10 checks passed
@TerrifiedBug TerrifiedBug deleted the fix/snippet-save-button branch March 5, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant