Skip to content

feat(ui): overhaul tool result cards - #130

Open
Waishnav wants to merge 1 commit into
mainfrom
codex/ui-tool-card-overhaul
Open

feat(ui): overhaul tool result cards#130
Waishnav wants to merge 1 commit into
mainfrom
codex/ui-tool-card-overhaul

Conversation

@Waishnav

@Waishnav Waishnav commented Aug 5, 2026

Copy link
Copy Markdown
Owner

DevSpace tool cards were showing repeated metadata, inconsistent spacing, and intrusive scrollbars. Workspace cards also surfaced model-only diagnostics, while single-file mutations required extra clicks before users could see their diff.\n\nThis refresh gives cards an operation-specific visual hierarchy, controlled workspace disclosures, neutral WebKit scrollbar styling, and immediate single-file mutation diffs. Multi-file reviews retain per-file expansion, while the single-file review path drops the redundant file header so the diff begins directly under the card summary.

Screenshots

image image image

Summary by CodeRabbit

  • New Features

    • Workspace details now appear in expandable sections for instructions, skills, agents, and providers.
    • Instruction files can be opened individually, with expanded sections preserved while viewing the same workspace.
    • Review cards automatically expand for relevant edits and file changes.
    • File reviews show operation types, paths, rename details, and addition/removal counts.
  • Improvements

    • Updated workspace labels, icons, summaries, responsive layouts, and accessible controls.
    • Added consistent, styled scrollbars across text and code views.
    • Simplified workspace card details by removing internal diagnostics and instructions.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2ab6b2f2-8c29-4316-8666-988932a72b5f

📥 Commits

Reviewing files that changed from the base of the PR and between 6f83396 and a20ea74.

📒 Files selected for processing (16)
  • package.json
  • src/server.test.ts
  • src/server.ts
  • src/ui/card-types.test.ts
  • src/ui/card-types.ts
  • src/ui/heavy-payload.tsx
  • src/ui/icons.ts
  • src/ui/review-payload.tsx
  • src/ui/scrollbar-styles.test.ts
  • src/ui/scrollbar-styles.ts
  • src/ui/tool-display.test.ts
  • src/ui/tool-display.ts
  • src/ui/workspace-app.css
  • src/ui/workspace-app.tsx
  • src/ui/workspace-disclosures.test.ts
  • src/ui/workspace-disclosures.ts
 ________________________________________________________________________________________________________________________________________
< Use assertions to prevent the impossible. Assertions validate your assumptions. Use them to protect your code from an uncertain world. >
 ----------------------------------------------------------------------------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ 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 codex/ui-tool-card-overhaul

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Greptile Summary

The PR overhauls tool-result cards to provide operation-specific presentation, immediate single-file mutation and review diffs, structured workspace disclosures, and less intrusive scrollbar styling.

  • Removes model-only workspace diagnostics and instructions from user-facing card data.
  • Adds workspace instruction, skill, agent, and provider disclosures with persistent local expansion state.
  • Improves review file operation labels and preserves per-file expansion for multi-file reviews.
  • Adds shared scrollbar styling for document and Pierre shadow-root scrollers.
  • Updates card summaries, icons, state coloring, and associated tests.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code failure identified.

Current result producers satisfy the revised card projection and identity contracts, while the new expansion, disclosure, review, and scrollbar behavior remains consistent with the supplied card data.

Important Files Changed

Filename Overview
src/ui/workspace-app.tsx Introduces automatic card expansion, structured workspace disclosures, card-state styling, and explicit UI-card projection without an established defect.
src/ui/review-payload.tsx Auto-opens single-file reviews and adds operation-aware multi-file headers while retaining expandable file diffs.
src/ui/card-types.ts Refines workspace expandability and centralizes automatic expansion behavior for reviews and single-file mutations.
src/server.ts Removes model-only workspace diagnostics and instructions from the user-facing card projection.
src/ui/workspace-app.css Implements the new card hierarchy, operation tones, disclosure layout, focus states, and neutral WebKit scrollbars.
src/ui/tool-display.ts Updates workspace identity cues, review file-count titles, and workspace metadata summaries.
src/ui/scrollbar-styles.ts Adds shadow-root-compatible scrollbar styling for Pierre payload components.

Reviews (1): Last reviewed commit: "feat(ui): overhaul tool result cards" | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates workspace card metadata and expansion rules, adds structured workspace disclosures, improves review file rendering, introduces shared scrollbar styles, and updates icons, styling, and test coverage.

Changes

Workspace and review UI

Layer / File(s) Summary
Card metadata and expansion contracts
src/server.ts, src/server.test.ts, src/ui/card-types.ts, src/ui/card-types.test.ts, package.json
Workspace cards no longer expose diagnostics or instructions. Card expansion now depends on card type and file count. The test script includes the new test suites.
Structured workspace disclosures
src/ui/workspace-app.tsx, src/ui/workspace-disclosures.ts, src/ui/tool-display.ts, src/ui/icons.ts, src/ui/workspace-app.css, src/ui/*test.ts
Workspace payloads render instructions, skills, agents, and providers as expandable sections. Disclosure state supports independent sections and documents. Tool labels, icons, summaries, card states, accessibility, and responsive styling were updated.
Review file payloads and shared scrollbars
src/ui/review-payload.tsx, src/ui/heavy-payload.tsx, src/ui/scrollbar-styles.ts, src/ui/scrollbar-styles.test.ts
Review payloads show file operations, rename paths, statistics, and collapsible diffs. Text, file, and diff payloads use shared Pierre scrollbar styling.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Sequence Diagram(s)

sequenceDiagram
  participant Server as server.ts
  participant WorkspaceApp as workspace-app.tsx
  participant DisclosureState as workspace-disclosures.ts
  participant Browser as Workspace card DOM
  Server->>WorkspaceApp: provide workspace metadata and structured content
  WorkspaceApp->>WorkspaceApp: sanitize card data and build workspace sections
  WorkspaceApp->>DisclosureState: toggle section or document
  DisclosureState-->>WorkspaceApp: return updated open-key set
  WorkspaceApp->>Browser: render workspace disclosures and card state
Loading

Poem

A rabbit reviews each card in the hall,
With chevrons that hop when disclosures call.
Files show their changes, scrollbars gleam bright,
Diagnostics vanish from UI sight.
“Tests run,” says the rabbit, “everything’s neat!”

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the pull request's primary change: an overhaul of UI tool result cards.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/ui-tool-card-overhaul

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@src/ui/workspace-app.css`:
- Around line 514-517: Update the .workspace-disclosures CSS declaration block
and the additionally affected block around the corresponding later rules: insert
a blank line after --workspace-inline-padding, and replace every deprecated
word-break: break-word declaration with overflow-wrap: anywhere.

In `@src/ui/workspace-app.tsx`:
- Around line 676-689: Update workspaceCardIdentity and isSameWorkspaceCard to
use only workspaceId for open_workspace cards; remove root and path fallbacks.
Treat cards without a workspaceId as having no identity so disclosure and
document state reset rather than being reused across workspace instances.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2ab6b2f2-8c29-4316-8666-988932a72b5f

📥 Commits

Reviewing files that changed from the base of the PR and between 6f83396 and a20ea74.

📒 Files selected for processing (16)
  • package.json
  • src/server.test.ts
  • src/server.ts
  • src/ui/card-types.test.ts
  • src/ui/card-types.ts
  • src/ui/heavy-payload.tsx
  • src/ui/icons.ts
  • src/ui/review-payload.tsx
  • src/ui/scrollbar-styles.test.ts
  • src/ui/scrollbar-styles.ts
  • src/ui/tool-display.test.ts
  • src/ui/tool-display.ts
  • src/ui/workspace-app.css
  • src/ui/workspace-app.tsx
  • src/ui/workspace-disclosures.test.ts
  • src/ui/workspace-disclosures.ts
💤 Files with no reviewable changes (1)
  • src/server.ts

Comment thread src/ui/workspace-app.css
Comment on lines +514 to +517
.workspace-disclosures {
--workspace-inline-padding: 14px;
display: grid;
padding: 0 0 6px;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Fix the reported Stylelint errors.

Add an empty line between --workspace-inline-padding and display. Replace deprecated word-break: break-word with overflow-wrap: anywhere.

Proposed fix
 .workspace-disclosures {
   --workspace-inline-padding: 14px;
+
   display: grid;
   padding: 0 0 6px;
 }
 
 .workspace-document {
@@
-  word-break: break-word;
+  overflow-wrap: anywhere;
 }

Also applies to: 678-689

🧰 Tools
🪛 Stylelint (17.14.0)

[error] 516-516: Expected empty line before declaration (declaration-empty-line-before)

(declaration-empty-line-before)

🤖 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 `@src/ui/workspace-app.css` around lines 514 - 517, Update the
.workspace-disclosures CSS declaration block and the additionally affected block
around the corresponding later rules: insert a blank line after
--workspace-inline-padding, and replace every deprecated word-break: break-word
declaration with overflow-wrap: anywhere.

Source: Linters/SAST tools

Comment thread src/ui/workspace-app.tsx
Comment on lines +676 to +689
function workspaceCardIdentity(
value: { tool?: ToolName; workspaceId?: string; root?: string; path?: string } | null,
): string | undefined {
if (value?.tool !== "open_workspace") return undefined;
return value.workspaceId ?? value.root ?? value.path;
}

function formatAgentsFilesForPayload(
agentsFiles: NonNullable<ToolResultCard["agentsFiles"]>,
): string {
return agentsFiles
.map((file) => {
const path = file.path ?? "AGENTS.md";
const content = file.content?.trim();
return content ? `${path}\n\n${content}` : `${path}\n\nNo content loaded.`;
})
.join("\n\n");
function isSameWorkspaceCard(
previous: { tool?: ToolName; workspaceId?: string; root?: string; path?: string } | null,
next: { tool?: ToolName; workspaceId?: string; root?: string; path?: string },
): boolean {
const previousIdentity = workspaceCardIdentity(previous);
const nextIdentity = workspaceCardIdentity(next);
return previousIdentity !== undefined && previousIdentity === nextIdentity;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Use workspaceId as the only workspace identity.

Line 680 falls back to root and path. These values identify filesystem locations, not workspace instances. Two workspace instances at the same location can retain each other’s disclosure and document state.

Require open_workspace cards to carry workspaceId. Compare only that opaque value. Reset the disclosure state when it is absent.

As per coding guidelines, use workspaceId as the opaque handle returned by open_workspace and do not conflate workspaces, allowed roots, checkouts, or worktrees.

Proposed local guard
 function workspaceCardIdentity(
   value: { tool?: ToolName; workspaceId?: string; root?: string; path?: string } | null,
 ): string | undefined {
   if (value?.tool !== "open_workspace") return undefined;
-  return value.workspaceId ?? value.root ?? value.path;
+  return value.workspaceId;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function workspaceCardIdentity(
value: { tool?: ToolName; workspaceId?: string; root?: string; path?: string } | null,
): string | undefined {
if (value?.tool !== "open_workspace") return undefined;
return value.workspaceId ?? value.root ?? value.path;
}
function formatAgentsFilesForPayload(
agentsFiles: NonNullable<ToolResultCard["agentsFiles"]>,
): string {
return agentsFiles
.map((file) => {
const path = file.path ?? "AGENTS.md";
const content = file.content?.trim();
return content ? `${path}\n\n${content}` : `${path}\n\nNo content loaded.`;
})
.join("\n\n");
function isSameWorkspaceCard(
previous: { tool?: ToolName; workspaceId?: string; root?: string; path?: string } | null,
next: { tool?: ToolName; workspaceId?: string; root?: string; path?: string },
): boolean {
const previousIdentity = workspaceCardIdentity(previous);
const nextIdentity = workspaceCardIdentity(next);
return previousIdentity !== undefined && previousIdentity === nextIdentity;
function workspaceCardIdentity(
value: { tool?: ToolName; workspaceId?: string; root?: string; path?: string } | null,
): string | undefined {
if (value?.tool !== "open_workspace") return undefined;
return value.workspaceId;
}
function isSameWorkspaceCard(
previous: { tool?: ToolName; workspaceId?: string; root?: string; path?: string } | null,
next: { tool?: ToolName; workspaceId?: string; root?: string; path?: string },
): boolean {
const previousIdentity = workspaceCardIdentity(previous);
const nextIdentity = workspaceCardIdentity(next);
return previousIdentity !== undefined && previousIdentity === nextIdentity;
🤖 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 `@src/ui/workspace-app.tsx` around lines 676 - 689, Update
workspaceCardIdentity and isSameWorkspaceCard to use only workspaceId for
open_workspace cards; remove root and path fallbacks. Treat cards without a
workspaceId as having no identity so disclosure and document state reset rather
than being reused across workspace instances.

Source: Coding guidelines

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