Skip to content

Give CollapsibleText a children-based variant and migrate AgentCard onto it #4170

Description

@atomantic

client/src/components/cos/tabs/AgentCard.jsx's TaskDescription (~line 80) is a second "long task text with a Show more toggle" implementation, one directory over from the shared client/src/components/ui/CollapsibleText.jsx. It uses a text.length > 200 heuristic + max-h-[3.5rem] + gradient fade instead of measured line-clamp-2, and its toggle carries no aria-expanded/aria-controls.

Not consolidated when CollapsibleText was introduced because AgentCard renders markdown blocks via MarkdownOutput, which line-clamp can't clamp.

Decision: add a children-based max-height variant to CollapsibleText (an alternative clamp strategy for content that can't use CSS line-clamp, e.g. rendered markdown), then migrate AgentCard's TaskDescription onto it and delete the bespoke implementation. This unifies the collapse affordance and its accessibility (aria-expanded/aria-controls) everywhere, at the cost of visibly changing AgentCard's current fade treatment — call that out in the PR for review.

Deferred from the PR that clamped CoS task text.

Migrated from PLAN.md by /do:replan --issues.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    planTracked by /do:replan

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions