Skip to content

feat(frontend): Humanize the Build tool log and dock Files as a pane - #5946

Merged
mmabrouk merged 6 commits into
release/v0.112.0from
feat/build-mode-files-pane
Aug 12, 2026
Merged

feat(frontend): Humanize the Build tool log and dock Files as a pane#5946
mmabrouk merged 6 commits into
release/v0.112.0from
feat/build-mode-files-pane

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Aug 11, 2026

Copy link
Copy Markdown
Member

Stacked PR: base is feat/agent-flat-navigation; this diff contains only the Files-pane / Build-log work.

Context

The agent playground kept two rendering registers. Build mode showed raw wire tool names, a permanently expanded step log, and approval cards headed by the raw tool name, while the humanized rendering existed only in Chat mode. Files lived in an overlay drawer that covered the conversation instead of sitting beside it.

Changes

Build mode now uses Chat's humanized register without losing debugging power, and the Files drawer becomes a docked pane.

Transcript. Tool rows show the humanized label and source in both modes; the raw wire name moved to the tooltip. Settled turns collapse to the "Used N tools" summary in Build too. Expanding it shows the rows, and in Build each row still expands to its full input/output/error blocks, so no payload is out of reach. File cards (one per file the turn wrote) now render in Build as well.

Before (Build): an always-visible gutter list of rows like mcp__agenta-tools__commit_revision.
After (Build): Used 3 tools when settled; expanded rows read Commit revision, and a click opens the payload.

Approvals. The raw-name header row is gone. Build shows the same sentence Chat had ("The agent wants to use X from Y before it can keep going") and keeps its extras: the compact body and the View trace link. One test pinned the old raw-name contract and was updated.

Files pane. The session Files drawer is now a full-height resizable pane docked right of the whole chat column (session bar included), 420 to 1600 px wide. Inside it the layout is mirrored: file tree on the right, content on the left, toolbar reversed to match, and its header is pinned to the session bar's 48 px so the border reads as one line. A « button in the session bar opens it and flips to »; the pane header's » collapses it. The open flag is panel-scoped, so adding or switching sessions no longer closes the pane; the previewed file stays per session. Every opener converges on the pane: in-thread file cards, chat file links, the context rail, the inspector's runtime lens, and the config panel's Files section (whose "N files" header now toggles it). The overlay drawer remains only for the agent overview host.

Mode switch. The Build/Chat segmented control is parked behind SHOW_MODE_SWITCH = false in the playground header. All Chat-mode code stays for its return.

Tests

  • vitest suites for AgentChatSlice and Drives pass (34 files, 362 tests), including the updated ApprovalDock contract tests.
  • tsc --noEmit clean; changed files linted and formatted.
  • Verified live on the dev stack through two rounds of screenshot review.

What to QA

  • Open an agent playground and run a turn that uses tools. The settled turn shows a "Used N tools" line; expanding it shows humanized rows; clicking a row reveals input/output blocks.
  • Trigger a tool approval. The card reads as a sentence with the friendly tool name; View trace still shows in Build.
  • Click « in the session bar. The Files pane opens with the tree on the right; the button now shows ». Add a session with +: the pane stays open.
  • In the config panel, click the Files header ("N files"). The pane opens; click again and it closes. Clicking a file row opens the pane preselected on that file.
  • Regression: the agent overview page's files card still opens the overlay drawer, and the Turn Inspector still opens and resizes independently of the Files pane.

@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Aug 11, 2026
@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
agenta-documentation Error Error Aug 12, 2026 9:21am

Request Review

@dosubot dosubot Bot added enhancement New feature or request frontend ux labels Aug 11, 2026
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • release/.*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: ca28014b-3009-4d9d-abd3-6e56760a629a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added a docked, session-specific Files pane alongside chat.
    • Added pane toggling, quick file previews, staged-file handling, and resizable layouts.
    • Added compact mirrored file navigation for in-chat viewing.
  • Improvements

    • Humanized tool and approval labels now provide clearer descriptions.
    • File activity remains available in detailed conversation views.
    • Improved download controls with icon-only buttons, tooltips, and accessibility labels.
    • Added smoother lazy loading, skeleton states, and transitions for chat content.
    • Build mode is now the only available mode in the Playground.

Walkthrough

The PR replaces the session files drawer with a docked, resizable Files pane. It updates drive navigation, chat integration, tool and approval rendering, download controls, and Playground mode-switch visibility.

Changes

Docked session Files pane

Layer / File(s) Summary
Files pane foundation
web/oss/src/components/AgentChatSlice/components/RightPanel/RightPanelSplit.tsx, web/oss/src/components/AgentChatSlice/state/rightPanel.ts, web/oss/src/components/Drives/*
The drive explorer supports mirrored layouts, configurable sizing, collapse controls, compact tree widths, and session Files pane state.
Chat and drive integration
web/oss/src/components/AgentChatSlice/AgentChatPanel.tsx, web/oss/src/components/AgentChatSlice/AgentConversation.tsx, web/oss/src/components/AgentChatSlice/components/OpenFilesPaneButton.tsx, web/oss/src/components/AgentChatSlice/components/Inspector/lenses/RuntimeLens.tsx, web/oss/src/components/Drives/StorageFilesHeader.tsx, web/oss/src/components/Drives/StorageSection.tsx, web/oss/src/components/Drives/configDrive.ts
Chat and drive surfaces open, close, toggle, and populate the shared session Files pane. The embedded drawer and drawer request atom are removed.

Chat activity presentation

Layer / File(s) Summary
Approval and tool activity rendering
web/oss/src/components/AgentChatSlice/components/ApprovalDock.tsx, web/oss/src/components/AgentChatSlice/components/ApprovalDock.test.tsx, web/oss/src/components/AgentChatSlice/components/ToolActivity.tsx
Approval cards use humanized descriptions without raw tool or source labels. Tool rows use humanized summaries, file cards, live timelines, and expandable settled details.

Playground mode switch

Layer / File(s) Summary
Mode selector visibility
web/oss/src/components/Playground/Components/PlaygroundHeader/index.tsx
The Build/Chat selector is hidden while the existing mode state and rendering logic remain available behind SHOW_MODE_SWITCH.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant AgentChatPanel
  participant SessionFilesPane
  participant DriveExplorer
  participant StorageSection
  User->>AgentChatPanel: toggle Files pane
  AgentChatPanel->>SessionFilesPane: open or close active session
  SessionFilesPane->>DriveExplorer: render session drive
  User->>StorageSection: select or drop file
  StorageSection->>SessionFilesPane: set quick look or staged file
  SessionFilesPane->>DriveExplorer: update selected file state
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 60.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the two main changes: humanized Build tool logs and a docked Files pane.
Description check ✅ Passed The description directly explains the Build log, approval, Files pane, mode switch, testing, and QA changes.
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 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/build-mode-files-pane

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.

@mmabrouk

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-pr-5946.up.railway.app/w
Project agenta-oss-clone-spike
Image tag pr-5946-e91f803
Status Deployed
Railway logs Open logs
Workflow logs View workflow run
Updated at 2026-08-12T09:33:40.187Z

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/oss/src/components/Drives/StorageFilesHeader.tsx (1)

40-46: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Expose the toggle state to assistive technology.

Both buttons now toggle the docked Files pane instead of opening a drawer. Neither button reports its state. OpenFilesPaneButton sets aria-pressed for the same pane. Read open from the hook and set aria-expanded on both buttons so screen-reader users learn whether the pane is currently shown.

♿ Proposed fix
-    const {toggle: togglePane} = useSessionFilesPane(sessionId)
+    const {open: paneOpen, toggle: togglePane} = useSessionFilesPane(sessionId)

Then add the attribute to each button:

                 <button
                     type="button"
+                    aria-expanded={paneOpen}
                     onClick={(e) => {
                         e.currentTarget.blur()
                         togglePane()
                     }}

Also applies to: 59-66

🧹 Nitpick comments (2)
web/oss/src/components/AgentChatSlice/components/ApprovalDock.tsx (1)

334-336: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep explanatory comments to one short line.

Replace or remove these multi-line comments. The code already expresses the normal UI behavior.

  • web/oss/src/components/AgentChatSlice/components/ApprovalDock.tsx#L334-L336: use one short comment for the humanized prompt condition.
  • web/oss/src/components/AgentChatSlice/components/ApprovalDock.test.tsx#L231-L232: remove the redundant test comment or reduce it to one short line.
  • web/oss/src/components/AgentChatSlice/components/ToolActivity.tsx#L148-L150: reduce the ToolRow documentation comment.
  • web/oss/src/components/AgentChatSlice/components/ToolActivity.tsx#L161-L174: reduce the label and summary behavior comments.
  • web/oss/src/components/AgentChatSlice/components/ToolActivity.tsx#L283-L293: reduce the ToolActivityProps and rendering-mode documentation.
  • web/oss/src/components/AgentChatSlice/components/ToolActivity.tsx#L303-L306: reduce the file-card behavior comment.
  • web/oss/src/components/AgentChatSlice/components/ToolActivity.tsx#L322-L323: reduce the live-timeline comment.

As per coding guidelines, “Keep in-code comments to at most one short line; use longer comments only for genuinely surprising constraints such as bugs, races, or ordering requirements.”

Source: Coding guidelines

web/oss/src/components/AgentChatSlice/AgentChatPanel.tsx (1)

314-331: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Memoize the items array passed to Tabs.

items is an inline array of objects that contain JSX. AgentChatPanel now re-renders whenever the files pane opens, closes, or resizes, so this array and every conversation element are rebuilt on each of those renders. Wrap it in useMemo. The dependencies are sessions, entityId, and the stable composerRevealPlayedRef.

The coding guidelines state: "Memoize inline arrays containing objects or JSX when passing them as props to avoid unnecessary rerenders."

♻️ Proposed refactor

Add the memo near the other derived values:

const tabItems = useMemo(
    () =>
        sessions.map((session) => ({
            key: session.id,
            // Bar is rendered by `renderTabBar` (SessionTagBar); the per-item label is unused.
            label: null,
            children: (
                <Suspense fallback={<ConversationSkeleton />}>
                    <MountFade className="h-full min-h-0 w-full">
                        <AgentConversation
                            entityId={entityId}
                            sessionId={session.id}
                            revealPlayedRef={composerRevealPlayedRef}
                        />
                    </MountFade>
                </Suspense>
            ),
        })),
    [sessions, entityId],
)

Then pass it through:

-                        items={sessions.map((session) => ({
-                            key: session.id,
-                            // Bar is rendered by `renderTabBar` (SessionTagBar); the per-item label is unused.
-                            label: null,
-                            children: (
-                                // The heavy conversation body hydrates behind its own transcript/composer
-                                // skeleton (same shape the frame reserves) and eases in over it.
-                                <Suspense fallback={<ConversationSkeleton />}>
-                                    <MountFade className="h-full min-h-0 w-full">
-                                        <AgentConversation
-                                            entityId={entityId}
-                                            sessionId={session.id}
-                                            revealPlayedRef={composerRevealPlayedRef}
-                                        />
-                                    </MountFade>
-                                </Suspense>
-                            ),
-                        }))}
+                        items={tabItems}

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: a154961f-5233-4e31-9bd6-565a63ff1211

📥 Commits

Reviewing files that changed from the base of the PR and between 194a28d and 01bfe99.

📒 Files selected for processing (23)
  • web/oss/src/components/AgentChatSlice/AgentChatPanel.tsx
  • web/oss/src/components/AgentChatSlice/AgentConversation.tsx
  • web/oss/src/components/AgentChatSlice/components/ApprovalDock.test.tsx
  • web/oss/src/components/AgentChatSlice/components/ApprovalDock.tsx
  • web/oss/src/components/AgentChatSlice/components/Inspector/lenses/RuntimeLens.tsx
  • web/oss/src/components/AgentChatSlice/components/OpenFilesPaneButton.tsx
  • web/oss/src/components/AgentChatSlice/components/RightPanel/RightPanelSplit.tsx
  • web/oss/src/components/AgentChatSlice/components/ToolActivity.tsx
  • web/oss/src/components/AgentChatSlice/state/rightPanel.ts
  • web/oss/src/components/Drives/DriveExplorer.tsx
  • web/oss/src/components/Drives/DriveFileContentViewer.tsx
  • web/oss/src/components/Drives/DriveHeader.tsx
  • web/oss/src/components/Drives/DriveToolbar.tsx
  • web/oss/src/components/Drives/DriveTreePane.tsx
  • web/oss/src/components/Drives/FilesDrawer.tsx
  • web/oss/src/components/Drives/SessionFilesDrawer.tsx
  • web/oss/src/components/Drives/SessionFilesPane.tsx
  • web/oss/src/components/Drives/StorageFilesHeader.tsx
  • web/oss/src/components/Drives/StorageSection.tsx
  • web/oss/src/components/Drives/configDrive.ts
  • web/oss/src/components/Drives/driveTreeView.ts
  • web/oss/src/components/Drives/useDriveTreePane.ts
  • web/oss/src/components/Playground/Components/PlaygroundHeader/index.tsx

Comment thread web/oss/src/components/AgentChatSlice/AgentChatPanel.tsx
Comment thread web/oss/src/components/Drives/StorageSection.tsx
@mmabrouk

Copy link
Copy Markdown
Member Author

Addressed the review in c7b36a7: the config quick-look guard (Major) is fixed, both config Files toggles now set aria-expanded, and the flagged comments are trimmed to the one-line rule. The nested-minimums note is answered inline (narrow viewports are already below the playground's usable minimum). @coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

@mmabrouk: I will review the updates in c7b36a7.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@mmabrouk
mmabrouk force-pushed the feat/agent-flat-navigation branch 2 times, most recently from 523886e to 22a4a5e Compare August 12, 2026 08:28
@mmabrouk
mmabrouk force-pushed the feat/build-mode-files-pane branch from c7b36a7 to ae52f4d Compare August 12, 2026 08:37

@mmabrouk mmabrouk left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

lgtm

@mmabrouk mmabrouk added the lgtm This PR has been approved by a maintainer label Aug 12, 2026
@mmabrouk
mmabrouk force-pushed the feat/agent-flat-navigation branch from 88a13ef to d43972c Compare August 12, 2026 09:03
… as a pane

Build mode now reads like Chat without losing debugging power: humanized
tool names with the raw wire name in tooltips, the collapsed 'Used N
tools' summary with per-row payload expanders, in-thread file cards, and
the humanized approval sentence. The Build/Chat switch is parked behind a
flag (Chat code stays). The Files drawer becomes a full-height resizable
pane docked right of the chat column (tree right, content left), driven
by one panel-scoped open flag so session switches keep it open; the
config panel's Files section and all chat openers land in the same pane.
… trim comments

CodeRabbit round 1: clicking a config Files row before any session ran
wrote the quick-look into an orphaned atom bucket and nothing opened —
now it opens the pane at the root instead. The config Files toggles
announce aria-expanded, and flagged comments shrink to the one-line rule.
…l, seam polish

Config pane and Files pane are now mutually exclusive (opening one
collapses the other). The config Files header opens the overlay browse
drawer again, while a file row opens the docked pane on just that file
(tree collapsed). The session bar chevron hides while the pane is open
(the pane header owns the collapse), the pane divider adopts the
playground hairline+grip so all seams match, the agent generation
section stops reserving a scrollbar gutter (the dead strip right of the
chat), and the two right-edge tooltips render leftward so they cannot
flash a horizontal scrollbar.
Config pane and Files pane are exclusive only when the window cannot fit
both fairly: below sidebar(255) + config(440) + transcript floor(460) +
files min(420) + seams = 1600px, opening one collapses the other and
shrinking across the threshold with both open keeps Files (the surface
the user opened deliberately) and tucks the config away. At or above it
both stay open. Window width on purpose — the threshold assumes the nav
sidebar at its default width.
@mmabrouk
mmabrouk force-pushed the feat/agent-flat-navigation branch from d43972c to 3916fda Compare August 12, 2026 09:16
The config panel's overlay scrollbar hugged the panel edge at z-20 —
inside the splitter dragger's 6px hit strip and above its z-5 — so
grabbing the resize grip grabbed a vertical scrollbar instead. Inset the
track past the dragger so the two never overlap.
@mmabrouk
mmabrouk force-pushed the feat/build-mode-files-pane branch from 3682c35 to 9a450fb Compare August 12, 2026 09:16
… on wide screens

min was 20% of the splitter while max stayed a fixed 440px, so any
window wider than ~2200px computed min > max: the panel mounted at the
percentage min (700px+ on 4K), the first drag snapped it to 440, and the
divider was then pinned. Both bounds are pixels now (340 to 640) so the
default 440 sits inside a real drag range on every screen.
@mmabrouk
mmabrouk changed the base branch from feat/agent-flat-navigation to release/v0.112.0 August 12, 2026 09:22
@mmabrouk
mmabrouk merged commit 91c8379 into release/v0.112.0 Aug 12, 2026
38 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request frontend lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files. ux

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant