Skip to content

Add collapsible reasoning section to detail panel#1894

Open
yuyutaotao wants to merge 2 commits intomainfrom
claude/refactor-detail-display-XkeHV
Open

Add collapsible reasoning section to detail panel#1894
yuyutaotao wants to merge 2 commits intomainfrom
claude/refactor-detail-display-XkeHV

Conversation

@yuyutaotao
Copy link
Collaborator

Summary

This PR adds a collapsible card component for the reasoning content in the detail side panel, improving the UI by allowing users to expand/collapse the reasoning section on demand. The reasoning section is now collapsed by default to reduce visual clutter.

Key Changes

  • New CollapsibleCard component: Created a reusable collapsible card component with expand/collapse icons (RightOutlined/DownOutlined) and smooth transitions
  • Styling updates: Added .title-collapsible and .item-collapsible styles with hover effects and dark mode support
  • Removed unused props: Cleaned up onMouseEnter and onMouseLeave props from Card component and removed the noop function as they were no longer being used
  • Applied to reasoning sections: Replaced standard Card components with CollapsibleCard for all reasoning content across different task types (Assertion, Planning, Output)
  • Icon imports: Added DownOutlined and RightOutlined icons from ant-design for collapse/expand indicators

Implementation Details

  • The CollapsibleCard component uses React's useState hook to manage collapsed state with a default of true (collapsed by default)
  • Collapse icon color matches the theme (light mode: fix(cli): the flashing issue in cli headed mode #73, dark mode: #9599a6) with hover color changes (#1677ff light, #4096ff dark)
  • The component maintains consistent styling with existing Card components while adding the collapsible functionality
  • All reasoning content across different execution task types now uses the same collapsible pattern for consistency

https://claude.ai/code/session_01KUHFq6fmLk3tJfdAqpNFes

…collapsible

- Remove onMouseEnter/onMouseLeave props from Card component (unused, all callers passed noop)
- Add CollapsibleCard component for reasoning content display
- Reasoning sections are now collapsed by default with click-to-expand functionality
- Add corresponding styles for collapsible card with dark mode support

https://claude.ai/code/session_01KUHFq6fmLk3tJfdAqpNFes
@netlify
Copy link

netlify bot commented Jan 29, 2026

Deploy Preview for midscene ready!

Name Link
🔨 Latest commit e65685f
🔍 Latest deploy log https://app.netlify.com/projects/midscene/deploys/697b5c40f2e5580008ef1d34
😎 Deploy Preview https://deploy-preview-1894--midscene.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd089ac161

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 916 to +920
planItems.push(
<Card
<CollapsibleCard
key="reasoning"
liteMode={true}
title="reasoning"
onMouseEnter={noop}
onMouseLeave={noop}
content={
<pre className="description-content">{reasoningContent}</pre>
}
content={reasoningContent}

Choose a reason for hiding this comment

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

P2 Badge Reset collapsed state when switching tasks

Because CollapsibleCard keeps its own useState and is keyed as a constant (key="reasoning"), React will reuse the same instance when you switch between tasks that both have reasoning. That means if a user expands one task’s reasoning, the next task’s reasoning will stay expanded, which contradicts the “collapsed by default” behavior described in the PR. This shows up whenever you navigate between tasks in the detail panel. Consider keying by task identity (or resetting state in an effect when content changes) so each task’s reasoning starts collapsed.

Useful? React with 👍 / 👎.

@cloudflare-workers-and-pages
Copy link

Deploying midscene with  Cloudflare Pages  Cloudflare Pages

Latest commit: e65685f
Status: ✅  Deploy successful!
Preview URL: https://4f90d6ca.midscene.pages.dev
Branch Preview URL: https://claude-refactor-detail-displ.midscene.pages.dev

View logs

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.

2 participants