Skip to content

feat: artifacts integration web - #477

Merged
dinhlongviolin1 merged 1 commit into
mainfrom
feat/artifacts-view
Jan 29, 2026
Merged

dinhlongviolin1 merged 1 commit into
mainfrom
feat/artifacts-view

Conversation

@dinhlongviolin1

@dinhlongviolin1 dinhlongviolin1 commented Jan 29, 2026 •

Copy link
Copy Markdown
Contributor

Describe Your Changes

Summary

  • Add Artifacts Gallery page with filtering, search, and cursor-based pagination
  • Fix artifact-to-conversation linking so "View Chat" navigates to the correct llm-api conversation
  • Add viewers for slides, markdown, HTML, images, and code artifacts

Changes

Backend (response-api)

  • Add parent_conversation_id field to responses table for linking artifacts to llm-api conversations
  • Add GET /v1/artifacts endpoint for listing user's artifacts with filtering
  • Add cascade delete for responses → artifacts/plans
  • Support cursor-based pagination and title search for artifacts
  • Hydrate conversation_id on artifacts via response join

Backend (mcp-tools)

  • Pass parent_conversation_id (not conversation) when spawning agents to avoid lookup errors

Frontend (web)

  • New /artifacts route with gallery grid view
  • Artifact cards with markdown preview for research/markdown types
  • Filter tabs (All, Presentations, Documents, Research, etc.)
  • Search with debounce
  • Viewers: SlideViewer, MdViewer, HtmlViewer, ImageViewer
  • "View Chat" button links to originating conversation
  • Download with "Save As" dialog (Chrome/Edge) or direct download (Safari)

Fixes Issues

  • Closes #
  • Closes #

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

@dinhlongviolin1
dinhlongviolin1 marked this pull request as ready for review January 29, 2026 03:14

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 56da906bd7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +46 to +49
// Get user ID from JWT token (set by auth middleware)
userID := extractUserIDFromToken(c)
if userID == "" {
c.JSON(http.StatusUnauthorized, gin.H{"error": "user not authenticated"})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Honor Kong-authenticated user IDs in artifacts list

The new List handler only derives the user ID from a JWT in auth_token; when requests come through Kong, the auth middleware accepts them via X-User-ID and sets user_id on the context without setting auth_token (see services/response-api/internal/infrastructure/auth/auth.go). In that common deployment path, this handler will return 401 for valid, authenticated users, making /v1/artifacts unusable behind the gateway. Consider falling back to c.Get("user_id") (or a shared helper) before rejecting the request.

Useful? React with 👍 / 👎.

Comment on lines +62 to +66
fetchArtifacts: async () => {
// Prevent duplicate fetches
if (fetchPromise) {
return fetchPromise;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid dropping refetches when filters change

The global fetchPromise guard prevents any new fetchArtifacts call while a request is in flight. If the user changes the search query or content-type filter before the previous request finishes, the new fetch is skipped and the store is updated with results for the old filters, leaving the gallery out of sync until another manual refresh. Consider keying the in-flight request by filter/search (or cancelling/ignoring stale responses) so the latest user intent always triggers a fetch.

Useful? React with 👍 / 👎.

@locnguyen1986 locnguyen1986 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@dinhlongviolin1
dinhlongviolin1 merged commit 6bba1ed into main Jan 29, 2026
11 checks passed
@dinhlongviolin1
dinhlongviolin1 deleted the feat/artifacts-view branch January 29, 2026 03:45
@github-project-automation github-project-automation Bot moved this to QA in Jan Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: QA

Development

Successfully merging this pull request may close these issues.

2 participants