Skip to content

fix(dashboard): restore backfill controls in risk-policy progress sheet#2918

Open
mfbx9da4 wants to merge 2 commits into
mainfrom
da/restore-policy-backfill-ui
Open

fix(dashboard): restore backfill controls in risk-policy progress sheet#2918
mfbx9da4 wants to merge 2 commits into
mainfrom
da/restore-policy-backfill-ui

Conversation

@mfbx9da4
Copy link
Copy Markdown
Contributor

Why

The risk-policy progress sheet was meant to ship with two backfill controls:

  • Backfill last N — Input + button (sends a positive limit)
  • Backfill all messages — sends limit=0 to drain everything

They were added in #2889 (`feat(risk): default to recent-N drain; opt-in full backfill`, merged 2026-05-18T12:01Z) and reached prod with sha-b8ed614. They were then inadvertently dropped 45 minutes later when #2855 (`feat(risk): normalize risk_result rule_id + description across scanners`) squash-merged.

Root cause: while merging `origin/main` (which had just received #2889) into the #2855 branch, merge commit `fb4377b02` reported a conflict in `PolicyCenter.tsx`. The resolution kept the branch's pre-#2889 footer, silently restoring the single "Trigger Analysis" button. The branch was squash-merged from that state, so main lost the backfill UI even though the wire format and backend `limit` plumbing remained in place.

The SDK still carries `triggerRiskAnalysisRequestBody.limit?: number` and the backend still accepts `limit=0` for full backfill and any positive integer for bounded — this PR just reconnects the dashboard.

What changed

  • `handleTrigger(id, limit?)` — limit threaded back through to the request body.
  • `` callsite passes `limit` through.
  • `RunPanel` footer now renders the Input + `Backfill last N` button alongside the full `Backfill all messages` button (default N=1000).
  • Changeset added.

Test plan

  • `pnpm tsc --noEmit` clean
  • In dev: open a policy progress sheet, click `Backfill last N` with N=100 — confirm policy version bumps and progress climbs to 100 / total
  • Click `Backfill all messages` — confirm progress drains to total

@mfbx9da4 mfbx9da4 requested review from a team as code owners May 19, 2026 12:19
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 19, 2026

🦋 Changeset detected

Latest commit: 4d74aff

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
dashboard Minor
server Minor

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

@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gram-docs-redirect Ready Ready Preview, Comment May 19, 2026 1:25pm

Request Review

@github-actions github-actions Bot added the preview Spawn a preview environment label May 19, 2026
@speakeasybot
Copy link
Copy Markdown
Collaborator

speakeasybot commented May 19, 2026

🚀 Preview Environment (PR #2918)

Preview URL: https://pr-2918.dev.getgram.ai

Component Status Details Updated (UTC)
✅ Database Ready Existing database reused 2026-05-20 10:32:11.
✅ Images Available Container images ready 2026-05-20 10:31:49.

Gram Preview Bot

@blacksmith-sh
Copy link
Copy Markdown
Contributor

blacksmith-sh Bot commented May 19, 2026

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
github.com/speakeasy-api/gram/server/internal/risk/TestTriggerRiskAnalysis_BumpsVersion View Logs

Fix in Cursor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Spawn a preview environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants