feat(frontend): @agenta/sessions-ui, the session list's antd-free components - #5770
feat(frontend): @agenta/sessions-ui, the session list's antd-free components#5770ardaerzin wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdded the private ChangesSessions UI package
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Railway Preview Environment
Updated at 2026-08-09T16:56:37.122Z |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
web/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (15)
web/oss/next.config.tsweb/oss/package.jsonweb/packages/agenta-sessions-ui/eslint.config.mjsweb/packages/agenta-sessions-ui/package.jsonweb/packages/agenta-sessions-ui/src/SessionAgentName.tsxweb/packages/agenta-sessions-ui/src/SessionListStates.tsxweb/packages/agenta-sessions-ui/src/SessionRow.tsxweb/packages/agenta-sessions-ui/src/assets/Tip.tsxweb/packages/agenta-sessions-ui/src/controls/SessionFilterControls.tsxweb/packages/agenta-sessions-ui/src/index.tsweb/packages/agenta-sessions-ui/src/menu.tsweb/packages/agenta-sessions-ui/tsconfig.jsonweb/packages/agenta-shared/src/utils/index.tsweb/packages/agenta-shared/src/utils/timeAgo.tsweb/turbo.json
76522bf to
1111e32
Compare
|
@coderabbitai review |
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
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. |
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
web/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (15)
web/oss/next.config.tsweb/oss/package.jsonweb/packages/agenta-sessions-ui/eslint.config.mjsweb/packages/agenta-sessions-ui/package.jsonweb/packages/agenta-sessions-ui/src/SessionAgentName.tsxweb/packages/agenta-sessions-ui/src/SessionListStates.tsxweb/packages/agenta-sessions-ui/src/SessionRow.tsxweb/packages/agenta-sessions-ui/src/assets/Tip.tsxweb/packages/agenta-sessions-ui/src/controls/SessionFilterControls.tsxweb/packages/agenta-sessions-ui/src/index.tsweb/packages/agenta-sessions-ui/src/menu.tsweb/packages/agenta-sessions-ui/tsconfig.jsonweb/packages/agenta-shared/src/utils/index.tsweb/packages/agenta-shared/src/utils/timeAgo.tsweb/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
| // An outside write (reset, another surface) must win over a stale draft. | ||
| useEffect(() => setDraft(search), [search]) | ||
| useEffect( | ||
| () => () => { | ||
| if (timer.current) clearTimeout(timer.current) | ||
| }, | ||
| [], | ||
| ) |
There was a problem hiding this comment.
🎯 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
| <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", | ||
| )} |
There was a problem hiding this comment.
🎯 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.
| {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> |
There was a problem hiding this comment.
🎯 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.
1111e32 to
b000941
Compare
|
Landed in |
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 bySessionRowVm, neutral menu shape,revealActionsOnHoverso touch surfaces can keep actions visible), the list empty/error/skeleton states, group header, pager, and the four filter controls bound touseSessionFilters. Anything not yet portable stays a slot: the agent picker is still antd (EntityPicker), so the controls take it asagentPicker?: ReactNodeand the app injects it. Shells stay per-surface; the package exports controls, each app owns its rail or sheet.Eslint bans
antdand the@agenta/uiroot barrel (subpaths only).timeAgograduates to@agenta/shared/utilsbefore it grows a third copy.Tests / notes
grep 'from "antd"' srcis empty;@agenta/osstsc is clean on this lane.oss/sessions-pagelane above.