Skip to content

feat(ui): refine tool cards and change review - #131

Merged
Waishnav merged 24 commits into
mainfrom
fix/tool-card-ui-overhaul
Aug 6, 2026
Merged

feat(ui): refine tool cards and change review#131
Waishnav merged 24 commits into
mainfrom
fix/tool-card-ui-overhaul

Conversation

@Waishnav

@Waishnav Waishnav commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Tool cards had become visually heavy and inconsistent, while workspace metadata and file-change details were harder to scan than they needed to be. This refines the card shell, spacing, semantic accents, payload scrolling, and workspace detail layout, including expandable skills and instruction files with inline previews.

Patch and review cards now classify file operations from the actual diff, keep repeated-path operations distinct, show rename source and destination paths, align multi-file rows, and open a single-file apply_patch diff immediately without expanding large multi-file patches by default.

Screenshots

image image image image

Summary by CodeRabbit

  • New Features

    • Review and workspace panels now show structured details, clearer icons, file change labels, and rename/path information.
    • Single-file review cards open expanded by default, while multi-file cards remain collapsed.
    • Shell/process items now show running, success, or error states.
    • Workspace details include instructions, skills, providers, agents, and source checkout information.
  • Bug Fixes

    • File additions over existing paths are now reported as updates.
    • Diff and payload views provide improved scrolling and layout behavior.
  • Style

    • Updated card, workspace, and review styling for cleaner spacing, colors, accessibility, and responsiveness.

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Greptile Summary

The PR streamlines tool-card styling and workspace metadata presentation while improving patch/review operation classification, rename display, scrolling, and initial expansion behavior.

  • Classifies patch and review files from parsed diff metadata and preserves repeated-path entries.
  • Opens single-file patch diffs immediately while leaving larger patches collapsed.
  • Replaces textual workspace payloads with structured, expandable instruction, skill, provider, and agent rows.
  • Adds semantic tool states, accents, icons, and consistent payload scrollbars.

Confidence Score: 4/5

The missing workspace skill-diagnostics rendering should be fixed before merging because affected users lose the only visible explanation for skill-loading problems.

open_workspace continues to emit skill diagnostics and treats them as expandable content, but the new structured payload renderer omits them and can display an empty-details message instead.

Files Needing Attention: src/ui/workspace-app.tsx

Important Files Changed

Filename Overview
src/ui/workspace-app.tsx Reworks card expansion and workspace payload rendering, but drops the still-produced skill diagnostics from the expanded UI.
src/ui/patch-display.ts Centralizes file operation classification, rename-path formatting, and rendered diff/card correlation.
src/ui/review-payload.tsx Adds immediate single-file rendering and richer multi-file operation and rename headers.
src/apply-patch.ts Correctly reports an Add File directive that overwrites an existing file as an update.
src/ui/card-types.ts Adds typed review operations and initial-expansion policy for review and single-file patch cards.
src/ui/workspace-app.css Refines card sizing, semantic accents, workspace disclosures, review rows, and responsive styling.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Tool result card] --> B{Tool type}
  B -->|apply_patch / show_changes| C[Parse diff files]
  C --> D[Classify operation and paths]
  D --> E[Render single diff or expandable file rows]
  B -->|open_workspace| F[Render structured metadata rows]
  F --> G[Instructions and previews]
  F --> H[Skills, providers, and agents]
Loading

Reviews (1): Last reviewed commit: "feat(ui): open single-file patch diffs" | Re-trigger Greptile

Comment thread src/ui/workspace-app.tsx Outdated
Comment on lines +532 to +544
const agentNames = (card.agents ?? []).map((agent) => {
const name = agent.name ?? "Unnamed agent";
return agent.provider ? `${name} · ${agent.provider}` : name;
});
if (agentNames.length > 0) {
appendWorkspaceTextListRow(
rows,
"Agents",
agentNames,
toolIcons.agents,
"agents",
);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Workspace diagnostics are discarded

When open_workspace returns skill diagnostics, this renderer ignores them even though they make the card expandable, causing skill-loading errors to disappear and diagnostics-only cards to report “No workspace details available.”

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

no need to show it to user, it's pretty much internal details

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Got it — keeping diagnostics as internal-only makes sense. I'll drop that concern.

Shall I remember this as a rule: "skill diagnostics from open_workspace are internal details and should not be surfaced in the UI"?

Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

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
📝 Walkthrough

Walkthrough

The change aligns patch result classification with file-change display, adds initial card expansion rules, replaces plain-text workspace payloads with structured rendering, and updates icons, scrollbars, accessibility, responsive layouts, and card styling.

Changes

Patch and workspace UI

Layer / File(s) Summary
Patch overwrite result classification
src/apply-patch.ts, src/apply-patch.test.ts
Existing-file replacements now report update; new files still report add.
File-change model and card expansion
src/ui/card-types.ts, src/ui/card-types.test.ts, src/ui/patch-display.ts, src/ui/patch-display.test.ts
Patch display logic now classifies file changes, formats rename paths, and controls initial card expansion.
Review and tool display integration
src/ui/review-payload.tsx, src/ui/tool-display.ts, src/ui/tool-display.test.ts
Review headers show change symbols and formatted paths. Tool cards expose process states and use updated display helpers.
Structured workspace rendering
src/ui/workspace-app.tsx
Workspace payloads render structured details for worktrees, checkouts, instructions, skills, providers, and agents with disclosure and preview state.
Shared icons, scrollbars, and responsive styling
src/ui/icons.ts, src/ui/scrollbar.ts, src/ui/heavy-payload.tsx, src/ui/workspace-app.css
The UI adds shared icons, custom scrollbars, semantic accents, file-kind indicators, focus styles, compact layouts, and responsive workspace styling.

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

Sequence Diagram(s)

sequenceDiagram
  participant ToolDisplay
  participant WorkspaceApp
  participant DOM
  ToolDisplay->>WorkspaceApp: identify open_workspace payload
  WorkspaceApp->>DOM: render structured workspace details
  WorkspaceApp->>DOM: preserve or reset disclosure and preview state
Loading

Possibly related PRs

Poem

A rabbit checks each patch with care,
“update” marks the file found there.
Icons glow and scrollbars glide,
Workspace details open wide.
Cards expand when files are clear—
Hop, hop, tidy reviews are here!

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main UI changes to tool cards and change review.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/tool-card-ui-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: 6

🧹 Nitpick comments (5)
src/ui/tool-display.ts (1)

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

Collapse the duplicated ternary branch.

Both the fileCount > 0 branch and the card.payload?.patch branch return display.title. The nested conditional therefore reduces to a single boolean test.

♻️ Proposed simplification
-        title: fileCount > 0
-          ? display.title
-          : card.payload?.patch
-            ? display.title
-            : "No changes",
+        title: fileCount > 0 || card.payload?.patch
+          ? display.title
+          : "No changes",
🤖 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/tool-display.ts` around lines 112 - 116, In the title expression
within the tool display construction, collapse the nested ternary so
display.title is selected when either fileCount > 0 or card.payload?.patch is
truthy; otherwise return "No changes".
src/ui/workspace-app.tsx (2)

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

Surface agent availability and model data instead of dropping it.

agentNames keeps only name and provider. The card also carries model, thinking, providerAvailable, and providerUnavailableReason (see src/ui/card-types.ts Lines 70-79). The rendered workspace details discard all four.

This is inconsistent inside the same renderer. For providers at Lines 518-530 you preserve reason as the chip title and mark unavailable entries with the muted tone. An agent whose provider is unavailable renders identically to a usable agent, so the user cannot tell which agents they can actually run.

Consider rendering agents as chips with the same tone and title treatment used for providers.

♻️ Proposed change to preserve agent availability
-  const agentNames = (card.agents ?? []).map((agent) => {
-    const name = agent.name ?? "Unnamed agent";
-    return agent.provider ? `${name} · ${agent.provider}` : name;
-  });
-  if (agentNames.length > 0) {
-    appendWorkspaceTextListRow(
-      rows,
-      "Agents",
-      agentNames,
-      toolIcons.agents,
-      "agents",
-    );
-  }
+  const agents = card.agents ?? [];
+  if (agents.length > 0) {
+    const agentChips: WorkspaceChip[] = agents.map((agent) => {
+      const name = agent.name ?? "Unnamed agent";
+      const unavailable = agent.providerAvailable === false;
+      const details = [agent.provider, agent.model].filter(Boolean).join(" · ");
+      return {
+        label: details ? `${name} · ${details}` : name,
+        tone: unavailable ? "muted" : undefined,
+        title: unavailable
+          ? agent.providerUnavailableReason ?? "Provider unavailable"
+          : undefined,
+      };
+    });
+    appendWorkspaceChipRow(rows, "Agents", agentChips, toolIcons.agents);
+  }

Based on learnings from the coding guidelines: "Preserve host and provider data unless DevSpace has a concrete reason to normalize it, and add compatibility behavior only for an identified consumer with a real upgrade path."

🤖 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 532 - 544, Update the agent rendering
in the workspace details renderer to preserve each agent’s model, thinking,
providerAvailable, and providerUnavailableReason data instead of reducing agents
to plain name strings. Render agents as chips using the same availability tone
and reason title behavior as the provider rendering near the existing provider
logic, while retaining the current name/provider display and Agents row
behavior.

Source: Coding guidelines


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

Extract the shared disclosure row builder.

appendWorkspaceSkills (Lines 875-901), appendWorkspaceTextListRow (Lines 802-835), and appendWorkspaceInstructions (Lines 595-632) each build the same disclosure scaffolding: the workspace-row workspace-row-disclosure class with a conditional expanded suffix, the matching workspace-disclosure span, a toggle that flips both classes, and the same add/delete calls against expandedWorkspaceDisclosures.

Three copies of this logic will drift. Extract one helper that accepts the label, the icon, the disclosure key, the content element, the item total, and an optional extra class name.

🤖 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 862 - 902, Extract the duplicated
disclosure-row construction from appendWorkspaceSkills,
appendWorkspaceTextListRow, and appendWorkspaceInstructions into one shared
helper. Have it accept the label, icon, disclosure key, content element, item
total, and optional extra class name, while preserving the existing
expanded-state class toggling and expandedWorkspaceDisclosures add/delete
behavior. Replace each local scaffold with calls to the helper, retaining each
row’s existing content and styling.
src/ui/heavy-payload.tsx (1)

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

Share one diff options builder with review-payload.tsx.

This options object now matches diffOptions in src/ui/review-payload.tsx Lines 196-212 on eleven fields, including the four this PR added here: unsafeCSS, collapsedContextThreshold, expansionLineCount, and disableFileHeader. The only difference is stickyHeader, which is true here and false there while both set disableFileHeader: true.

Extract a shared builder that takes themeType and the stickyHeader value. The two diff surfaces then cannot drift apart.

🤖 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/heavy-payload.tsx` around lines 152 - 169, Extract the duplicated diff
options object into a shared builder accepting themeType and stickyHeader,
preserving all existing option values. Update the diff configuration in
heavy-payload.tsx and review-payload.tsx to use this builder with their
respective stickyHeader values, so both surfaces share one source of truth.
src/ui/scrollbar.ts (1)

10-41: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add the standard scrollbar properties for non-WebKit browsers.

The whole block sits inside @supports selector(::-webkit-scrollbar). Firefox does not support that pseudo-element, so it evaluates to false and Firefox users get the default scrollbar. The standard scrollbar-width and scrollbar-color properties cover Firefox and can sit outside the feature query.

🎨 Proposed addition
 [data-code] {
   scrollbar-gutter: auto;
+  scrollbar-width: thin;
+  scrollbar-color: var(--scrollbar-thumb, rgb(128 128 128 / 55%)) transparent;
 }
🤖 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/scrollbar.ts` around lines 10 - 41, Update the scrollbar styling
around the [data-code] rules to add standard scrollbar-width and scrollbar-color
declarations outside the WebKit feature query, using the existing thumb and
transparent track colors. Keep the existing `@supports`
selector(::-webkit-scrollbar) block unchanged for WebKit-specific styling.
🤖 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/patch-display.ts`:
- Around line 145-149: Update the matched-file selection near matchedFile and
cardFile to prefer indexedFile when its path matches parsedFile.path, using the
existing files.find path match only as a fallback. Preserve the current
previousPath matching behavior for fallback lookup, and add a test covering two
moves with the same destination path to verify the indexed row is displayed.

In `@src/ui/review-payload.tsx`:
- Around line 118-143: Update the renamed-file header in the review payload
rendering to expose its path text: add an appropriate naming role to the
file-kind badge span, and remove the aria-hidden attributes from the previous,
arrow, and current path spans so the renamed path remains readable to assistive
technology. Use the existing role="img" pattern from
renderWorkspaceInstructionStatus, while preserving the visual structure and
labels.

In `@src/ui/workspace-app.css`:
- Around line 178-207: Replace the shared --font-text-sm-size usage across the
affected typography roles with distinct sizing tokens or fixed values: preserve
the 14px tool-title size, use the appropriate smaller token for .tool-label and
.stats, and separately maintain the 13px, 11px, and 10px sizes used by
.review-diff-file-name, .workspace-chip, .workspace-instruction-preview, and
.workspace-instruction-path. Ensure host overrides cannot collapse these roles
into one size.
- Around line 615-616: Replace the deprecated word-break: break-word declaration
in the affected style block with overflow-wrap: break-word while preserving
white-space: pre-wrap. Also update the matching deprecated declaration in
.text-payload for consistency.
- Around line 11-12: Update the --tool-accent-soft definition in the tone
override rules so it is recomputed from each tone’s --tool-accent value, rather
than remaining fixed from :root. Preserve the existing color-mix behavior and
ensure .tool-icon.color receives the corresponding semantic tint for every tone.

In `@src/ui/workspace-app.tsx`:
- Around line 574-588: Update the loaded-file handling in the workspace
instruction rendering flow to preserve an undefined path instead of defaulting
to “AGENTS.md”; use a neutral display label for pathless files without
presenting it as a host-reported path. Change preview identity and
synchronization in the relevant instruction rendering and
syncWorkspaceInstructionPreviews logic to use each file’s index, including
dataset.instructionPath and matching, so multiple pathless files remain
distinct.

---

Nitpick comments:
In `@src/ui/heavy-payload.tsx`:
- Around line 152-169: Extract the duplicated diff options object into a shared
builder accepting themeType and stickyHeader, preserving all existing option
values. Update the diff configuration in heavy-payload.tsx and
review-payload.tsx to use this builder with their respective stickyHeader
values, so both surfaces share one source of truth.

In `@src/ui/scrollbar.ts`:
- Around line 10-41: Update the scrollbar styling around the [data-code] rules
to add standard scrollbar-width and scrollbar-color declarations outside the
WebKit feature query, using the existing thumb and transparent track colors.
Keep the existing `@supports` selector(::-webkit-scrollbar) block unchanged for
WebKit-specific styling.

In `@src/ui/tool-display.ts`:
- Around line 112-116: In the title expression within the tool display
construction, collapse the nested ternary so display.title is selected when
either fileCount > 0 or card.payload?.patch is truthy; otherwise return "No
changes".

In `@src/ui/workspace-app.tsx`:
- Around line 532-544: Update the agent rendering in the workspace details
renderer to preserve each agent’s model, thinking, providerAvailable, and
providerUnavailableReason data instead of reducing agents to plain name strings.
Render agents as chips using the same availability tone and reason title
behavior as the provider rendering near the existing provider logic, while
retaining the current name/provider display and Agents row behavior.
- Around line 862-902: Extract the duplicated disclosure-row construction from
appendWorkspaceSkills, appendWorkspaceTextListRow, and
appendWorkspaceInstructions into one shared helper. Have it accept the label,
icon, disclosure key, content element, item total, and optional extra class
name, while preserving the existing expanded-state class toggling and
expandedWorkspaceDisclosures add/delete behavior. Replace each local scaffold
with calls to the helper, retaining each row’s existing content and styling.
🪄 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: 8cdbd34e-eaaa-4f58-a252-86754724cb48

📥 Commits

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

📒 Files selected for processing (14)
  • src/apply-patch.test.ts
  • src/apply-patch.ts
  • src/ui/card-types.test.ts
  • src/ui/card-types.ts
  • src/ui/heavy-payload.tsx
  • src/ui/icons.ts
  • src/ui/patch-display.test.ts
  • src/ui/patch-display.ts
  • src/ui/review-payload.tsx
  • src/ui/scrollbar.ts
  • src/ui/tool-display.test.ts
  • src/ui/tool-display.ts
  • src/ui/workspace-app.css
  • src/ui/workspace-app.tsx

Comment thread src/ui/patch-display.ts Outdated
Comment thread src/ui/review-payload.tsx
Comment thread src/ui/workspace-app.css Outdated
Comment thread src/ui/workspace-app.css
Comment thread src/ui/workspace-app.css Outdated
Comment thread src/ui/workspace-app.tsx Outdated
@Waishnav

Waishnav commented Aug 6, 2026

Copy link
Copy Markdown
Owner Author

[GPT-5.6-THINKING] RESPONDING ON BEHALF OF WAISHNAV

Follow-up on the review items that were grouped in the review summary rather than attached to inline threads:

  • Partially adopted agent availability in 54dc7c8: unavailable agents are muted and expose the provider reason, while model and thinking configuration remain intentionally hidden to keep the workspace card user-focused.
  • Added standard Firefox scrollbar properties and simplified the duplicated title condition in ef552d0.
  • Not extracting a generic disclosure-row builder in this PR. Instructions, skills, and text disclosures have meaningfully different content and lifecycle behavior; a shared helper would add parameters and indirection without reducing product complexity.
  • Not extracting a shared Pierre diff-options builder yet. There are only two intentionally different surfaces, and no observed drift bug; we can introduce that abstraction when another consumer or real divergence warrants it.
  • Skill diagnostics remain internal-only by product decision, as discussed in the existing Greptile thread. Raw loader diagnostics should not be surfaced merely because the card payload contains them.

Verification on ef552d0: focused patch/tool display tests, full TypeScript typecheck, production Vite build, and git diff --check all pass.

@Waishnav

Waishnav commented Aug 6, 2026

Copy link
Copy Markdown
Owner Author

[GPT-5.6-THINKING] RESPONDING ON BEHALF OF WAISHNAV

Addressed both follow-up cleanups in separate commits.

8ddc6e4 removes skillDiagnostics from open-workspace card expandability, including both projected summary counts and raw card data. A focused regression now proves that diagnostics-only cards remain collapsed while diagnostics stay available internally.

5bc44a7 extracts the repeated workspace disclosure-row construction shared by instructions, skills, and text lists. The helper owns only row construction, expanded classes, toggle labels, and disclosure-state bookkeeping; instruction-specific preview cleanup remains an explicit caller hook rather than being hidden in the abstraction.

Verified with the full test suite, TypeScript typecheck, production build, and git diff --check.

@Waishnav

Waishnav commented Aug 6, 2026

Copy link
Copy Markdown
Owner Author

[GPT-5.6-THINKING] RESPONDING ON BEHALF OF WAISHNAV

Final cleanup pushed in 35416ac. skillDiagnostics remains available through structuredContent for model context, but is no longer copied into the UI card or its summary. Removed the card type field, the server card assertion, and the now-obsolete regression test for diagnostics-only expandability.

Verified with the full test suite, production build, and git diff --check.

@Waishnav
Waishnav merged commit 7ef6b92 into main Aug 6, 2026
4 checks passed
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