Scrum4Me/components/shared
Madhura68 9e8f33b96e fix(m12): user can answer idea-questions — inline + bell support
Two gaps discovered during the first live grill-session of IDEA-002:
the agent posted a question, but the user had no UI to answer it.
1. Idea-questions only appeared on the Timeline-tab as read-only entries
2. Notifications-bell fetched + handled story-questions only

This fix:

**Inline answer-form in IdeaTimeline** (components/ideas/idea-timeline.tsx)
- Open questions now render an AnswerForm directly under the question text
- Multi-choice options become clickable buttons (one-click submit); free-text
  fallback via collapsed details/textarea
- Plain free-text questions render textarea + Verzend
- Calls existing answerQuestion server-action; toast + router.refresh on success

**Notifications-bell extended for idea-questions**
- stores/notifications-store.ts: NotificationQuestion → discriminated union
  (kind: 'story' | 'idea'); forYouCount treats idea-questions as always-for-you
  (idea is strictly user_id-only — only the owner sees them)
- components/notifications/notifications-bridge.tsx: parallel fetch of
  story-questions (productAccessFilter) + idea-questions (idea.user_id ===
  session.userId); merged + sorted by created_at
- components/notifications/notifications-sheet.tsx: renders idea_code/title
  for kind='idea'
- components/notifications/answer-modal.tsx: header + open-link branch on
  kind (idea → /ideas/[id]?tab=timeline; story → existing /sprint link)
- lib/realtime/use-notifications-realtime.ts: idea-question events also
  trigger close+reconnect on 'open' (loads fresh detail) and remove(id) on
  non-open — same pattern story-questions already use
- components/shared/notifications-bell.tsx: badge counts idea-questions as
  for-you regardless of assignee

**Security gap closed (actions/questions.ts answerQuestion)**
Before: accepted any answer if user has product-access.
After: idea-questions require idea.user_id === session.userId; story-
questions keep the existing productAccessFilter path. (Prisma 7 rejects
\`{ not: null }\` in WHERE; routing happens app-level after a single fetch.)

Tests: 546/546 still green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 13:05:39 +02:00
..
activate-product-button.tsx M12 / ST-1110: Demo gebruiker read-only (#17) 2026-04-29 18:44:14 +02:00
alert-toast.tsx feat(M9): active product backlog — persistent active PB, NavBar splits, sprint card styling (#10) 2026-04-27 20:25:13 +02:00
app-icon.tsx chore: documentatie naar docs/, iconen bijgewerkt, theme.css verplaatst 2026-04-24 22:51:42 +02:00
code-badge.tsx feat(ST-507): add code-helpers and CodeBadge component 2026-04-26 20:36:33 +02:00
demo-tooltip.tsx feat: ST-601-ST-612 M6 polish, beveiliging en launch-ready 2026-04-24 12:36:23 +02:00
entity-dialog-layout.ts feat(ST-1133): entityDialogContentClasses → full-screen op <640px (T-316/T-317/T-318) 2026-05-04 10:06:21 +02:00
job-status.ts M13: Claude job queue — 'Voer uit'-knop + worker presence (ST-1111) (#18) 2026-04-29 19:51:48 +02:00
min-width-banner.tsx feat: ST-601-ST-612 M6 polish, beveiliging en launch-ready 2026-04-24 12:36:23 +02:00
nav-bar.tsx ui: nav entry "Ideeën" between Insights and Todo's (M12 T-515) 2026-05-04 21:43:51 +02:00
notifications-bell.tsx fix(m12): user can answer idea-questions — inline + bell support 2026-05-05 13:05:39 +02:00
panel-nav-bar.tsx feat: ST-101-ST-110 M1 producten, PBI backlog, iconen en PWA manifest 2026-04-24 11:33:47 +02:00
pbi-status-select.tsx M12 / ST-1109: PBI krijgt een status (Ready / Blocked / Done) (#16) 2026-04-29 17:52:34 +02:00
priority-select.tsx feat(ST-108/ST-208): replace inline forms with PBI and story dialogs 2026-04-25 22:53:26 +02:00
set-current-product.tsx feat: show active product name in navbar, links to product page 2026-04-26 17:56:50 +02:00
status-bar.tsx feat: demo-gebruiker krijgt read-only toegang tot actieve sprint 2026-04-24 17:17:41 +02:00
story-log.tsx feat: ST-401-ST-410 M4 REST API, tokenbeleer en activiteitenlog 2026-04-24 11:56:29 +02:00
use-dialog-submit-shortcut.ts feat(dialogs): gedeelde primitives — useDirtyCloseGuard, useDialogSubmitShortcut, layout-classes 2026-05-04 07:14:07 +02:00
use-dirty-close-guard.tsx feat(dialogs): gedeelde primitives — useDirtyCloseGuard, useDialogSubmitShortcut, layout-classes 2026-05-04 07:14:07 +02:00
user-avatar.tsx feat(ST-351): add UserAvatar component and /api/users/[id]/avatar route 2026-04-26 16:15:56 +02:00
user-menu.tsx M10: Password-loze inlog via QR-pairing (ST-1001..ST-1008) (#12) 2026-04-28 00:01:04 +02:00