jaeyun0503 opened a new pull request, #5093:
URL: https://github.com/apache/texera/pull/5093
### What changes were proposed in this PR?
Adds a **Texera Assistant** — a floating, draggable, resizable panel that
lives in every page (logged-in users only) and surfaces workflow, social, and
admin activity, plus first-class AI agent integrations and global search.
#### New UI surface
- **Floating launcher** (robot icon) — draggable around the viewport; the
panel adapts which corner it opens into based on available space and is
user-resizable from any free edge.
- **Three tabs** for regular users (Notifications, Workflows) plus a fourth
**Requests** tab for admins. Each tab has its own Clear button and the Clear
state persists across reloads.
- **Settings overlay** (gear icon) — per-type toggles to mute specific
notification kinds (successful runs, dataset likes, etc.).
- **Search overlay** (search icon) — calls the existing dashboard search API
and lets users jump to any workflow or dataset they can access, with
creation/modified dates inline.
#### Notification feeds
- **Run notifications** — push on Completed / Failed / Killed transitions,
with workflow-aware name capture (survives navigation), Retry / Kill actions,
and a dedup window to handle websocket replays after HMR or refresh.
- **Social notifications** — polls the hub for likes / clones on the user's
workflows and datasets; baseline-on-first-poll so users don't get spammed on
login.
- **Admin requests** — polls for INACTIVE users and uses a new DB-backed
`request_viewed` flag (see schema changes below) so the "viewed" state is
global across admins and survives reloads. Clicking a request marks it viewed
and navigates to the admin user page; Clear marks every currently-pending
request viewed in one transaction.
#### AI agent integration
- **Per-workflow agent binding** — `AgentPanelComponent` now persists which
agent the user last activated, keyed by workflow id, so re-opening a workflow
restores the right agent (or shows the registration tab if none is bound).
Switching workflows correctly swaps the active agent.
- **AI failure explanations** — when a workflow fails, the assistant looks
up the bound agent for that workflow, sends a structured prompt with
operator-level error details, and streams the agent's reply into the
notification as rendered markdown. The reply also appears in the AI panel chat.
Conversational follow-ups (questions, offers to "fix it for you") are trimmed
via prompt instructions plus a post-processor so the notification stays focused
on causes and remediation steps.
- **Operator tab** (workflow page only) — shows the currently selected
operator's type and properties with an *Explain with AI* button that streams a
markdown explanation. Explanations are cached per operator id, and the tab is
"sticky" — deselecting an operator on the canvas doesn't wipe the view.
- **Coordinated launcher buttons** — a new `AgentPanelControlService` keeps
the floating "AI Agent Builder" flask button in sync with the existing agent
panel's open state; clicking either dismisses the other.
#### Schema / backend changes
- Adds `request_viewed BOOLEAN NOT NULL DEFAULT FALSE` to the `user` table
(`sql/texera_ddl.sql` + `sql/updates/23.sql`). The migration backfills all
existing rows to `TRUE` so admins don't get flooded with notifications for
accounts that pre-date this feature.
- Updates the JOOQ-generated `User` table descriptor with the new column.
- `AdminUserResource` exposes the field in `/admin/user/list` and adds two
endpoints:
- `POST /admin/user/mark-requests-viewed` (per-uid)
- `POST /admin/user/mark-all-requests-viewed` (bulk)
- Frontend `User` type, `AdminUserService`, and the assistant all consume
the new field.
#### Persistence
Several pieces of state are persisted to `localStorage` so reloads don't
reset the user's view:
- Notifications, dismissed terminal-state dedup entries, session workflow
list (with per-wid dismissal), drag position, panel size, notification
settings, and the workflow → agent map.
### Test plan
- [ ] Apply `sql/updates/23.sql` and rebuild the backend so JOOQ picks up
the new column.
- [ ] Sign in as a regular user; run a workflow to success, failure, and
kill — verify notifications appear with correct names even after navigating
away.
- [ ] Drag the floating button to each corner; resize the panel from each
free edge; verify position and size persist after reload.
- [ ] Toggle notification types in Settings and confirm muted categories no
longer push.
- [ ] Like / clone one of your own workflows from another account and verify
a social notification appears within 30s on the owner's side.
- [ ] As admin, create a new INACTIVE user; verify the Requests tab
notifies, the "Review user" action navigates to the admin page and marks
viewed, and Clear marks every pending row viewed in the DB.
- [ ] On a workflow page, configure an AI agent in the AI Agent Builder
panel; trigger a workflow failure and verify the AI suggestion streams into the
notification (with markdown rendering and no trailing follow-up questions).
- [ ] Open multiple workflows with different agents; switch back and forth
and verify the panel restores the correct agent per workflow.
- [ ] Click an operator on the canvas → Operator tab shows its info; click
*Explain with AI*; click off the operator and confirm the explanation stays
visible.
- [ ] Click the search icon and search for a workflow / dataset; click a
result and confirm it navigates correctly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]