Skip to content

refactor(frontend): Move the PanelSection family into @agenta/ui - #5768

Closed
ardaerzin wants to merge 1 commit into
feat/mobile-parity-and-consolidationfrom
pkg/ui-surfaces
Closed

refactor(frontend): Move the PanelSection family into @agenta/ui#5768
ardaerzin wants to merge 1 commit into
feat/mobile-parity-and-consolidationfrom
pkg/ui-surfaces

Conversation

@ardaerzin

Copy link
Copy Markdown
Contributor

Context

Bottom lane of the sessions/agents UX stack (plan: docs/design/sessions-packages/plan.md, included here). The Home, overview, templates and sessions pages all speak one "section language" (surface, scroll area, section header with a right-aligned action). That family lived in the oss app, so nothing outside it (and later, mobile) could reuse it.

Changes

PanelSurface, PanelScroll, PanelSection and PANEL_ACTION_CLASS move to @agenta/ui's presentational layout layer. They were already antd-free. Two behaviors are documented in the code and preserved: sticky section headers need an opaque background (rows scroll through rgba fills), and a scroll container with padding-top cannot host a top-0 sticky child, so the sticky element supplies its own top spacing. RichChatInput picks up the composer fill (colorFillTertiary) so composers read as fields, not outlines.

Tests / notes

  • pnpm turbo run build --filter=@agenta/ui passes; @agenta/oss tsc is clean on this lane.
  • No consumers change in this PR; the app lanes above adopt the new import path.

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 6, 2026
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview Aug 6, 2026 1:24pm

Request Review

@dosubot dosubot Bot added frontend refactor A code change that neither fixes a bug nor adds a feature labels Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

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

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 90b93020-562c-4a45-96f0-05dea16371e1

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 reusable panel layout components with transparent surfaces, scrolling areas, structured sections, sticky headers, actions, and configurable spacing.
    • Added session and agent interface designs, including session lists, filters, pins, agent cards, and trigger sections.
    • Documented a package organization plan for sessions, agents, templates, overview, and application surfaces.
  • Style

    • Updated the rich chat composer background styling for improved visual consistency.

Walkthrough

The change documents package extraction for sessions and agent surfaces. It adds shared panel layout primitives and public exports. It also updates the RichChatInput background token.

Changes

Sessions package extraction and UI foundation

Layer / File(s) Summary
Package boundaries and extracted surfaces
docs/design/sessions-packages/plan.md
The plan assigns session orchestration, session UI, agent UI, and application responsibilities across packages.
Shared panel layout primitives
docs/design/sessions-packages/plan.md, web/packages/agenta-ui/src/components/presentational/layout/PanelSection.tsx, web/packages/agenta-ui/src/components/presentational/layout/index.tsx, web/packages/agenta-ui/src/components/presentational/index.ts
The plan defines panel behavior. The UI package adds transparent surfaces, bounded scrolling, section variants, sticky headers, action styling, body styling, and public exports.
Application sequencing and validation
docs/design/sessions-packages/plan.md
The plan sequences application migration lanes and defines package, lint, build, import, and mobile migration checks.

Composer surface styling

Layer / File(s) Summary
Composer background token
web/packages/agenta-ui/src/RichChatInput/RichChatInput.tsx
The composer container changes from --ag-colorBgContainer to --ag-colorFillTertiary.

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

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: moving the PanelSection family into @agenta/ui.
Description check ✅ Passed The description accurately explains the package move, preserved behaviors, RichChatInput update, and validation results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pkg/ui-surfaces

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 Aug 6, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Status Destroyed (PR closed)

Updated at 2026-08-09T16:56:33.460Z

@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 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.

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

🧹 Nitpick comments (3)
web/packages/agenta-ui/src/RichChatInput/RichChatInput.tsx (1)

215-217: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Shorten the in-code rationale.

This three-line comment exceeds the repository rule that in-code comments must be at most one short line unless they document a genuinely surprising constraint. Keep one concise explanation here and move the visual design rationale to design documentation if it must be preserved.

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

docs/design/sessions-packages/plan.md (1)

6-10: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Resolve the rail layout contract before consumers adopt it.

The plan defines one bordered rail with hairline-separated sections. web/packages/agenta-ui/src/components/presentational/layout/PanelSection.tsx instead makes PanelSurface transparent, gives each rail section its own rounded border, and adds spacing between sections. Update the plan or implementation so the shared layout contract has one border and spacing model.

web/packages/agenta-ui/src/components/presentational/layout/PanelSection.tsx (1)

48-49: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add an explicit keyboard focus state to the shared action class.

PANEL_ACTION_CLASS defines default and hover colors but no focus-visible state. Add a semantic-token focus ring or text state so a consumer that uses this shared class alone still exposes keyboard focus.

As per coding guidelines, “Implement light and dark appearance and interaction states for every added or changed UI element.”

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2a9d51ce-cad4-4d4b-ac41-9d8f93fb32b6

📥 Commits

Reviewing files that changed from the base of the PR and between 1185ee2 and f800d4a.

📒 Files selected for processing (5)
  • docs/design/sessions-packages/plan.md
  • web/packages/agenta-ui/src/RichChatInput/RichChatInput.tsx
  • web/packages/agenta-ui/src/components/presentational/index.ts
  • web/packages/agenta-ui/src/components/presentational/layout/PanelSection.tsx
  • web/packages/agenta-ui/src/components/presentational/layout/index.tsx

Comment thread docs/design/sessions-packages/plan.md Outdated
@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 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.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@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

🧹 Nitpick comments (2)
web/packages/agenta-ui/src/components/presentational/layout/PanelSection.tsx (1)

3-14: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Shorten the visual-design rationale comments.

Lines 3-14 and Lines 44-50 describe design history and rationale. Keep one short component-purpose comment in the source. Put longer design rationale in design documentation.

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.”

Also applies to: 44-50

Source: Coding guidelines

docs/design/sessions-packages/plan.md (1)

20-23: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Include @agenta/entity-ui in the layering contract.

The diagram omits @agenta/entity-ui, but Lane 4 defines it as a package with a public ./agent subpath. Show it as a branch after @agenta/entities, or explain why it is outside this dependency graph.

Proposed diagram update
-@agenta/shared → `@agenta/ui` → `@agenta/entities` → `@agenta/sessions` → `@agenta/sessions-ui`
+@agenta/shared → `@agenta/ui` → `@agenta/entities`
+                                  ├→ `@agenta/entity-ui`
+                                  └→ `@agenta/sessions` → `@agenta/sessions-ui`

As per coding guidelines, workspace packages must respect the hierarchy shared ← ui ← entities ← entity-ui ← playground ← playground-ui.

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9d4e37fa-105c-462a-84e1-393c406bee59

📥 Commits

Reviewing files that changed from the base of the PR and between 1185ee2 and 96f9e4b.

📒 Files selected for processing (5)
  • docs/design/sessions-packages/plan.md
  • web/packages/agenta-ui/src/RichChatInput/RichChatInput.tsx
  • web/packages/agenta-ui/src/components/presentational/index.ts
  • web/packages/agenta-ui/src/components/presentational/layout/PanelSection.tsx
  • web/packages/agenta-ui/src/components/presentational/layout/index.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • web/packages/agenta-ui/src/RichChatInput/RichChatInput.tsx
  • web/packages/agenta-ui/src/components/presentational/index.ts
  • web/packages/agenta-ui/src/components/presentational/layout/index.tsx

Comment thread docs/design/sessions-packages/plan.md Outdated
Comment on lines +25 to +27
`@agenta/entities/session` keeps what it owns: zod schema, `listOptions`, the query itself.
`@agenta/sessions` is new and owns **orchestration**. That boundary is what reconciles this
with the earlier "no new package for entity state" decision.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 4 \
  '\b(useSessionList|listOptions|waitingSessionIds|excludeOrigin|infiniteQuery)\b' \
  web/packages \
  --glob '*.ts' \
  --glob '*.tsx'

Repository: Agenta-AI/agenta

Length of output: 154


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Tracked files matching plan/session/session packages:\n'
git ls-files | rg -n 'session|packages|design|plan\.md' | sed -n '1,160p'

printf '\nDesign plan location:\n'
fd -a 'plan\.md' . | sed -n '1,120p'

printf '\nSearch key symbols in repository:\n'
rg -n -C 3 \
  '\b(useSessionList|listOptions|waitingSessionIds|excludeOrigin|infiniteQuery|`@agenta/entities/session`|`@agenta/sessions`)\b' \
  . \
  --glob '!node_modules' \
  --glob '!dist' \
  --glob '!build' \
  --glob '!*.lock' | sed -n '1,240p'

Repository: Agenta-AI/agenta

Length of output: 20857


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Relevant sections of docs/design/sessions-packages/plan.md:\n'
sed -n '1,220p' docs/design/sessions-packages/plan.md | nl -ba

printf '\nAll occurrences of session query/package ownership terms in plan:\n'
rg -n '\b(session query|the query itself|infinite query|session list|listOptions|`@agenta/`(entities/session|sessions))' docs/design/sessions-packages/plan.md

Repository: Agenta-AI/agenta

Length of output: 254


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Relevant sections of docs/design/sessions-packages/plan.md:\n'
cat -n docs/design/sessions-packages/plan.md | sed -n '1,220p'

printf '\nPackage ownership mentions:\n'
rg -n '\b(session query|the query itself|infinite query|session list|listOptions|`@agenta/`(entities/session|sessions))' docs/design/sessions-packages/plan.md

printf '\nPackage existence/context:\n'
git ls-files | rg -n 'packages/agenta/(packages/)?(`@agenta/`|entities/sessions?|sessions/)' || true

Repository: Agenta-AI/agenta

Length of output: 11743


Clarify which query useSessionList belongs to.

The plan assigns “the query itself” to @agenta/entities/session, but Lane 2 moves state/useSessionList.ts with “the infinite query, cursor handling, the waitingSessionIds pushdown, [and] excludeOrigin semantics” into @agenta/sessions. State whether @agenta/entities/session owns only the low-level fetch/query contract, while @agenta/sessions owns the query hook, paging, filters, groups, and derived state, or adjust the ownership assignments so the package boundary is unambiguous.
[low Effort_and_high_reward]

Source: Coding guidelines

Comment thread docs/design/sessions-packages/plan.md Outdated
- `pnpm lint-fix` clean; `pnpm --filter @agenta/oss exec tsc --noEmit` shows no new errors
(gate on the error-signature diff, not the count — it fluctuates with cache)
- Package lanes: `pnpm turbo run build --filter=@agenta/<pkg>` and their unit tests
- Lanes 1, 3, 4: grep the package for `from "antd"` → must be empty

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Use the scoped ESLint rule for the antd verification gate.

The current grep misses single-quoted imports and subpath imports such as antd/es/.... Use the package-scoped ESLint rule as the gate, and ensure the rule covers all prohibited import patterns.

Proposed verification update
-Lanes 1, 3, 4: grep the package for `from "antd"` → must be empty
+Lanes 1, 3, 4: run the package-scoped ESLint rule that forbids all prohibited `antd` imports; the rule must pass
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Lanes 1, 3, 4: grep the package for `from "antd"` → must be empty
- Lanes 1, 3, 4: run the package-scoped ESLint rule that forbids all prohibited `antd` imports; the rule must pass

PanelSurface, PanelScroll, PanelSection and PANEL_ACTION_CLASS graduate from the oss app into @agenta/ui's presentational layer so every surface (and later mobile) shares one section language. The composer fill on RichChatInput rides along. The sessions-packages plan doc records the lane decisions.
@mmabrouk

mmabrouk commented Aug 9, 2026

Copy link
Copy Markdown
Member

Landed in release/v0.112.0 as part of the 0.112.0 release. The release branch now contains this work at commit ae71a92. Closing here since there is nothing left to merge.

@mmabrouk mmabrouk closed this Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend refactor A code change that neither fixes a bug nor adds a feature size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants