Skip to content

[feat] Put the Advanced drawer on a section rail - #6520

Open
ashrafchowdury wants to merge 7 commits into
release/v0.114.8from
refactor/advanced-drawer-section-rail
Open

[feat] Put the Advanced drawer on a section rail#6520
ashrafchowdury wants to merge 7 commits into
release/v0.114.8from
refactor/advanced-drawer-section-rail

Conversation

@ashrafchowdury

@ashrafchowdury ashrafchowdury commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Context

The Advanced drawer stacked its three groups (Permissions, Execution, Build kit) as accordions in an 880px drawer, so auditing a configuration meant opening and closing them one at a time. Design 1a replaces that with the same section rail the tool and trigger drawers already use.

Two things surfaced while building it. The drawer's chrome kept restating what the panel already showed, and the permission fields offered their suggestions through a native <datalist>, which the browser draws in its own style and opens on its own terms.

Changes

The rail. Permissions / Execution / Build kit now sit in a left rail beside one panel at a time, in a 560px drawer. RailField gains a stacked layout, selected through a context, so the sandbox, Claude and Pi permission controls keep rendering their own rows unchanged. The build-kit block drops its accordion chrome for a plain panel with the enable switch in its header.

SectionRail also gains a bleed prop that runs the divider past the drawer's vertical body padding, so it meets the header and footer rules instead of floating between them.

The chrome. Dropped the header icon, the "Draft — applies on save" footer note and the Build kit rail's amber dot. Each restated something already on screen. The drawer's side inset goes from 16px to 12px, the rail-to-divider gap from 12px to 8px, and the rail toggles' side padding from 10px to 8px. The footer note came off SectionDrawer's default, so the Model drawer loses it and takes the same insets.

The chip inputs. ChipsInput offered its suggestions through a native <datalist>. That draws an unstyled OS popup, opens on the browser's terms rather than the field's, and cannot be driven from our own keyboard handling. The box also reserved 24px on the right for a caret it never drew.

Before:

<input list={listId} />
<datalist id={listId}>{options.map(o => <option value={o} />)}</datalist>

After: a Popover with a role=listbox panel and aria-activedescendant, the same pattern Combobox uses. It opens on focus, filters as you type, hides values already chipped, and takes arrows, Enter and Escape.

One trap worth naming for the reviewer. The input lives in the popover's anchor, not its content, so every click and focus inside the field reads to Radix as an interaction outside the layer. Without a guard, the list dismissed on the tail of the very click that opened it. onPointerDownOutside and onFocusOutside now check whether the event came from the field, and the input is focused by hand on mousedown rather than by the browser mid-gesture.

Free text still chips on Enter. The options are suggestions, not a closed set.

Row typography. ItemRow's name drops from semibold to normal weight; at 13px it read as a heading in a list of them. The build kit's enable switch was the default size while every per-tool switch under it is small, so they now match. The build-kit caption goes from three lines to two.

ItemRow is shared, so the tools, subagents, skills and MCP lists take the lighter name too.

Tests

  • pnpm lint-fix and tsc --noEmit on @agenta/entity-ui are both clean.
  • Verified every change in the running app, not a component harness. The rail divider measures exactly onto the header rule and the footer rule. The suggestion list opens on click and stays open, dismisses on an outside click, closes on Escape while leaving the drawer open, narrows to Read / Write / Grep when you type r, and produces chips from both a clicked suggestion and free text.
  • No unit tests added. These are presentational changes plus one interaction rebuilt on an existing primitive pattern.
  • Demo capture is outstanding. I confirmed all of the above against the local dev server but cannot export screenshots from the in-app browser.

What to QA

  • Open an agent's configuration and click Advanced. The three groups are a left rail showing one panel at a time, and the divider between rail and panel runs from the header rule to the footer rule with no gap at either end.
  • On Permissions, click the Allow field. The suggestion list opens in the app's own dropdown style and stays open. Type r and it narrows. Click a suggestion and it becomes a chip.
  • Type a value that is not in the list, such as Bash(npm run:*), and press Enter. It still becomes a chip.
  • Press Escape with the list open. The list closes and the drawer stays open.
  • Open Build kit. The master switch is the same size as the per-tool switches, and the tool names are normal weight.
  • Regression: open the Model drawer. It has lost the "Draft — applies on save" note and takes the same side insets, but is otherwise unchanged.
  • Regression: the commit modal and the trigger drawers' Pinned/Deployed axis use the same SectionRail. Their toggles are 2px tighter on each side but should otherwise look and behave as before.

Preview

image

The three Advanced groups were stacked accordions in an 880px drawer, so
auditing a configuration meant opening and closing them one at a time.
Design 1a replaces them with the same section rail the tool and trigger
drawers use: Permissions / Execution / Build kit, one panel at a time, in
a 560px drawer.

RailField gains a stacked layout, selected through a context so the
sandbox, Claude and Pi permission controls keep rendering their own rows
unchanged. The build-kit block drops its accordion chrome for a plain
panel with the enable switch in its header.
Drop the header icon, the "Draft — applies on save" footer note and the
Build kit rail's amber dot: each restated something the drawer already
shows, and together they crowded a panel whose job is to stay quiet.

Run the rail divider the full height of the body so it meets the header
and footer rules instead of floating between them, and close up the
space around the rail — the drawer's side inset drops to 12px (the
vertical 16 stays, since that is what the divider's bleed negates), the
gap to the divider to 8px, and the toggles' own side padding to 8px.

The footer note came off SectionDrawer's default, so the Model drawer
loses it and takes the same insets.
ChipsInput offered its suggestions through a native <datalist>, which
draws an unstyled OS popup, opens on the browser's terms rather than the
field's, and can't be driven from our own keyboard handling. The box
also reserved 24px on the right for a caret it never drew.

Build the list here instead, on the Popover + role=listbox +
aria-activedescendant pattern Combobox already uses: it opens on focus,
filters as you type, hides values already chipped, and takes arrows,
Enter and Escape. Free text still chips on Enter — the options are
suggestions, not a closed set — and the caret (with its inset) now
appears only where there are suggestions to show.

The input lives in the popover's ANCHOR, so every click and focus inside
the field reads as an interaction OUTSIDE the layer and would dismiss
the list on the tail of the very click that opened it. Guard both
outside paths on whether the event came from the field, and focus the
input by hand off the box chrome rather than letting the browser do it
mid-gesture. Escape is swallowed while the list is open so it closes the
list and not the drawer around it.

Shared by the permission fields, SchemaForm and ParameterNodeEditor.
…d its caption

The item row's name was semibold at 13px, which read as a heading in a
list of them and competed with the panel titles above it — drop it to
normal weight.

The build kit's enable switch was the default size while every per-tool
switch under it is small, so the block's master control looked heavier
than the rows it governs. Match them.

Cut the build-kit caption from three lines to two: the heading already
says "playground", and the tools list below says what the kit holds, so
the caption only has to place the tools and say they never ship.

ItemRow is shared, so the tools, subagents, skills and MCP lists take
the lighter name too.
@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
agenta-documentation Ready Ready Preview Sep 4, 2026 6:24am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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

Run ID: ec52f510-7add-488b-b30f-020c0c3a0af7

📥 Commits

Reviewing files that changed from the base of the PR and between 8e72373 and 7ec5fca.

📒 Files selected for processing (5)
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/SectionDrawer.tsx
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useModelHarness.tsx
  • web/packages/agenta-entity-ui/src/drawers/shared/RailField.tsx
  • web/packages/agenta-entity-ui/src/drawers/shared/SectionRail.tsx
  • web/packages/agenta-entity-ui/src/gatewayTool/components/schemaFormControls.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/SectionDrawer.tsx
  • web/packages/agenta-entity-ui/src/gatewayTool/components/schemaFormControls.tsx
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useModelHarness.tsx
  • web/packages/agenta-entity-ui/src/drawers/shared/SectionRail.tsx

Included review availability: Your plan provides up to 8 included reviews per hour; 3 remain after this review.


📝 Summary

Summary by CodeRabbit

  • New Features
    • Advanced settings now use a streamlined panel navigator for Permissions, Execution, and Build kit sections.
    • Tag inputs provide keyboard-accessible suggestions with improved focus, navigation, and dismissal behavior.
    • Build kit controls retain tool toggles, bulk actions, permission details, and disabled-state handling.
  • UI Improvements
    • Advanced drawer width adapts to the configuration.
    • Drawers and section navigation feature updated spacing, alignment, icons, and content layouts.
    • Simplified drawer footers emphasize Cancel and Save actions.
    • Labels and item text have improved focus states, truncation, and visual weight.

Walkthrough

The PR updates agent configuration drawers with dynamic sizing, rail-based advanced panels, stacked field layouts, and a plain build-kit layout. It also replaces ChipsInput datalist suggestions with an accessible Popover listbox.

Changes

Agent configuration drawer

Layer / File(s) Summary
Drawer layout primitives
web/packages/agenta-entity-ui/src/drawers/shared/RailField.tsx, web/packages/agenta-entity-ui/src/drawers/shared/SectionRail.tsx, web/packages/agenta-entity-ui/src/drawers/shared/index.ts
RailField supports rail and stacked layouts. SectionRail supports item icons and divider bleed. FieldLayoutProvider is re-exported.
Advanced drawer navigation
web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useModelHarness.tsx, web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/SectionDrawer.tsx, web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/AgentTemplateControl.tsx
The advanced drawer uses schema-gated rail panels and a dynamic width of 560 pixels. The drawer footer contains only right-aligned Cancel and Save buttons.
Build-kit panel presentation
web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/BuildKitSection.tsx, web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useBuildKit.tsx, web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/ItemRow.tsx, web/storybook/stories/entity-ui/BuildKitSection.stories.tsx
The build-kit section uses plain flex-based sections. The hook returns buildKitEnabled. Storybook stories use the updated panel structure.

Chip input suggestions

Layer / File(s) Summary
Popover suggestion list
web/packages/agenta-entity-ui/src/gatewayTool/components/schemaFormControls.tsx
ChipsInput uses a Popover listbox with filtered suggestions, keyboard navigation, focus handling, and combobox ARIA attributes.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 7ec5f

This updates agent configuration drawer layouts and chip suggestions, including keyboard-accessible changed-field detail controls. No concrete current-head merge-blocking risk remains.

Sequence Diagram(s)

Advanced drawer flow

sequenceDiagram
  participant AgentTemplateControl
  participant useModelHarness
  participant SectionRail
  participant SectionDrawer
  AgentTemplateControl->>useModelHarness: read advanced panels and drawer width
  useModelHarness->>SectionRail: render active advanced panel navigation
  SectionRail->>useModelHarness: select panel
  useModelHarness->>SectionDrawer: provide active panel body
Loading

Chip suggestion flow

sequenceDiagram
  participant User
  participant ChipsInput
  participant Popover
  User->>ChipsInput: type query or use arrow keys
  ChipsInput->>Popover: update filtered suggestion list
  User->>Popover: select suggestion or press Enter
  Popover->>ChipsInput: return selected value
  ChipsInput->>ChipsInput: add chip and update input state
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 45.45% which is insufficient. The required threshold is 60.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 11 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely identifies the main change: moving the Advanced drawer to a section rail.
Description check ✅ Passed The description directly explains the section rail migration, related UI changes, ChipsInput redesign, accessibility updates, testing, and QA steps.
  • Fix all pre-merge checks with AI
✨ 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 refactor/advanced-drawer-section-rail

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.

At 132px the rail's labels sat tight against their icons with the column
ending well short of the panel it introduces. 16px more gives the three
labels room without taking a meaningful bite out of the panel.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
web/packages/agenta-entity-ui/src/gatewayTool/components/schemaFormControls.tsx (1)

240-247: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use one short line for each new code comment. As per coding guidelines, “At most ONE short line per comment.”

Also applies to: 273-274, 321-323, 333-334, 390-391, 414-415

Source: Coding guidelines

web/packages/agenta-entity-ui/src/drawers/shared/RailField.tsx (1)

30-31: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Apply the one-line comment rule to all new source comments.

Shorten each listed multi-line comment to one short line.

  • web/packages/agenta-entity-ui/src/drawers/shared/RailField.tsx#L30-L31: shorten the FieldLayoutContext comment.
  • web/packages/agenta-entity-ui/src/drawers/shared/SectionRail.tsx#L43-L47: shorten the bleed documentation.
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useModelHarness.tsx#L766-L768: shorten the rail-panel comment.
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useModelHarness.tsx#L845-L847: shorten the divider comment.
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useModelHarness.tsx#L859-L860: shorten the focus-filter comment.
    As per coding guidelines, “Hard rule. At most ONE short line per comment.”

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Team

Run ID: 3a45dd4a-aec8-4337-a8ea-127e1529850a

📥 Commits

Reviewing files that changed from the base of the PR and between ded2cc3 and 289b4dd.

📒 Files selected for processing (11)
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/AgentTemplateControl.tsx
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/SectionDrawer.tsx
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/BuildKitSection.tsx
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/ItemRow.tsx
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useBuildKit.tsx
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useModelHarness.tsx
  • web/packages/agenta-entity-ui/src/drawers/shared/RailField.tsx
  • web/packages/agenta-entity-ui/src/drawers/shared/SectionRail.tsx
  • web/packages/agenta-entity-ui/src/drawers/shared/index.ts
  • web/packages/agenta-entity-ui/src/gatewayTool/components/schemaFormControls.tsx
  • web/storybook/stories/entity-ui/BuildKitSection.stories.tsx

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

Comment thread web/packages/agenta-entity-ui/src/drawers/shared/RailField.tsx Outdated
The changed-label trigger was a span with role="button", which sets the
ARIA contract without making the element focusable. Keyboard users could
neither open the committed-value popover nor reach its Restore button.

Use a real button, stripped to the label's own type and colour, with a
focus-visible ring so it shows where the focus lands.
web/AGENTS.md sets a hard one-short-line rule for in-code comments, and
this branch added several multi-line blocks narrating why. Trim them to
a line each, keeping only the two that record a real trap: the popover
anchor Radix reads as "outside", and the drawer padding the rail's bleed
negates.
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-pr-6520.up.railway.app/w
Project agenta-oss-clone-spike
Image tag pr-6520-c8677d8
Status Deployed
Railway logs Open logs
Workflow logs View workflow run
Updated at 2026-09-04T06:32:04.405Z

@ashrafchowdury
ashrafchowdury changed the base branch from main to release/v0.114.8 September 4, 2026 12:45
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