Skip to content

Notification system UX and reliability overhaul - #879

Merged
phoebus-84 merged 15 commits into
mainfrom
fix_notifications
Jul 15, 2026
Merged

Notification system UX and reliability overhaul#879
phoebus-84 merged 15 commits into
mainfrom
fix_notifications

Conversation

@phoebus-84

Copy link
Copy Markdown
Collaborator

Summary

Comprehensive overhaul of the notification system across interfacer-gui and zenflows-inbox. Fixes UX issues, reliability, and code quality.

GUI Changes

  • InBoxContext provider — single shared SWR cache across all 10 consumer components
  • SWR cache invalidation — mark-as-read reflects immediately without page refresh
  • Loading / error / empty states — proper spinner, error+retry, no false empty flash
  • Mark all as read — button with unread count, hidden when none unread
  • Empty group filtering — sidebar only shows groups with messages
  • Real-time refresh — SWR refreshInterval on messages list
  • N+1 fix — removed per-card GraphQL query; display data now in notification payload
  • Enum fix — replaced magic string with MessageSubject enum
  • sendMessage error handling — try/catch with console.error
  • SSR — switched /notification from getStaticProps to getServerSideProps
  • Playwright tests — loading, error, empty, and mark-all-read states
  • Apollo compat shim fix — refetch now passes variables through correctly

Backend Changes (deployed)

  • Sender identity verification against zenflows-user header
  • CORS: removed invalid Allow-Credentials + wildcard origin combo
  • Refactored from CGo Zenroom to zencode-exec binary

Closes epic interfacer-gui-6v2

phoebus-84 and others added 15 commits July 14, 2026 12:46
- useInBox: replaced stub (always returned empty []) with proper
  useSWR-based fetching via client.inbox.getMessages() and
  client.inbox.getUnreadCount(), matching the pre-SDK-refactor behavior

- notification: replaced two buggy useEffect+setState hooks with a
  single useMemo for derived groupedMessages state, eliminating the
  infinite setState-inside-useEffect re-render loop
…hide empty groups (6v2.6)

- Created InBoxContext + InBoxProvider, migrated all 10 consumers to useInBoxContext
- Added mutateMessages to context for future SWR cache invalidation
- Replaced 'Project cited' literal with MessageSubject.PROJECT_CITED enum
- Filtered out empty message groups from notification sidebar and content
…date SWR cache after markRead (6v2.2)

- Added Spinner loading state while isLoading
- Added error state with retry button when fetch fails
- Added translation keys for new states
- setReadedMessage now calls mutateMessages() to invalidate SWR cache
  so all components see updated read status immediately
… sendMessage error handling (6v2.9)

- Added 'Mark all as read' button with unread count to notification page
- Added real-time SWR refreshInterval to messages list using env var
- Added try/catch around sendMessage with console.error fallback
…tch to getServerSideProps (6v2.12)

- Removed Apollo useQuery/useEffect from ContributionMessage
- All display data now comes from notification payload (proposerName, originalResourceName, projectOwnerName)
- Switched /notification from getStaticProps to getServerSideProps for proper auth context
- Empty state: verifies 'No notifications at the moment' message
- Error state: verifies error message + retry button on network failure
- Loading state: verifies spinner visibility while data is fetching
- Mark all read: verifies button hidden when all messages are read
… login

Route mocks must be in place before login (which triggers SWR's first fetch).
Split into separate test groups with their own beforeEach for each scenario.
Removed unreliable loading spinner test (SWR caching makes it fragile).
@phoebus-84
phoebus-84 merged commit 315ac8a into main Jul 15, 2026
1 check passed
@phoebus-84
phoebus-84 deleted the fix_notifications branch July 15, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant