Skip to content

[feat] Discover and expand playground files - #7346

Merged
mmabrouk merged 2 commits into
release/v0.122.1from
agent/playground-file-controls-2026-10-05
Oct 5, 2026
Merged

mmabrouk merged 2 commits into
release/v0.122.1from
agent/playground-file-controls-2026-10-05

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds the approved playground file controls to both /m/ and /w/.

  • Settings labels its summary Recent files, keeps the existing total count, and uses the same pressed-state file-pane toggle as chat. No session means an explained disabled toggle.
  • The file-pane header puts Expand files pane / Restore files pane immediately before view options. Other drive hosts keep their existing placement.
  • Expansion temporarily hides Settings, chat, the session rail and resize dividers without changing saved widths or Settings preferences. App/editor/chat components stay mounted; hidden content is inert. Close and explicit layout/session changes end expansion.
  • Adds shared state/component tests, mobile layout tests, and interactive Storybook examples.

Durable links and file-pane tabs are deliberately excluded.

Validation

Base: release/v0.122.1 at 563c455e3e9c133ef53b82ff68a144c079dbd554.

At head 2951aed36c:

  • Chat unit tests: 1,250 passed.
  • Entity UI unit tests: 1,204 passed.
  • Mobile unit tests: 393 passed.
  • OSS unit tests: 612 passed, one skipped.
  • TypeScript checks for chat, entity UI, playground UI, mobile and OSS, workspace lint (pnpm lint-fix), and Storybook lint/build passed.

Live QA and limits

Separate throwaway account and Docker Compose project playground-controls-20261005 on port 8755. No shared production account, stack or data used.

Recorded actual /m/ and /w/ checks at abc702369d cover synchronized openers, keyboard expansion/restoration, visible divider removal, expanded close, and real text-editor node/draft continuity. File writes were intercepted during the draft continuity scenario. Those recordings use both exact-head CI-built amd64 frontend images from build run 37342077784, attempt 1. /m/ phone checks pass; /w/ phone interaction is blocked by its existing minimum-screen overlay, which this change does not modify.

The review pass at 2951aed36c was rechecked on a separate standalone stack built from that head, with a throwaway account: Settings eases on the collapse button, the reveal button and both Build/Chat directions; Expand hides Settings, chat and the session rail and Restore returns every pane to its previous width on /w/ and /m/; shrinking below the coexist threshold while expanded ends expansion, leaves the Settings reveal control visible, and one Alt+C reveals Settings. Recordings and measured widths are in the review-pass PR comment.

Not verified live: real model streaming, because the available deployment reference has no configured test provider credential; running HTML app counter/bridge continuity, because the app frame remains blank before expansion in this test setup. Synthetic mounted-instance/streaming tests are not substitutes for those live scenarios. These remain QA gaps, not passing claims.

The initial webpack development setup produced an unrelated /w/ boot/CSS error. Switching the isolated deployment to the repository's normal Turbopack development mode resolved it, without repository changes.

Storybook build/lint pass. Browser interaction checks and screenshots pass for Playground Controls, Playground Narrow and AgentConfigPaneAlignment. The added play function reaches its completing phase without errors. There are no stored visual baselines for these new examples to compare.

Implicit decisions

  • Expansion keeps no copy of the Settings collapse state. If the window shrinks below the coexist threshold while files are expanded and Settings is open, the existing eviction rule collapses Settings, which ends expansion. This is the same behaviour as with both panes open, and Settings keeps its reveal control.
  • The Files region header reads Recent files everywhere, including its loading skeleton.

Follow-up

At head 2951aed36c95addf4995c087859952ab5d5fe677, 80 checks succeeded and one skipped, with none failing or pending. The runner unit test job failed once on an unrelated timing assertion in turn-admission.test.ts (1799999 vs 1800000 ms) and passed on rerun. CodeRabbit reviewed through this head and stated: “No actionable comments were generated in the recent review.” There are no inline comments or review threads to address.

Cleanup verified for both passes: the task containers, networks and volumes are removed, the review-pass images are deleted, and the shared image tags are untouched. No production deployment was performed. The remaining live HTML-app and model-streaming QA gaps above still need resolution before full acceptance.

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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: Advanced
  • Run ID: 57f68c0e-d677-46a2-bb3b-ebee54153739
📥 Commits

Reviewing files that changed from the base of the PR and between abc7023 and 2951aed.

📒 Files selected for processing (13)
  • web/mobile/src/features/chat/ConfigPane.tsx
  • web/mobile/src/features/chat/SessionWorkspace.tsx
  • web/mobile/src/features/chat/sessionPanes.ts
  • web/mobile/tests/unit/sessionPanes.test.ts
  • web/oss/src/components/AgentChatSlice/AgentChatPanel.tsx
  • web/oss/src/components/AgentChatSlice/components/OpenFilesPaneButton.tsx
  • web/oss/src/components/Playground/Components/MainLayout/index.tsx
  • web/oss/src/components/Playground/Components/PlaygroundVariantConfig/index.tsx
  • web/packages/agenta-chat/src/state/filesPaneLayout.ts
  • web/packages/agenta-chat/tests/unit/filesPaneLayout.test.tsx
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/AgentOperationsSections.tsx
  • web/packages/agenta-entity-ui/src/drive/FilesPaneToggle.tsx
  • web/packages/agenta-entity-ui/tests/unit/playgroundFileControls.test.tsx
💤 Files with no reviewable changes (2)
  • web/oss/src/components/Playground/Components/PlaygroundVariantConfig/index.tsx
  • web/mobile/src/features/chat/ConfigPane.tsx

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


📝 Summary

Summary by CodeRabbit

  • New Features
    • Expand the Files pane to fill the available workspace, then restore the previous layout without losing unsaved drafts.
    • Use a consistent Files toggle in chat and playground views, with clear labels and shortcut guidance. The toggle is unavailable until a conversation is open.
    • On phones, opening Files gives it priority over other panes.
  • Improvements
    • File counts and controls now reflect the active workspace or conversation.
    • The operational file section is labeled “Recent files.”

Walkthrough

The change adds shared files-pane controls and transient expansion state. Mobile and OSS chat layouts use that state to expand Files and adjust other panes. Storage headers can also render a files toggle when given a scope.

Changes

Files Pane Expansion

Layer / File(s) Summary
Transient expansion state
web/packages/agenta-chat/src/state/*, web/packages/agenta-chat/tests/unit/filesPaneLayout.test.tsx
A host-scoped hook tracks expansion against the open pane, session, and layout action. Writes to maximize or config-collapse preferences update the action. Tests cover toggling, restoration, and reset conditions.
Shared files-pane controls and scope
web/packages/agenta-entity-ui/src/drive/*, web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/AgentOperationsSections.tsx, web/packages/agenta-entity-ui/tests/unit/playgroundFileControls.test.tsx, web/mobile/src/features/chat/SessionTabs.tsx, web/mobile/src/features/chat/ConfigPane.tsx, web/oss/src/components/AgentChatSlice/components/OpenFilesPaneButton.tsx, web/oss/src/components/Drives/SessionFilesPane.tsx, web/oss/src/components/Playground/Components/PlaygroundVariantConfig/index.tsx, web/storybook/stories/entity-ui/*
The drive UI adds FilesPaneToggle, supports two expand-control placements, and passes expansion props through session panes. Storage headers accept an optional scope and render a toggle when one is provided. Chat and playground callers use the shared controls and pass scope. Tests and stories exercise the controls.
OSS agent chat expansion
web/oss/src/components/AgentChatSlice/AgentChatPanel.tsx, web/oss/src/components/AgentChatSlice/components/RightPanel/RightPanelSplit.tsx, web/oss/src/components/Drives/SessionFilesPane.tsx
Agent chat uses expanded state, or an open Files pane on a phone viewport, to make Files full-width. The rail becomes hidden and inert, and RightPanelSplit disables resizing and the divider when expanded.
Playground config-pane behavior
web/oss/src/components/Playground/Components/MainLayout/index.tsx
In agent mode, the config pane collapses when Files is expanded or when Files is open on a phone viewport. Expansion hides the config pane, and collapsed config content becomes inert.
Mobile workspace pane selection
web/mobile/src/features/chat/SessionWorkspace.tsx, web/mobile/src/features/chat/sessionPanes.ts, web/mobile/tests/unit/sessionPanes.test.ts
Pane resolution and workspace layout account for expanded Files. The workspace adjusts pane visibility, resizing, and inert content; tests cover expansion and restoration across layouts.

Priority: ⬇️ Low

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

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant DriveHeader
  participant SessionFilesPane
  participant AgentChatPanel
  participant useFilesPaneLayout
  participant RightPanelSplit
  User->>DriveHeader: Activate expand control
  DriveHeader->>SessionFilesPane: Invoke expansion callback
  SessionFilesPane->>AgentChatPanel: Pass toggle callback
  AgentChatPanel->>useFilesPaneLayout: Toggle expansion
  useFilesPaneLayout-->>AgentChatPanel: Return expanded state
  AgentChatPanel->>RightPanelSplit: Render full-width Files layout
Loading

Possibly related PRs

  • Agenta-AI/agenta#5946: Introduced the docked session Files pane and resizable RightPanelSplit that this change extends.

Merge Risk: ⚪ Minimal · up to 2951a

The Files controls and layouts appear consistent across the reviewed paths. No issue identified here prevents merging after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 2951a

The change is primarily presentation behavior and preserves existing session and file-access identities. Remaining uncertainty concerns transient-state recovery, not a demonstrated increase in access or privileges.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The newly introduced state can affect presentation in hosts sharing the same client state store. It does not select another tenant, session, or drive mount, grant privileges, or introduce a new file-operation endpoint. The examined access exposure remains the existing session and agent drive surface.

Trust Boundaries and Controls

  • inferred — The changed public entrypoints expose presentation actions rather than new authority. Existing session/artifact context and drive-query ownership remain the boundary between layout controls and file access. The comparison did not establish an expansion-specific bypass; server-side authorization remains outside the inspected scope.

Resilience and Maintainability Implications

  • inferred — Expansion recovery is separated from persisted layout and file ownership. A same-store remount with unchanged host, session, open state, and action can retain expansion because there is no unmount cleanup; repeated calls before rerender can also coalesce through the captured toggle state. These behaviors are bounded to presentation in the inspected consumers, not file authority or saved preferences.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.43% which is insufficient. The required threshold is 60.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 27 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 summarizes the main change: adding and expanding playground file controls.
Description check ✅ Passed The description explains the file controls, expansion behavior, testing, and known QA gaps covered by the changeset.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Website preview

Preview URL: https://pr-7346-agenta-website-preview.mahmoud-637.workers.dev

Built from 2951aed36c95addf4995c087859952ab5d5fe677. This comment updates in place on every push.

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Item Value
Status stopped
Commit 2951aed36c95addf4995c087859952ab5d5fe677
Manual expiry (UTC) Not granted
CI deadline (UTC) Not granted
Workflow https://github.com/Agenta-AI/agenta/actions/runs/37353104530

Dependent tests finished. Post /preview for manual review. Environment absence verified; retained storage requires separate provider accounting.

Post /preview as a new comment to request a one-hour preview. Repeating it while active does not extend the hour.
Preview data is disposable. Expiry is enforced by the next successful cleanup sweep, not an exact timer.
Environment deletion stops its compute. Provider-retained storage and permanent services may still be billed.

…ayer

Only full-width files take the Settings pane out of layout, so the Build/Chat
toggle and the collapse button ease again. Expansion is now a transient record
of session, layout action and expanded; the existing eviction effects own the
narrow-window case, so a collapsed Settings pane always has a reveal control.
The files toggle tooltip opens to the left beside the page edge, the Files
region is titled Recent files by default, and the tests keep only assertions
that can fail.
@mmabrouk

mmabrouk commented Oct 5, 2026

Copy link
Copy Markdown
Member Author

🤖 The AI agent says:

Review pass on 2951aed

Live QA recordings (watch first): https://claude.ai/artifact/BuVTQdLrAujGv5ETPVK2Qn (private page with the four MP4s and the measured pane widths; the browser extension that uploads video into GitHub comments was not connected, so the videos live there).

Check Result
(a) /w: Settings eases on «, », Build to Chat and Chat to Build PASS. 9 to 13 animation frames between 440 px and 0 px on each of the four actions
(b) /w: Expand hides Settings, chat and the session rail; Restore brings back the same widths PASS in Build mode and in Chat mode with the rail open. Every pane width after Restore equals the width before
(c) /w: shrink below the 1600 px coexist threshold while expanded PASS. Expansion ends, Settings collapses, the » Show configuration control is visible, one Alt+C reveals Settings (440 px)
(d) /m: Expand and Restore PASS. Settings 460 px and files 620 px before and after

Stack: a standalone EE dev stack built from this head, a throwaway account, and a fresh headless Chromium context per check.

Findings fixed

  1. Settings snapped instead of easing (web/oss/src/components/Playground/Components/MainLayout/index.tsx). paneClassName now applies hidden only for full-width files (fullWidthFiles), the same rule /m uses in SessionWorkspace.tsx. Every other collapse keeps the pane in flow, so the flex-basis ease runs again. inert={configCollapsed} stays.
  2. Settings hidden with no reveal control after a narrow restore. The retaining layer is removed: retaining, the captured configCollapsed, suppressConfig, retainedConfigCollapsed, usePaneContainerWidth, and the six !filesLayout.retaining guards on the eviction effects in both hosts. Files: web/packages/agenta-chat/src/state/filesPaneLayout.ts, web/mobile/src/features/chat/SessionWorkspace.tsx, web/mobile/src/features/chat/sessionPanes.ts (and its test), web/oss/src/components/AgentChatSlice/AgentChatPanel.tsx, MainLayout/index.tsx. useFilesPaneLayout is now a {sessionId, action, expanded} record plus toggleExpand (59 to 34 lines). The animate guards that depended on retaining are gone; none of the remaining animations fight the expansion, because the expanded panes are display: none.
  3. Tooltip side lost on the session bar's files button (web/packages/agenta-entity-ui/src/drive/FilesPaneToggle.tsx). New optional tooltipSide prop; OpenFilesPaneButton.tsx passes "left".

Volume cuts

  • storageTitle plumbing removed from AgentBuildPanel.tsx, AgentOperationsSections.tsx and both hosts. The region header is "Recent files" by default, and its loading skeleton uses the same title so the header does not change on load.
  • Removed the native title on the recent-files container in StorageSection.tsx and the dead title on the disabled button in FilesPaneToggle.tsx. The test now asserts on the tooltip text.
  • filesPaneLayout.test.tsx (118 to 110 lines): 7 tests, each can fail. Toggle flips; no width or collapse preference and no layout action is written; expansion ends on pane close, session switch, config collapse write and maximize write; a closed pane does not expand. A mutation that drops the action check fails two of them.
  • playgroundFileControls.test.tsx (113 to 100 lines): the toggle flips while the drive is loaded, loading or errored; it is disabled without a session; no toggle without a scope. The iframe, interval counter, textarea and mock-satisfied sync cases are gone. Both files set IS_REACT_ACT_ENVIRONMENT.
  • PR diff: +787 / -180 in 27 files before, +658 / -160 in 25 files now.

Accepted trade-off

If the window shrinks below the coexist threshold while files are expanded and Settings is open, the existing eviction effect collapses Settings. That write bumps the layout action counter and ends the expansion, the same thing that happens today with both panes open. Settings stays collapsed with its reveal control visible (check c), and Alt+C reveals it on the first press.

Validation

  • Unit tests: @agenta/chat 1250 passed, @agenta/entity-ui 1204 passed (one unrelated MCP drawer test timed out under load in the full run and passed 15/15 when rerun alone), @agenta/mobile 393 passed, web/oss 612 passed and 1 skipped.
  • Type checks clean for @agenta/chat, @agenta/entity-ui, @agenta/playground-ui, @agenta/mobile and web/oss.
  • pnpm lint-fix clean (28 tasks). Storybook lint and build-storybook pass.

@mmabrouk
mmabrouk merged commit a187e38 into release/v0.122.1 Oct 5, 2026
95 of 96 checks passed
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