Skip to content

feat(frontend): @agenta/sessions-ui, the session list's antd-free components - #5770

Closed
ardaerzin wants to merge 1 commit into
pkg/sessionsfrom
pkg/sessions-ui
Closed

feat(frontend): @agenta/sessions-ui, the session list's antd-free components#5770
ardaerzin wants to merge 1 commit into
pkg/sessionsfrom
pkg/sessions-ui

Conversation

@ardaerzin

Copy link
Copy Markdown
Contributor

Context

Third lane of the sessions/agents UX stack. With the rules in @agenta/sessions, the row and control markup still lived in the oss pages, styled with antd. Mobile forked before the antd migration and cannot import any of it.

Changes

New antd-free package @agenta/sessions-ui: SessionRow (driven by SessionRowVm, neutral menu shape, revealActionsOnHover so touch surfaces can keep actions visible), the list empty/error/skeleton states, group header, pager, and the four filter controls bound to useSessionFilters. Anything not yet portable stays a slot: the agent picker is still antd (EntityPicker), so the controls take it as agentPicker?: ReactNode and the app injects it. Shells stay per-surface; the package exports controls, each app owns its rail or sheet.

Eslint bans antd and the @agenta/ui root barrel (subpaths only). timeAgo graduates to @agenta/shared/utils before it grows a third copy.

Tests / notes

  • Package builds under turbo; grep 'from "antd"' src is empty; @agenta/oss tsc is clean on this lane.
  • The desktop page and rail that compose these arrive in the oss/sessions-page lane above.

@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 the frontend label 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: eb40e1e8-15f9-4550-8413-5a819012b140

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 reusable sessions interface with session rows, agent names, status indicators, relative timestamps, pinning, menus, and accessible interactions.
    • Added session search, status, automation-mode, and archived-session filters.
    • Added loading, empty, error, retry, and load-more states for session lists.
    • Added tooltips and clearer relative time displays.
    • Integrated the sessions interface into the OSS web application.

Walkthrough

Added the private @agenta/sessions-ui package. It provides reusable session rows, list states, filters, tooltips, menu types, agent names, and relative timestamps. Workspace manifests, Next.js transpilation, and Turbo tasks now include the package.

Changes

Sessions UI package

Layer / File(s) Summary
Package contract and exports
web/packages/agenta-sessions-ui/package.json, web/packages/agenta-sessions-ui/tsconfig.json, web/packages/agenta-sessions-ui/eslint.config.mjs, web/packages/agenta-sessions-ui/src/menu.ts, web/packages/agenta-sessions-ui/src/index.ts
Defines package metadata, validation settings, menu entries, and public exports.
Session display components
web/packages/agenta-sessions-ui/src/SessionRow.tsx, web/packages/agenta-sessions-ui/src/SessionAgentName.tsx, web/packages/agenta-sessions-ui/src/SessionListStates.tsx, web/packages/agenta-shared/src/utils/timeAgo.ts, web/packages/agenta-shared/src/utils/index.ts
Adds session rows with status, activity, pin, menu, and keyboard behavior. Adds agent-name rendering, list states, and relative timestamps.
Session filters and tooltips
web/packages/agenta-sessions-ui/src/controls/SessionFilterControls.tsx, web/packages/agenta-sessions-ui/src/assets/Tip.tsx
Adds search, status, mode, and archived-session controls backed by shared session filters. Adds conditional Radix tooltip rendering.
Workspace integration and task wiring
web/packages/agenta-sessions-ui/*, web/oss/package.json, web/oss/next.config.ts, web/turbo.json
Adds the OSS workspace dependency, Next.js transpilation, and Turbo build, lint, and type-check tasks for the package.

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 new antd-free @agenta/sessions-ui package, which is the primary change.
Description check ✅ Passed The description explains the new package, its components, integration constraints, lint rules, 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/sessions-ui

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:37.122Z

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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b1249531-4a27-4598-8300-ee41495305e4

📥 Commits

Reviewing files that changed from the base of the PR and between 3c7af0a and 76522bf.

⛔ Files ignored due to path filters (1)
  • web/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (15)
  • web/oss/next.config.ts
  • web/oss/package.json
  • web/packages/agenta-sessions-ui/eslint.config.mjs
  • web/packages/agenta-sessions-ui/package.json
  • web/packages/agenta-sessions-ui/src/SessionAgentName.tsx
  • web/packages/agenta-sessions-ui/src/SessionListStates.tsx
  • web/packages/agenta-sessions-ui/src/SessionRow.tsx
  • web/packages/agenta-sessions-ui/src/assets/Tip.tsx
  • web/packages/agenta-sessions-ui/src/controls/SessionFilterControls.tsx
  • web/packages/agenta-sessions-ui/src/index.ts
  • web/packages/agenta-sessions-ui/src/menu.ts
  • web/packages/agenta-sessions-ui/tsconfig.json
  • web/packages/agenta-shared/src/utils/index.ts
  • web/packages/agenta-shared/src/utils/timeAgo.ts
  • web/turbo.json

Comment thread web/packages/agenta-sessions-ui/src/SessionRow.tsx Outdated
Comment thread web/packages/agenta-sessions-ui/src/SessionRow.tsx Outdated
Comment thread web/packages/agenta-shared/src/utils/timeAgo.ts
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Aug 6, 2026
@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

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.

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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4a5c81e9-87ff-401f-b267-8c89b22230a5

📥 Commits

Reviewing files that changed from the base of the PR and between e4fcd2f and 1111e32.

⛔ Files ignored due to path filters (1)
  • web/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (15)
  • web/oss/next.config.ts
  • web/oss/package.json
  • web/packages/agenta-sessions-ui/eslint.config.mjs
  • web/packages/agenta-sessions-ui/package.json
  • web/packages/agenta-sessions-ui/src/SessionAgentName.tsx
  • web/packages/agenta-sessions-ui/src/SessionListStates.tsx
  • web/packages/agenta-sessions-ui/src/SessionRow.tsx
  • web/packages/agenta-sessions-ui/src/assets/Tip.tsx
  • web/packages/agenta-sessions-ui/src/controls/SessionFilterControls.tsx
  • web/packages/agenta-sessions-ui/src/index.ts
  • web/packages/agenta-sessions-ui/src/menu.ts
  • web/packages/agenta-sessions-ui/tsconfig.json
  • web/packages/agenta-shared/src/utils/index.ts
  • web/packages/agenta-shared/src/utils/timeAgo.ts
  • web/turbo.json
🚧 Files skipped from review as they are similar to previous changes (13)
  • web/oss/next.config.ts
  • web/packages/agenta-shared/src/utils/index.ts
  • web/packages/agenta-sessions-ui/src/index.ts
  • web/packages/agenta-sessions-ui/tsconfig.json
  • web/oss/package.json
  • web/packages/agenta-sessions-ui/eslint.config.mjs
  • web/turbo.json
  • web/packages/agenta-sessions-ui/src/menu.ts
  • web/packages/agenta-sessions-ui/src/assets/Tip.tsx
  • web/packages/agenta-shared/src/utils/timeAgo.ts
  • web/packages/agenta-sessions-ui/src/SessionAgentName.tsx
  • web/packages/agenta-sessions-ui/src/SessionListStates.tsx
  • web/packages/agenta-sessions-ui/package.json

Comment on lines +30 to +37
// An outside write (reset, another surface) must win over a stale draft.
useEffect(() => setDraft(search), [search])
useEffect(
() => () => {
if (timer.current) clearTimeout(timer.current)
},
[],
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Cancel pending search writes when search changes externally.

The effect updates draft, but it leaves the existing timeout active. If another surface resets search before the 300 ms delay expires, the timeout later writes the old value through setSearch and reverses that reset.

Clear the timer when search changes. Set the ref to null after cancellation and after the timeout callback. Add a regression test for an external update during the debounce window.

Proposed fix
     useEffect(() => setDraft(search), [search])
+    useEffect(() => {
+        if (timer.current !== null) {
+            clearTimeout(timer.current)
+            timer.current = null
+        }
+    }, [search])
...
-            if (timer.current) clearTimeout(timer.current)
+            if (timer.current !== null) {
+                clearTimeout(timer.current)
+                timer.current = null
+            }
...
-                if (timer.current) clearTimeout(timer.current)
+                if (timer.current !== null) {
+                    clearTimeout(timer.current)
+                    timer.current = null
+                }
...
-                else timer.current = setTimeout(() => setSearch(value), SEARCH_DEBOUNCE_MS)
+                else {
+                    timer.current = setTimeout(() => {
+                        timer.current = null
+                        setSearch(value)
+                    }, SEARCH_DEBOUNCE_MS)
+                }

Also applies to: 45-51

Comment on lines +54 to +70
<div
role="button"
tabIndex={openable ? 0 : -1}
onClick={handleOpen}
onKeyDown={(event) => {
// Only the row itself: the pin and menu are children, and their Enter/Space
// must not also open the session.
if (event.target !== event.currentTarget) return
if (event.key === "Enter" || event.key === " ") {
event.preventDefault()
handleOpen()
}
}}
className={clsx(
"group flex items-center gap-3 px-3 py-2 border-solid border-0 border-b border-colorBorderSecondary",
openable ? "cursor-pointer hover:bg-colorFillQuaternary" : "cursor-default",
)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Do not use a button role on the composite row.

This container owns the pin button at Line 119 and the menu trigger at Line 142. It can also own an interactive renderAgent result. Descendants of an ARIA button are presentational. Screen readers can lose access to these nested controls.

Keep the row container non-interactive. Put the session-open action on a separate control that does not contain the pin, menu, or agent slot.

Comment on lines +92 to +100
{row.status.chipLabel ? (
<span
className={clsx(
"shrink-0 rounded px-1.5 py-0.5 text-[11px] leading-none",
row.status.chipClassName,
)}
>
{pendingGateLabel(row.pending?.kinds)}
</span>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Render the status chip label from the status view model.

The condition uses row.status.chipLabel, but the content uses pendingGateLabel(row.pending?.kinds). If these values differ, the row shows the wrong label. Render row.status.chipLabel here, then remove the unused pendingGateLabel import.

…antd-free

SessionRow (VM-driven, neutral menu shape, revealActionsOnHover for touch), the list states, group header, pager, and the four filter controls bound to useSessionFilters. Anything not yet portable (the agent picker) arrives as a slot. Eslint bans antd and the @agenta/ui root barrel — subpaths only. timeAgo graduates to @agenta/shared/utils before it grows a third copy.
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Aug 9, 2026
@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 lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants