feat: improve discussion discoverability with count badge and empty state hint #81
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?
Problem
New users visiting a document don't know the Discussion tab exists or has content. The tab label alone ("Diskussion") gives no indication of activity, and opening an empty tab shows a blank textarea with no guidance.
Proposed Changes
1. Comment count badge on the "Diskussion" tab
Show a small pill badge next to the tab label when there are existing comments (threads + replies). The badge is seeded from SSR data on load and updates live after new comments are posted.
2. Clickable "Start discussion" nudge above the closed panel
When there are no comments, a subtle "Diskussion starten →" link is shown just above the collapsed bottom panel. Clicking it opens the panel to the Discussion tab. The nudge is passive — it only responds to user interaction, it does not auto-open anything.
3. Empty state hint inside the discussion panel
When the discussion is empty, show a friendly speech-bubble icon + message ("Noch keine Kommentare – starte die Diskussion!") above the compose box instead of a bare textarea.
Implementation Plan
frontend/messages/{de,en,es}.json— addcomment_empty_hintandcomment_start_discussiontranslation keysCommentThread.sveltecomments.length === 0onCountChangeto also fire with the initial SSR-seeded count (currently only fires after client-sidereload())PanelDiscussion.svelteonCountChange?: (count: number) => voidprop and forward it toCommentThreadDocumentBottomPanel.sveltediscussionCountreactive state (seeded from SSRcommentsprop)onCountChangeintoPanelDiscussiondiscussionCount > 0!open && discussionCount === 0: render a subtle clickable link above the drag handle that callsopenTab('discussion')on clickVerification
npm run check+npm run lintpass