Skip to content

Minio changes - #44

Merged
ananthanarayanan431 merged 2 commits into
mainfrom
minio-changes
Jun 27, 2026
Merged

Minio changes#44
ananthanarayanan431 merged 2 commits into
mainfrom
minio-changes

Conversation

@ananthanarayanan431

@ananthanarayanan431 ananthanarayanan431 commented Jun 27, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Migration / DB schema change
  • Refactor
  • Docs / config

Checklist

  • Code follows project style (make check passes for backend, npm run lint for frontend)
  • Tests added or updated (make test passes)
  • Migrations created if schema changed (make migration name=...)
  • .env.example updated if new env vars added
  • No secrets or API keys committed

How to test

Related issues

Summary by CodeRabbit

  • New Features
    • Added an admin “Domain File Library” view for browsing shared domains with status, row counts, and creation dates.
    • Added per-domain actions to view question/answer pairs in a side panel and open source PDFs in a full-screen viewer.
    • Added pagination, search within Q&A results, and download support for PDFs.
    • Extended admin navigation to include the new domain files section.

@supabase

supabase Bot commented Jun 27, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xrktwhftlchlgujmmdwr because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@ananthanarayanan431
ananthanarayanan431 merged commit 3339fdc into main Jun 27, 2026
1 of 4 checks passed
@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9a81fcca-8270-463a-9a66-97d6232f460e

📥 Commits

Reviewing files that changed from the base of the PR and between a8d3a21 and 338b909.

📒 Files selected for processing (6)
  • frontend/src/components/admin/analytics/agent-domain-files.tsx
  • frontend/src/components/admin/analytics/agent-domain.tsx
  • frontend/src/components/admin/view-tab.tsx
  • frontend/src/types/api.ts
  • qa-chatbot/src/promptly/admin/api/router.py
  • qa-chatbot/src/promptly/admin/api/schemas.py

📝 Walkthrough

Walkthrough

Adds an admin "Domain File Library" feature: four new Pydantic schemas and three FastAPI endpoints (list shared domain prompts, fetch Q&A dataset rows, stream PDF) backed by MinIO storage, plus a new React admin view (AgentDomainFiles) with a paginated table, QA overlay panel, and PDF modal, wired into the existing sidebar navigation as a child item.

Admin Domain File Library

Layer / File(s) Summary
API schemas and TypeScript interfaces
qa-chatbot/src/promptly/admin/api/schemas.py, frontend/src/types/api.ts
Defines AdminDomainItem, AdminDomainList, AdminDomainQARow, AdminDomainQAResponse as Pydantic models and matching TypeScript interfaces.
Backend admin endpoints
qa-chatbot/src/promptly/admin/api/router.py
Adds three FastAPI GET endpoints: paginated domain prompt listing, Q&A dataset rows (reads line-delimited JSON from MinIO), and PDF streaming (reads bytes from MinIO), with NotFound/403/404/500 error handling.
AgentDomainFiles UI component
frontend/src/components/admin/analytics/agent-domain-files.tsx
Implements StatusBadge, PdfModal (Blob fetch + iframe + download), QAPanel (search-filtered Q&A overlay), DomainRow, and the main paginated table component using React Query.
Sidebar wiring for domain_files view
frontend/src/components/admin/view-tab.tsx
Extends AgentView, adds SidebarChildItem with tree-connector styling, registers domain_files as a child nav item, and mounts <AgentDomainFiles /> in the content area.

Sequence Diagram(s)

sequenceDiagram
  participant Admin as Admin Browser
  participant AgentDomainFiles
  participant router.py
  participant MinIO

  Admin->>AgentDomainFiles: Open Domain File Library tab
  AgentDomainFiles->>router.py: GET /admin/domain-prompts?page=N
  router.py-->>AgentDomainFiles: AdminDomainList

  Admin->>AgentDomainFiles: Click "QA Pairs" on a domain row
  AgentDomainFiles->>router.py: GET /admin/domain-prompts/{id}/dataset
  router.py->>MinIO: download_text(dataset_key)
  MinIO-->>router.py: line-delimited JSON
  router.py-->>AgentDomainFiles: AdminDomainQAResponse
  AgentDomainFiles-->>Admin: Render QAPanel overlay

  Admin->>AgentDomainFiles: Click "View PDF" on a domain row
  AgentDomainFiles->>router.py: GET /admin/domain-prompts/{id}/pdf
  router.py->>MinIO: download_bytes(pdf_key)
  MinIO-->>router.py: PDF bytes
  router.py-->>AgentDomainFiles: StreamingResponse (application/pdf)
  AgentDomainFiles-->>Admin: Render PdfModal with iframe
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐰 Hop hop, the files are found,
Domains and PDFs all around,
Q&A panels slide in neat,
A paginated table, complete!
The rabbit browsed each shared domain,
And never had to look in vain~ 🌿

✨ 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 minio-changes

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.

@ananthanarayanan431
ananthanarayanan431 deleted the minio-changes branch June 27, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants