Skip to content

[5970] fix(frontend): Preserve the Advanced label - #6058

Open
manrods wants to merge 4 commits into
Agenta-AI:mainfrom
manrods:fix/5970-advanced-label
Open

[5970] fix(frontend): Preserve the Advanced label#6058
manrods wants to merge 4 commits into
Agenta-AI:mainfrom
manrods:fix/5970-advanced-label

Conversation

@manrods

@manrods manrods commented Aug 15, 2026

Copy link
Copy Markdown

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: Advanced

Fixes #5970.

Testing

Verified locally

  • pnpm --filter @agenta/ui test:unit (32 tests passed)
  • pnpm --filter @agenta/ui lint
  • pnpm --filter @agenta/ui types:check
  • pnpm --filter @agenta/oss types:check
  • pnpm lint-fix
  • Verified the before/after layout in Chromium with the issue's title and summary text.

Added 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

  • Open an agent's Overview at desktop width. The final Configuration row should show Advanced in full.
  • Check an agent with sandbox and permission values configured. The summary may truncate when space is limited, but it must not push the row label into an ellipsis.
  • Regression: check the other Configuration rows. Their labels, summaries, and navigation affordances should behave as before.

Demo

The same component rendered at a constrained rail width before and after the opt-in title priority:

Advanced configuration label before and after

Checklist

  • I have included a video or screen recording for UI changes, or marked Demo as N/A
  • Relevant tests pass locally
  • Relevant linting and formatting pass locally
  • I have signed the CLA, or I will sign it when the bot prompts me

Contributor Resources

Copilot AI lite review requested due to automatic review settings August 15, 2026 17:34
@vercel

vercel Bot commented Aug 15, 2026

Copy link
Copy Markdown

@manrods is attempting to deploy a commit to the agenta projects Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant

CLAassistant commented Aug 15, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

✅ Thanks @manrods! This PR now meets the contribution requirements and has been reopened. A maintainer will review it soon.

@github-actions github-actions Bot added the incomplete-pr PR is missing required template sections or a demo recording label Aug 15, 2026
@github-actions github-actions Bot closed this Aug 15, 2026
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 5936d5b5-a3c9-4af7-b7d8-ef58e67be9f9

📥 Commits

Reviewing files that changed from the base of the PR and between e060425 and fc80689.

📒 Files selected for processing (1)
  • web/packages/agenta-ui/tests/unit/configAccordionSection.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/packages/agenta-ui/tests/unit/configAccordionSection.test.ts

Included review availability: Your plan includes up to 8 reviews per rolling hour; 6 remain after this review.


📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Improved Advanced configuration rows so their titles remain fully visible while longer summaries shrink and truncate appropriately.
    • Preserved the existing title-first truncation behavior for other configuration sections, ensuring consistent display across the interface.
  • Tests

    • Added coverage for title sizing, summary shrinking, and truncation behavior in configuration accordion sections.

Walkthrough

ConfigAccordionSection now supports preserving its title while truncating the summary. The agent configuration card enables this behavior for the Advanced row. Unit tests cover both the new and default layouts.

Changes

Accordion title preservation

Layer / File(s) Summary
Accordion layout contract and rendering
web/packages/agenta-ui/src/components/presentational/section/ConfigAccordionSection.tsx, web/packages/agenta-ui/tests/unit/configAccordionSection.test.ts
Adds the optional preserveTitle prop. When enabled, the title does not shrink, while the summary region shrinks and truncates. Tests cover both layouts.
Advanced row configuration
web/oss/src/components/pages/overview/agent/AgentConfigurationCard.tsx
Passes preserveTitle to the Advanced configuration row. Other rows keep the default behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to fc806

The change preserves the Advanced label while allowing only its summary to truncate; no actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the frontend fix that preserves the Advanced label, which is the main change.
Description check ✅ Passed The description directly explains the label truncation issue, the opt-in fix, affected behavior, and validation performed.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 60.00%.
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
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 preserveTitle prop to ConfigAccordionSection to prioritize title width over summary width.
  • Updated the flex/min-width/truncation classes so the summary can shrink/truncate when preserveTitle is enabled.
  • Enabled preserveTitle only for the advanced row 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.

Comment thread web/packages/agenta-ui/tests/unit/configAccordionSection.test.ts Outdated
@github-actions github-actions Bot removed the incomplete-pr PR is missing required template sections or a demo recording label Aug 15, 2026
@github-actions github-actions Bot reopened this Aug 15, 2026
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. frontend tests ui labels Aug 15, 2026
@ashrafchowdury

Copy link
Copy Markdown
Contributor

Hey @manrods thanks for the fix, can you please resolve the code reviews

Copilot AI review requested due to automatic review settings August 17, 2026 18:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (2)

web/packages/agenta-ui/tests/unit/configAccordionSection.test.ts:35

  • titleGroupClasses relies on the SSR attribute order role="button" ... class="...". React doesn’t guarantee attribute ordering in rendered HTML, so this regex can make the test fail (or match the wrong element) after innocuous refactors or React upgrades. Extract the <div ... role="button" ...> tag first, then parse its class attribute without assuming ordering.
const titleGroupClasses = (markup: string): string[] =>
    classesFromMatch(markup, /role="button"[^>]*class="([^"]*)"/)

web/packages/agenta-ui/src/components/presentational/section/ConfigAccordionSection.tsx:380

  • When preserveTitle is enabled, the header title group becomes shrink-0 with no width cap. If the title ever exceeds the available header width, the flex item can overflow its container (and the inner truncate won’t apply because the content isn’t constrained). Adding a max-w-full cap keeps the “title has priority” behavior while preventing horizontal overflow for unexpectedly long titles.
                    className={cn(
                        "flex items-center gap-2",
                        preserveTitle ? "shrink-0" : "min-w-0",
                    )}

…-AI#6058

Extract the role=button tag before parsing its class attribute in the
accordion test, since React does not guarantee SSR attribute order.
Cap the preserved title group at max-w-full so an unexpectedly long
title can't overflow its header row.
Copilot AI review requested due to automatic review settings August 17, 2026 19:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (1)

web/packages/agenta-ui/src/components/presentational/section/ConfigAccordionSection.tsx:141

  • The preserveTitle docstring says it keeps the title “intact”, but the title text still uses truncate and can still ellipsize when it exceeds the available width (it’s just prioritized over the summary). Consider clarifying the comment so consumers understand the exact behavior.
    /** Keep the title intact and truncate the summary first. @default false */

@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: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 6b55452f-6d96-456d-a4b9-203a2a293dce

📥 Commits

Reviewing files that changed from the base of the PR and between 0af145e and e060425.

📒 Files selected for processing (3)
  • web/oss/src/components/pages/overview/agent/AgentConfigurationCard.tsx
  • web/packages/agenta-ui/src/components/presentational/section/ConfigAccordionSection.tsx
  • web/packages/agenta-ui/tests/unit/configAccordionSection.test.ts

Included review availability: Your plan includes up to 8 reviews per rolling hour; 7 remain after this review.

Comment thread web/packages/agenta-ui/tests/unit/configAccordionSection.test.ts
CodeRabbit review on PR Agenta-AI#6058: the test only checked shrink-0, missing
coverage for the max-w-full overflow guard added alongside it.
Copilot AI review requested due to automatic review settings August 17, 2026 19:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (1)

web/packages/agenta-ui/src/components/presentational/section/ConfigAccordionSection.tsx:141

  • The new preserveTitle prop docstring says it “Keep[s] the title intact”, but the implementation still applies truncate to the title and caps the title group at max-w-full, so long titles can still ellipsize when the container is too narrow. Updating the comment to reflect that this prioritizes the title over the summary (rather than guaranteeing no truncation) will avoid misleading consumers.
    /** Keep the title intact and truncate the summary first. @default false */

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

Labels

frontend size:S This PR changes 10-29 lines, ignoring generated files. tests ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(bug) The Advanced row label is truncated to "Advan…" in the agent Overview configuration rail

4 participants