Skip to content

fix(pdf): add 'pdfjs' element and restore native iframe PDF viewer#2916

Open
Allaoua9 wants to merge 3 commits into
Chainlit:mainfrom
Allaoua9:fix/restore-native-pdf-viewer
Open

fix(pdf): add 'pdfjs' element and restore native iframe PDF viewer#2916
Allaoua9 wants to merge 3 commits into
Chainlit:mainfrom
Allaoua9:fix/restore-native-pdf-viewer

Conversation

@Allaoua9
Copy link
Copy Markdown
Contributor

This PR addresses the following issue : #2896

@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. bug Something isn't working frontend Pertains to the frontend. labels Apr 30, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 8 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="frontend/src/components/chat/Messages/Message/Content/InlinedElements/InlinedPDFjsList.tsx">

<violation number="1" location="frontend/src/components/chat/Messages/Message/Content/InlinedElements/InlinedPDFjsList.tsx:13">
P2: Using the array index as the React key makes PDF items unstable across insertions/reorders and can reuse the wrong `PDFjsElement`/`PDFjsViewer` state.</violation>
</file>

<file name="backend/chainlit/element.py">

<violation number="1" location="backend/chainlit/element.py:37">
P2: New `pdfjs` elements are serialized with type/page metadata, but `from_dict()` does not recognize `pdfjs` and falls back to `File`, breaking deserialization round-trips for the new viewer type.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread backend/chainlit/element.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend Pertains to the frontend. size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant