As a user I want a unified comment drawer on the document detail page so discussion and annotation comments are in one place and the PDF always stays fully visible #60
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The document detail page currently has two separate comment surfaces:
CommentThreadin the left metadata sidebar, section 5 "Diskussion". Gets crowded with longer threads and competes with metadata for sidebar space.AnnotationCommentPanel, anabsolute right-0overlay insidePdfViewer. Opens when a user clicks an annotation.These two surfaces are disconnected and the sidebar becomes hard to use as discussion grows.
User Journey
A user opens a document. At the bottom of the screen they see a slim collapsed drawer showing two tabs: Diskussion (with a comment count badge) and no annotation tab yet. They click the drawer title bar to expand it to its default height. The Diskussion tab shows the full document thread — they read and reply.
They then click an annotation on the PDF. The drawer switches to a new Annotation · Seite N tab showing that annotation's comments. A back-click on the Diskussion tab returns to the document thread; the annotation tab disappears when the annotation is deselected.
The user drags the top edge of the drawer upward to make it taller when reading a long thread, and back down when they want more PDF visible. The PDF never rerenders during any of this.
Design Decisions
Floating overlay (not a layout-affecting panel)
The drawer is
fixed/absolute, positioned atbottom: 0, starting atleft: 384px(right edge of the metadata sidebar) and stretching toright: 0. It floats over the PDF. The flex layout of the page — sidebar + main — never changes, so the PDF canvas is never resized or rerendered.Two tabs
CommentThreadCommentThreadClicking the Diskussion tab deselects the active annotation and returns to the document thread. The annotation tab disappears when no annotation is selected. Only one annotation tab exists at a time (the most recently clicked).
Collapsed state
Default: collapsed to a ~40px title bar showing the tab labels and a comment count badge on Diskussion. Clicking anywhere on the title bar expands to the default height.
Drag-to-resize
A drag handle on the top edge of the drawer. Dragging up increases height, down decreases. Constraints: min ~180px (enough to see ~2 comments), max ~55vh (leaves the PDF usable). Height is not persisted between page loads.
AnnotationCommentPanelremovedAnnotationCommentPanelis replaced entirely by the annotation tab in the drawer. Annotation clicks inPdfViewersetactiveAnnotationIdas before, but instead of mountingAnnotationCommentPanel, they open the drawer (if collapsed) and activate the annotation tab. The drawer owns the annotationCommentThread.Sidebar cleanup
Section 5 "Diskussion" and its
CommentThreadare removed from the sidebar. The sidebar becomes pure document metadata. The footer (document ID / filename) stays.Keyboard
Escapecollapses the drawer if it is expanded (or clears the annotation tab and switches to Diskussion if the annotation tab is active).E2E Scenarios
Implementation Notes
PdfViewerpassesonAnnotationClickup or keepsactiveAnnotationIdinternally; either way the drawer needs to know the active annotation ID and the page number for the tab label. Consider liftingactiveAnnotationIdto the page level so both the drawer and PdfViewer can share it.pointerdown/pointermove/pointerup(covers mouse + touch) on the handle element. Store height in a$statevariable; apply viastyle="height: {drawerHeight}px".data.commentsserver-side — use.lengthfor the initial badge, then keep it in sync viaonCountChange.DiscussionDrawer.svelteinsrc/lib/components/. It acceptsdocumentId,activeAnnotationId,activeAnnotationPage,canComment,currentUserId,canAdmin,initialComments.