Skip to content

Slack TA Bot Frontend: Plugin UI (connect, configure, logs) #246

@zaira-bibi

Description

@zaira-bibi

Implements the frontend plugin UI for the Slack TA Bot, following the existing plugin UI pattern in frontend/plugins/.

Depends on the OAuth connection issue and the Events/RAG issue.

What's included:

  • New plugin UI at frontend/plugins/slack/ registered in frontend/lib/plugins/registry.ts
  • OAuth connect/disconnect flow: "Connect to Slack" button → redirects to install URL → shows connected workspace name on return
  • After OAuth connection, show a document picker (sourced from GET /rag/sources) so the teacher can select which docs this bot can access
  • Bot configuration form: bot_name and fallback_message fields, saved via the existing user-plugin config API. Above selection is also saved as allowed_sources in the bot's plugin config
  • Response logs table: Paginated view of GET /logs, showing question, answer, RAG match status, timestamp
  • Connection status banner: Shows workspace name when connected, prompt to connect when not

Acceptance Criteria

  • Plugin appears in the plugins dashboard under "Slack TA Bot"
  • "Connect to Slack" button redirects to the Slack install URL returned by GET /oauth/authorize
  • After OAuth callback (?connected=true), UI shows connected workspace name and hides the connect button
  • A document picker (sourced from GET /rag/sources) enables the teacher to select which docs this bot can access
  • "Disconnect" button calls DELETE /oauth/disconnect and resets the UI to disconnected state
  • Bot name and fallback message fields are pre-populated from saved config
  • Saving config calls the user-plugin config API and shows success/error feedback
  • Logs table shows question, answer (or "No match"), RAG match badge, and timestamp
  • Logs table paginates correctly (next/prev)
  • Logs table shows empty state when no responses yet
  • All API errors surface as user-facing error messages (no silent failures)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions