As a user I want the annotation toggle in the document header so I can easily find and activate annotation mode #61
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 "Annotieren" toggle button currently lives inside
PdfViewer's dark controls toolbar, alongside page navigation and zoom buttons. It is text-only, small, and easy to miss. Users withANNOTATE_ALLpermission may not discover the feature at all.User Journey
A user with annotation permission opens a document that has a PDF. In the page header — next to the "Bearbeiten" button — they see an icon button for annotation mode. Clicking it activates annotation mode; the button visually changes to indicate it is active. Clicking it again deactivates. The color picker remains in the PDF toolbar (close to where drawing happens). The button is absent for non-PDF documents and for users without
ANNOTATE_ALL.Design Decisions
What moves to the header
The toggle button only moves to the header. Icon:
Note-Add-MD.svgfrom the existing degruyter icon library.border-transparent bg-brand-sand/50 p-2 hover:bg-brand-mint)bg-brand-mint text-brand-navy)title/aria-label: "Annotieren" / "Annotieren beenden"What stays in the PdfViewer toolbar
The color picker stays in the toolbar — it is contextually close to the canvas where drawing happens and does not need to be globally reachable.
The disabled "Annotieren" placeholder button (shown to users without permission) is removed entirely — it provides no value to users who cannot act on it.
Conditional display
Show only when all three are true:
data.canAnnotatedoc.filePathis setdoc.contentTypestarts withapplication/pdfState lifting
annotateModeis currently$stateinsidePdfViewer. It needs to be lifted to+page.svelteand passed intoPdfVieweras a prop so both the header button and the viewer share the same value. Use Svelte 5$bindable()on the prop.Implementation Plan
PdfViewer.svelteannotateModeas a$bindable()prop (defaultfalse){#if annotateMode} <input type="color"> {/if}) in the toolbar+page.sveltelet annotateMode = $state(false)bind:annotateModeto<PdfViewer>E2E Scenarios