[5970] fix(frontend): Preserve the Advanced label - #6058
Conversation
|
@manrods is attempting to deploy a commit to the agenta projects Team on Vercel. A member of the Team first needs to authorize it. |
|
✅ Thanks @manrods! This PR now meets the contribution requirements and has been reopened. A maintainer will review it soon. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Disabled knowledge base sources:
📝 WalkthroughSummary by CodeRabbit
Walkthrough
ChangesAccordion title preservation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
This PR fixes a layout regression on the agent Overview page where the Advanced configuration row label was being truncated (Advan…) because the summary block refused to shrink. It introduces an opt-in sizing behavior on the shared ConfigAccordionSection so the title can retain its intrinsic width while the summary truncates first.
Changes:
- Added a
preserveTitleprop toConfigAccordionSectionto prioritize title width over summary width. - Updated the flex/min-width/truncation classes so the summary can shrink/truncate when
preserveTitleis enabled. - Enabled
preserveTitleonly for theadvancedrow in the agent Overview configuration card, and added a unit test to cover the new behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| web/packages/agenta-ui/src/components/presentational/section/ConfigAccordionSection.tsx | Adds preserveTitle prop and adjusts flex sizing to truncate summary before the title when enabled. |
| web/oss/src/components/pages/overview/agent/AgentConfigurationCard.tsx | Enables preserveTitle specifically for the advanced configuration row. |
| web/packages/agenta-ui/tests/unit/configAccordionSection.test.ts | Adds unit coverage ensuring the title-group/summary-group class behavior changes with preserveTitle. |
Suppressed comments (2)
web/packages/agenta-ui/tests/unit/configAccordionSection.test.ts:27
section.match(... )?.[1].split(" ")can still throw if the regex doesn't match (optional chaining only applies to the[1]access, not to.split). Capturing the match and asserting it exists gives clearer failures and avoids TypeErrors.
const section = renderSection(true)
const titleGroup = section.match(/role="button"[^>]*class="([^"]*)"/)?.[1].split(" ")
const summary = classesBefore(section, "Sandbox: local · Permissions: allow")
web/packages/agenta-ui/tests/unit/configAccordionSection.test.ts:43
- Same as above:
.match(...)?.[1].split(" ")can throw a TypeError if the markup changes and the regex stops matching. Storing the match and asserting it exists makes the test failure easier to diagnose.
it("keeps the existing title-first truncation behavior by default", () => {
const section = renderSection()
const titleGroup = section.match(/role="button"[^>]*class="([^"]*)"/)?.[1].split(" ")
expect(titleGroup).not.toContain("shrink-0")
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const classesBefore = (markup: string, text: string): string[] => { | ||
| const beforeText = markup.slice(0, markup.indexOf(text)) | ||
| const className = beforeText.match(/class="([^"]*)"[^>]*>[^<]*$/)?.[1] ?? "" | ||
| return className.split(" ") | ||
| } |
Summary
On an agent's Overview page, the Configuration rail rendered the Advanced row label as
Advan…. The summary block could not shrink, so flexbox took the missing width from the row title instead.The shared configuration row now supports an opt-in title priority. When enabled, the title keeps its intrinsic width and the secondary summary truncates first. Only the Advanced row in the agent Overview enables this behavior, so other consumers retain the existing title-first truncation behavior.
Before:
Advan…After:
AdvancedFixes #5970.
Testing
Verified locally
pnpm --filter @agenta/ui test:unit(32 tests passed)pnpm --filter @agenta/ui lintpnpm --filter @agenta/ui types:checkpnpm --filter @agenta/oss types:checkpnpm lint-fixAdded or updated tests
Added unit coverage that verifies preserved titles do not shrink, summaries can shrink and truncate, and the existing default behavior remains unchanged.
QA follow-up
Advancedin full.Demo
The same component rendered at a constrained rail width before and after the opt-in title priority:
Checklist
Contributor Resources