Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 10 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### [1.0.2](https://github.com/eea/volto-chatbot/compare/1.0.1...1.0.2) - 4 December 2025
### [1.0.3](https://github.com/eea/volto-chatbot/compare/1.0.2...1.0.3) - 13 January 2026

#### :rocket: New Features

- feat(chatbot): export feedback components and improve robustness [Miu Razvan - [`b037410`](https://github.com/eea/volto-chatbot/commit/b037410c69c5ac89937bab37a9c57cb91af9ae0b)]

#### :bug: Bug Fixes

- fix(ChatBlock): improve accessibility and UI refinements [Miu Razvan - [`726db95`](https://github.com/eea/volto-chatbot/commit/726db95c11a35ae2d8fb5f614bd19067cb1d1397)]
- fix: volto-sentry version - 0.4.0 [Alin Voinea - [`8477634`](https://github.com/eea/volto-chatbot/commit/8477634fc340158ea0de179c7742a6f18a952717)]

#### :nail_care: Enhancements
### [1.0.2](https://github.com/eea/volto-chatbot/compare/1.0.1...1.0.2) - 5 December 2025

#### :bug: Bug Fixes

- refactor(ChatBlock): improve tool display and streaming animations [Miu Razvan - [`09c5915`](https://github.com/eea/volto-chatbot/commit/09c591583d0de8ca91248c4c754cab0230359cb0)]
- fix(ChatBlock): improve accessibility and UI refinements [Miu Razvan - [`726db95`](https://github.com/eea/volto-chatbot/commit/726db95c11a35ae2d8fb5f614bd19067cb1d1397)]

#### :house: Internal changes

Expand Down Expand Up @@ -343,7 +349,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- Bump version [kreafox - [`e93d62e`](https://github.com/eea/volto-chatbot/commit/e93d62e6dd14f32af7993e55bb683357d7a8f19b)]
- WIP [Tiberiu Ichim - [`0fec402`](https://github.com/eea/volto-chatbot/commit/0fec40284ac094d6cd250ef8f5c68c88ea6f4efa)]
- test: update snapshot [kreafox - [`8aeca66`](https://github.com/eea/volto-chatbot/commit/8aeca66e0b14e3134404123ecdfe30fd693bc397)]
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`9c69e2d`](https://github.com/eea/volto-chatbot/commit/9c69e2dcc6430786f7dcd5f959fc6b22abf2ab33)]
### [0.1.22](https://github.com/eea/volto-chatbot/compare/0.1.21...0.1.22) - 2 July 2025

#### :hammer_and_wrench: Others
Expand Down Expand Up @@ -450,7 +455,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

- test: mock injectLazyLibs [kreafox - [`fa9882d`](https://github.com/eea/volto-chatbot/commit/fa9882d8624bc8e8ddec66eba18697ca3a34bb97)]
- Offload luxon [Tiberiu Ichim - [`3a21831`](https://github.com/eea/volto-chatbot/commit/3a2183189f25b887b2f1c84c571940770922f2a5)]
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`0e69482`](https://github.com/eea/volto-chatbot/commit/0e6948259d4cdbc2d22dc942bbaa0652c1fe7035)]
- WIP on haloumi [Tiberiu Ichim - [`6196565`](https://github.com/eea/volto-chatbot/commit/61965657ba59fe59047445bb8cad85f337400180)]
- WIP on haloumi [Tiberiu Ichim - [`d95b8e6`](https://github.com/eea/volto-chatbot/commit/d95b8e6704e75e9cfacfd624e60bcb75ace01c13)]
- WIP on haloumi [Tiberiu Ichim - [`7017eee`](https://github.com/eea/volto-chatbot/commit/7017eee9ddcbfaef94246af22bc09d78a028bf17)]
Expand Down Expand Up @@ -535,12 +539,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
#### :hammer_and_wrench: Others

- Fix for latest version of onyx [Tiberiu Ichim - [`374e52a`](https://github.com/eea/volto-chatbot/commit/374e52a8287420deee2b3c527588f93742ed2044)]
- Add Sonarqube tag using ied-frontend addons list [EEA Jenkins - [`a5adddd`](https://github.com/eea/volto-chatbot/commit/a5adddde64eb0e7441f3852208e5a28fc0960513)]
### [0.1.12](https://github.com/eea/volto-chatbot/compare/0.1.11...0.1.12) - 7 February 2025

#### :hammer_and_wrench: Others

- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`4ef343e`](https://github.com/eea/volto-chatbot/commit/4ef343e7a1ad256ab401385e2e087b69fd55f393)]
### [0.1.11](https://github.com/eea/volto-chatbot/compare/0.1.10...0.1.11) - 27 January 2025

#### :house: Internal changes
Expand Down Expand Up @@ -575,10 +577,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

- test: update snapshot [kreafox - [`9381cb9`](https://github.com/eea/volto-chatbot/commit/9381cb90a4d753c1e76d0c62c142f559fb392032)]
- don't crash if match_highlights is missing [Zoltan Szabo - [`71af903`](https://github.com/eea/volto-chatbot/commit/71af9037338364795075c8522e0e50cdf3bd9560)]
- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`091db2f`](https://github.com/eea/volto-chatbot/commit/091db2f4847d865bf3323f93d56f3e7436bff4b8)]
- Add Sonarqube tag using forests-frontend addons list [EEA Jenkins - [`202b61f`](https://github.com/eea/volto-chatbot/commit/202b61f0d8ae10b2d52e071d83c994593c30d19d)]
- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`085c2f6`](https://github.com/eea/volto-chatbot/commit/085c2f6e2aeec856525487de19251d661d438361)]
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`f7ff425`](https://github.com/eea/volto-chatbot/commit/f7ff4253866f3a69152e24024ce5c0cac40455b8)]
### [0.1.8](https://github.com/eea/volto-chatbot/compare/0.1.7...0.1.8) - 26 November 2024

### [0.1.7](https://github.com/eea/volto-chatbot/compare/0.1.6...0.1.7) - 17 October 2024
Expand All @@ -590,13 +588,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
#### :hammer_and_wrench: Others

- test: update snapshot [kreafox - [`4278486`](https://github.com/eea/volto-chatbot/commit/4278486073e7e7911d136a781cfe70cd1c6c1a1a)]
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`537ca05`](https://github.com/eea/volto-chatbot/commit/537ca05e2a5aae8bb7b70ff9660f3d6185eb0e79)]
- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`b846288`](https://github.com/eea/volto-chatbot/commit/b846288fd9dc712712bb271e0dcb4e0247d8410d)]
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`3eceba3`](https://github.com/eea/volto-chatbot/commit/3eceba38c461e2faf8056df73b9e684244cda028)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`eeb96e3`](https://github.com/eea/volto-chatbot/commit/eeb96e3b35b513dd8baecf83bfa17943454f6c3a)]
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`e22c2d4`](https://github.com/eea/volto-chatbot/commit/e22c2d4f54b50ec9085f309a7e20580cdd83850b)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`d24eef0`](https://github.com/eea/volto-chatbot/commit/d24eef031076d1991b52dfadf0ae8b89d8db7fa4)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`3ed46ff`](https://github.com/eea/volto-chatbot/commit/3ed46ff8d4e8c49ffa4762e75ef1178adf160ebe)]
### [0.1.6](https://github.com/eea/volto-chatbot/compare/0.1.5...0.1.6) - 7 October 2024

#### :bug: Bug Fixes
Expand Down Expand Up @@ -741,5 +732,4 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- yarn bootstrap [alin - [`064d130`](https://github.com/eea/volto-chatbot/commit/064d130ad938a046a4f8dfaa3e78d2fe426c53aa)]
- Initial commit [Tiberiu Ichim - [`c9e59d3`](https://github.com/eea/volto-chatbot/commit/c9e59d3d0d91c2a40c5d215aa26d8ed982fd7856)]
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-chatbot",
"version": "1.0.2",
"version": "1.0.3",
"description": "@eeacms/volto-chatbot: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down Expand Up @@ -42,7 +42,7 @@
"dependencies": {
"@eeacms/volto-matomo": "*",
"@microsoft/fetch-event-source": "2.0.1",
"@plone-collective/volto-sentry": "0.3.1",
"@plone-collective/volto-sentry": "*",
"fast-json-patch": "3.1.1",
"highlight.js": "11.10.0",
"luxon": "3.5.0",
Expand Down
6 changes: 4 additions & 2 deletions src/ChatBlock/components/UserActionsToolbar.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import cx from 'classnames';
import { Button } from 'semantic-ui-react';
import { useCopyToClipboard } from '../utils';
import SVGIcon from './Icon';
Expand All @@ -7,16 +8,17 @@ import CopyIcon from '../../icons/copy.svg';
import CheckIcon from '../../icons/check.svg';

const UserActionsToolbar = ({
className,
message,
enableFeedback,
feedbackReasons,
enableMatomoTracking,
persona,
}) => {
const [copied, handleCopy] = useCopyToClipboard(message.message);
const [copied, handleCopy] = useCopyToClipboard(message?.message || '');

return (
<div className="message-actions">
<div className={cx('message-actions', className)}>
<Button
basic
onClick={() => handleCopy()}
Expand Down
13 changes: 7 additions & 6 deletions src/ChatBlock/packets/renderers/MessageTextRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ const PACKET_DELAY_MS = 10;
// Number of packets to show per animation tick when catching up
const PACKETS_PER_TICK = 5;
// Adaptive animation constants for fast streams
const MIN_REVEAL_DURATION_MS = 400; // Minimum typing animation duration
const PACKET_VALUE_MS = 1.5; // Additional time per packet (scales with length)
const MIN_REVEAL_DURATION_MS = 400; // Minimum typing animation duration
const PACKET_VALUE_MS = 1.5; // Additional time per packet (scales with length)
const MAX_REVEAL_DURATION_MS = 2000; // Cap to prevent slow reveals
const CATCH_UP_THRESHOLD = 20; // Threshold for catch-up mode
const CATCH_UP_THRESHOLD = 20; // Threshold for catch-up mode

export const MessageTextRenderer: MessageRenderer<ChatPacket> = ({
packets,
Expand Down Expand Up @@ -80,7 +80,8 @@ export const MessageTextRenderer: MessageRenderer<ChatPacket> = ({
setDisplayedPacketCount((prev) => {
const remaining = packets.length - prev;
// If we're far behind, catch up faster
const increment = remaining > CATCH_UP_THRESHOLD ? PACKETS_PER_TICK : 1;
const increment =
remaining > CATCH_UP_THRESHOLD ? PACKETS_PER_TICK : 1;
return Math.min(prev + increment, packets.length);
});
}, PACKET_DELAY_MS);
Expand Down Expand Up @@ -150,8 +151,8 @@ export const MessageTextRenderer: MessageRenderer<ChatPacket> = ({
<div className="message-text-content">
<Markdown
components={components(message, markers, stableContextSources)}
remarkPlugins={[remarkGfm.default]}
rehypePlugins={[addQualityMarkersPlugin]}
remarkPlugins={remarkGfm ? [remarkGfm.default] : []}
rehypePlugins={addQualityMarkersPlugin ? [addQualityMarkersPlugin] : []}
>
{displayContent}
</Markdown>
Expand Down
2 changes: 1 addition & 1 deletion src/ChatBlock/packets/renderers/ReasoningRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const ReasoningRenderer: MessageRenderer<ReasoningPacket> = ({
const renderedContent = (
<div className="reasoning-content">
<Markdown
remarkPlugins={[remarkGfm.default]}
remarkPlugins={remarkGfm ? [remarkGfm.default] : []}
components={components(message)}
>
{addCitations(content, message)}
Expand Down
17 changes: 10 additions & 7 deletions src/ChatBlock/services/streamingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ export async function* handleStream(
*/
export async function* sendMessage({
regenerate,
retrieval_options,
message,
fileDescriptors,
currentMessageFiles,
Expand Down Expand Up @@ -201,13 +202,15 @@ export async function* sendMessage({
file_descriptors: fileDescriptors,
current_message_files: currentMessageFiles,
regenerate,
retrieval_options: !documentsAreSelected
? {
run_search: queryOverride || forceSearch ? 'always' : 'auto',
real_time: true,
filters: filters,
}
: null,
retrieval_options:
retrieval_options ??
(!documentsAreSelected
? {
run_search: queryOverride || forceSearch ? 'always' : 'auto',
real_time: true,
filters: filters,
}
: null),
query_override: queryOverride,
prompt_override: systemPromptOverride
? {
Expand Down
12 changes: 12 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,16 @@ const applyConfig = (config) => {
return config;
};

export {
createChatSession,
sendMessage,
} from './ChatBlock/services/streamingService';
export { MessageProcessor } from './ChatBlock/services/messageProcessor';
export { default as withDanswerData } from './ChatBlock/hocs/withDanswerData';
export * from './ChatBlock/packets';

export { default as UserActionsToolbar } from './ChatBlock/components/UserActionsToolbar';
export { default as FeedbackModal } from './ChatBlock/components/FeedbackModal';
export { default as ChatMessageFeedback } from './ChatBlock/components/ChatMessageFeedback';

export default applyConfig;