Skip to content

feat(studio): Add Guardrail check details Panel - #1083

Merged
nakolean merged 6 commits into
mainfrom
nkolean/guardrails-details-panel
Aug 5, 2026
Merged

feat(studio): Add Guardrail check details Panel#1083
nakolean merged 6 commits into
mainfrom
nkolean/guardrails-details-panel

Conversation

@nakolean

@nakolean nakolean commented Aug 4, 2026

Copy link
Copy Markdown
Contributor
Screen.Recording.2026-08-04.at.2.53.39.PM.mov

Summary by CodeRabbit

  • New Features
    • Added a non-modal guardrail check detail panel with Chat/JSON conversation views, results, rail details, and run history.
    • Enhanced navigation across visible checks, including pagination and selection preservation.
    • Added rail-label humanization and activated-guardrail indicators.
    • Invalid Guardrail Checks sub-tabs now redirect to the default Tests view.
  • Bug Fixes
    • Improved empty, missing, and unknown rail/run states.
    • Updated guarded and allowed status indicators with consistent yellow/gray styling.

@nakolean
nakolean requested review from a team as code owners August 4, 2026 20:55
@github-actions github-actions Bot added the feat label Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d65acc1b-a124-438e-badf-3e585a59d652

📥 Commits

Reviewing files that changed from the base of the PR and between 0fe7083 and 928d5a1.

📒 Files selected for processing (4)
  • web/packages/studio/src/components/dataViews/GuardrailChecksDataView/ResultSummary.tsx
  • web/packages/studio/src/components/dataViews/GuardrailChecksDataView/index.test.tsx
  • web/packages/studio/src/routes/guardrails/GuardrailChecksTab/GuardrailTestCasesEditor.tsx
  • web/packages/studio/src/routes/guardrails/GuardrailChecksTab/index.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
  • web/packages/studio/src/routes/guardrails/GuardrailChecksTab/index.tsx
  • web/packages/studio/src/components/dataViews/GuardrailChecksDataView/index.test.tsx
  • web/packages/studio/src/routes/guardrails/GuardrailChecksTab/GuardrailTestCasesEditor.tsx
  • web/packages/studio/src/components/dataViews/GuardrailChecksDataView/ResultSummary.tsx

📝 Walkthrough

Walkthrough

The PR adds ID-based guardrail-check detail navigation, a non-modal side panel, conversation and result views, rail-status utilities, Storybook scenarios, and validated sub-tab routing.

Changes

Guardrail check detail flow

Layer / File(s) Summary
Detail selection and navigation
web/packages/studio/src/components/dataViews/GuardrailChecksDataView/*, web/packages/studio/src/components/dataViews/GuardrailChecksDataView/index.test.tsx
The data view opens details by check ID and supports filtering, pagination, reordering, and adjacent-row navigation.
Detail panel content and rail results
web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/*, web/packages/studio/src/components/dataViews/GuardrailChecksDataView/Result*
The side panel renders conversations, rail statuses, run history, activated guardrails, verdict badges, and navigation controls. Guarded result colors use yellow.
Route and editor integration
web/packages/studio/src/routes/guardrails/GuardrailChecksTab/*
The route validates sub-tabs, redirects invalid values, gates queries, and passes configuration and navigation state to the detail panel.
Detail panel scenarios and validation
web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/*.stories.tsx, web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/*.test.*
Tests and stories cover detail navigation, rail labels, duplicate labels, empty runs, filtered rows, and invalid sub-tabs.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant GuardrailChecksDataView
  participant GuardrailTestCasesEditor
  participant GuardrailCheckDetailSidePanel
  participant ResultsPane

  User->>GuardrailChecksDataView: click guardrail check
  GuardrailChecksDataView->>GuardrailTestCasesEditor: provide selected check and navigation state
  GuardrailTestCasesEditor->>GuardrailCheckDetailSidePanel: open detail panel
  GuardrailCheckDetailSidePanel->>ResultsPane: render results and run history
  User->>GuardrailCheckDetailSidePanel: select previous or next check
  GuardrailCheckDetailSidePanel->>GuardrailChecksDataView: navigate to visible check
Loading

Possibly related PRs

Suggested reviewers: htolentino-nvidia, aray12

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding a Guardrail check details panel to Studio.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nkolean/guardrails-details-panel

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/RailStatusTab.test.tsx (1)

21-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Restore the console.error spy in a teardown hook.

If an assertion on line 26 or 31 fails, line 33 never runs. The spy then stays mocked for the rest of the file and silences real React errors.

♻️ Proposed change
 describe('RailStatusTab', () => {
+  afterEach(() => {
+    vi.restoreAllMocks();
+  });
+
   it('keys guardrail rows so two sharing a label do not collide', () => {
     const errors = vi.spyOn(console, 'error').mockImplementation(() => {});
@@
     expect(duplicateKeyWarnings).toEqual([]);
-
-    errors.mockRestore();
   });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/RailStatusTab.test.tsx`
around lines 21 - 33, Move the console.error spy cleanup from the end of the
test into a teardown hook so it always runs even when assertions fail. Update
the test containing the errors spy and use afterEach or an equivalent guaranteed
cleanup mechanism to call mockRestore, preserving the existing assertions and
warning detection.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/ConversationPane.tsx`:
- Around line 21-24: Make every property in the props interfaces readonly:
update check and className in ConversationPaneProps; status in RailStatusBadge
props; both properties in RailStatusTab props; all properties in ResultsPane
props; runs in RunHistoryTab props; all properties in the side-panel component
props in index.tsx; and all properties in GuardrailTestCasesEditor props. Apply
the changes at each listed file and preserve the existing property types and
component behavior.

In
`@web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/GuardrailCheckDetailSidePanel.stories.tsx`:
- Around line 37-49: Rename the module-level constants config, guardedCheck,
neverRunCheck, withSystemPromptCheck, and meta to SCREAMING_SNAKE_CASE, and
update every reference throughout the story file, including the ranges noted by
the review. Preserve their values and behavior while applying the naming
convention consistently.

---

Nitpick comments:
In
`@web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/RailStatusTab.test.tsx`:
- Around line 21-33: Move the console.error spy cleanup from the end of the test
into a teardown hook so it always runs even when assertions fail. Update the
test containing the errors spy and use afterEach or an equivalent guaranteed
cleanup mechanism to call mockRestore, preserving the existing assertions and
warning detection.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: dbbcd1c7-e77c-45d0-a3b2-282de25add12

📥 Commits

Reviewing files that changed from the base of the PR and between f45c965 and e6561ba.

📒 Files selected for processing (16)
  • web/packages/studio/src/components/dataViews/GuardrailChecksDataView/checkMessages.ts
  • web/packages/studio/src/components/dataViews/GuardrailChecksDataView/index.test.tsx
  • web/packages/studio/src/components/dataViews/GuardrailChecksDataView/index.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/ConversationPane.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/GuardrailCheckDetailSidePanel.stories.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/RailStatusBadge.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/RailStatusTab.test.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/RailStatusTab.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/ResultsPane.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/RunHistoryTab.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/index.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/railLabels.test.ts
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/railLabels.ts
  • web/packages/studio/src/routes/guardrails/GuardrailChecksTab/GuardrailTestCasesEditor.tsx
  • web/packages/studio/src/routes/guardrails/GuardrailChecksTab/index.test.tsx
  • web/packages/studio/src/routes/guardrails/GuardrailChecksTab/index.tsx

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 30741/39237 78.3% 62.7%
Integration Tests 18061/37189 48.6% 21.0%

@rrhyne

rrhyne commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Would you mind switching that purple to yellow? It's clashing really badly with the green. If the green and yellow are too close, you could use a light grey to signify allowed. This might be preferable as allowed would be the default state without the guardrailed action.

Comment thread web/packages/studio/src/routes/guardrails/GuardrailChecksTab/index.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/RunHistoryTab.tsx (1)

13-13: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Declare runs as a readonly array.

readonly runs: RunRecord[] prevents prop reassignment but still allows runs.push(...). Use readonly runs: readonly RunRecord[] when RunHistoryTab must only read history.

As per coding guidelines, immutable TypeScript data should use readonly.

Proposed change
-  readonly runs: RunRecord[];
+  readonly runs: readonly RunRecord[];
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/RunHistoryTab.tsx`
at line 13, Update the RunHistoryTab props declaration so the runs property uses
a readonly array type, changing it from RunRecord[] to readonly RunRecord[].
Preserve the existing RunRecord element type and read-only history behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/RunHistoryTab.tsx`:
- Line 13: Update the RunHistoryTab props declaration so the runs property uses
a readonly array type, changing it from RunRecord[] to readonly RunRecord[].
Preserve the existing RunRecord element type and read-only history behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7948fcd2-436a-4fa1-9774-d5c82505b8ad

📥 Commits

Reviewing files that changed from the base of the PR and between e6561ba and 92fb4db.

📒 Files selected for processing (12)
  • web/packages/studio/src/components/dataViews/GuardrailChecksDataView/ResultIndicator.tsx
  • web/packages/studio/src/components/dataViews/GuardrailChecksDataView/ResultSummary.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/ConversationPane.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/GuardrailCheckDetailSidePanel.stories.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/RailStatusBadge.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/RailStatusTab.test.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/RailStatusTab.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/ResultsPane.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/RunHistoryTab.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/index.tsx
  • web/packages/studio/src/routes/guardrails/GuardrailChecksTab/GuardrailTestCasesEditor.tsx
  • web/packages/studio/src/routes/guardrails/GuardrailChecksTab/index.tsx
🚧 Files skipped from review as they are similar to previous changes (7)
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/RailStatusBadge.tsx
  • web/packages/studio/src/routes/guardrails/GuardrailChecksTab/GuardrailTestCasesEditor.tsx
  • web/packages/studio/src/routes/guardrails/GuardrailChecksTab/index.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/ConversationPane.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/RailStatusTab.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/RailStatusTab.test.tsx
  • web/packages/studio/src/components/sidePanels/GuardrailCheckDetailSidePanel/GuardrailCheckDetailSidePanel.stories.tsx

nakolean and others added 5 commits August 5, 2026 10:24
Signed-off-by: Nicholas Kolean <nakolean@gmail.com>
Co-authored-by: Nathan Walston <walston@users.noreply.github.com>
Signed-off-by: Nicholas Kolean <nakolean@gmail.com>
Signed-off-by: Nicholas Kolean <nakolean@gmail.com>
Signed-off-by: Nicholas Kolean <nakolean@gmail.com>
Signed-off-by: Nicholas Kolean <nakolean@gmail.com>
@nakolean
nakolean force-pushed the nkolean/guardrails-details-panel branch from 7e2b205 to 0fe7083 Compare August 5, 2026 16:25
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

Signed-off-by: Nicholas Kolean <nakolean@gmail.com>
@nakolean
nakolean enabled auto-merge August 5, 2026 16:56
@nakolean
nakolean added this pull request to the merge queue Aug 5, 2026
Merged via the queue into main with commit 9b7f483 Aug 5, 2026
54 checks passed
@nakolean
nakolean deleted the nkolean/guardrails-details-panel branch August 5, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants