Skip to content

feat: real-time notifications + UI fixes for industrial deployment#2960

Open
somi2306 wants to merge 4 commits into
Chainlit:mainfrom
somi2306:zineb/notifications-and-ui-fixes
Open

feat: real-time notifications + UI fixes for industrial deployment#2960
somi2306 wants to merge 4 commits into
Chainlit:mainfrom
somi2306:zineb/notifications-and-ui-fixes

Conversation

@somi2306

@somi2306 somi2306 commented Jun 12, 2026

Copy link
Copy Markdown

New features:

  • Add useNotifications hook: real-time Socket.io notifications with Chainlit native auth
  • Add NotificationBell component: unread badge, popover list, type indicators
  • Add LeftSidebar/Search: thread history search functionality

Bug fixes:

  • Fix Alert: use div instead of p to allow block-level children (Skeleton)
  • Fix AutoResizeTextarea: add forwardRef + useImperativeHandle to expose ref externally
  • Fix BlinkingCursor: replace static cursor with animated 3-dot typing indicator
  • Fix Logo/Avatar: resolve absolute URLs for reverse-proxy/standalone deployments
  • Fix ThreadList: use SidebarMenuAction to avoid invalid HTML nesting
  • Fix ThreadList: track active thread from URL params for correct highlight state
  • Fix ThreadList: add stopPropagation on delete/rename/share actions

Compatibility:

  • Update shadcn/ui components to latest API (data-slot, React.ComponentProps)
  • Fix react-markdown PluggableList import for newer versions

Tested in production: Chainlit + Next.js 14 + Nginx reverse proxy PFE ENSMR 2026 - Copilote Industriel OCP Jorf Lasfar


Summary by cubic

Adds real-time notifications with a bell and faster thread search. Improves SSR/media stability, reverse-proxy URL handling, and updates UI primitives to the latest shadcn/ui.

  • New Features

    • useNotifications: real-time socket.io-client feed using @chainlit/react-client auth; tracks unread and “mark all read”.
    • NotificationBell: unread badge and popover list with type indicators and timestamps.
    • Sidebar search: faster thread history search with local-date grouping and tag badges.
  • Bug Fixes

    • Reverse-proxy/standalone: absolute URLs for logo and avatars; guard Radix portals to the shadow-root; SSR-safe theme variables.
    • Thread list: highlight from URL params; use SidebarMenuAction; stopPropagation on actions; accessible trigger button.
    • Composer: AutoResizeTextarea via forwardRef; safer image previews/progress for attachments.
    • Rendering/SSR: lazy-load react-plotly.js (with JSON.parse try/catch) and react-player in Suspense; restore BlinkingCursor with animated dots; correct NewChat route; fix callback deps.
    • Markdown: fix react-markdown plugin import; include KaTeX CSS.
    • UI kit: migrate buttons, dialogs, tabs, cards, inputs, labels, resizable to new shadcn/ui APIs.
    • SidebarTrigger: fix prop forwarding and ref handling.
    • Encoding: remove UTF-8 BOM and fix encoding artifacts in MessagesContainer.

Written for commit 62fe10d. Summary will update on new commits.

Review in cubic

New features:
- Add useNotifications hook: real-time Socket.io notifications with Chainlit native auth
- Add NotificationBell component: unread badge, popover list, type indicators
- Add LeftSidebar/Search: thread history search functionality

Bug fixes:
- Fix Alert: use div instead of p to allow block-level children (Skeleton)
- Fix AutoResizeTextarea: add forwardRef + useImperativeHandle to expose ref externally
- Fix BlinkingCursor: replace static cursor with animated 3-dot typing indicator
- Fix Logo/Avatar: resolve absolute URLs for reverse-proxy/standalone deployments
- Fix ThreadList: use SidebarMenuAction to avoid invalid HTML nesting
- Fix ThreadList: track active thread from URL params for correct highlight state
- Fix ThreadList: add stopPropagation on delete/rename/share actions

Compatibility:
- Update shadcn/ui components to latest API (data-slot, React.ComponentProps)
- Fix react-markdown PluggableList import for newer versions

Tested in production: Chainlit + Next.js 14 + Nginx reverse proxy
PFE ENSMR 2026 - Copilote Industriel OCP Jorf Lasfar
@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. bug Something isn't working enhancement New feature or request frontend Pertains to the frontend. labels Jun 12, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11 issues found across 63 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread frontend/src/components/chat/index.tsx Outdated
Comment thread frontend/src/components/ui/alert-dialog.tsx Outdated
Comment thread frontend/src/components/LeftSidebar/ThreadOptions.tsx Outdated
Comment thread frontend/src/components/Elements/Video.tsx Outdated
Comment thread frontend/src/components/chat/Messages/index.tsx
Comment thread frontend/src/components/Elements/Plotly.tsx Outdated
Comment thread frontend/src/components/header/SidebarTrigger.tsx Outdated
Comment thread frontend/src/components/chat/MessageComposer/Attachments.tsx Outdated
Comment thread frontend/src/components/chat/MessageComposer/Attachment.tsx
Comment thread frontend/src/components/LeftSidebar/ThreadOptions.tsx
somi2306 added 2 commits June 12, 2026 13:05
- Fix P0: chat/index.tsx — correct useNavigate usage (router.push undefined)
- Fix P1: alert-dialog.tsx — restore shadow-root portal container
- Fix P1: ThreadOptions.tsx — remove static duplicate id
- Fix P1: Video.tsx — wrap ReactPlayer in Suspense boundary
- Fix P1: Messages/index.tsx — restore BlinkingCursor for running state
- Fix P2: Attachments.tsx — remove unnecessary String() coercion
- Fix P2: Attachment.tsx — use isImage && imageUrl for container width
- Fix P2: MessagesContainer — add apiClient to useCallback deps
- Fix P2: Plotly.tsx — wrap JSON.parse in try/catch
- Fix P3: ThreadOptions.tsx — fix BOM and UTF-8 encoding artifacts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 10 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread frontend/src/components/chat/MessagesContainer/index.tsx Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request frontend Pertains to the frontend. size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant