Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9848403
fix: mobile and safari scroll
bacalj Jul 31, 2025
374eb60
wip: scope useKeyboardNavigation to specific bot instance
bacalj Aug 1, 2025
1680042
refactor: enable keyboard navigation for multiple bot instances
bacalj Aug 1, 2025
bcddfe9
chore: compile build
bacalj Aug 1, 2025
2bdc12c
2.4.8-debug.0
bacalj Aug 1, 2025
08e9642
fix: Convert custom components to function-based for cross-environmen…
bacalj Aug 5, 2025
c2e8eda
2.4.8-debug.1
bacalj Aug 5, 2025
1b4ca15
chore: console.info
bacalj Aug 5, 2025
abd2be2
2.4.8-debug.2
bacalj Aug 5, 2025
94e241d
Update react-chatbotify to v2.2.0 and fix custom component patterns
bacalj Aug 5, 2025
15aca3f
Make all custom components consistently function-based
bacalj Aug 5, 2025
d91b9de
2.5.0-debug.0
bacalj Aug 5, 2025
e27eae6
chore: message
bacalj Aug 5, 2025
e566989
Eliminate custom components for cross-environment compatibility
bacalj Aug 5, 2025
dda5afe
2.5.1-debug.0
bacalj Aug 5, 2025
81d0291
chore: version info
bacalj Aug 5, 2025
7aee79d
chore: compiled
bacalj Aug 5, 2025
91675f5
fix: bring back login button and auth indicator in the header
bacalj Aug 5, 2025
92079f2
2.5.1-debug.1
bacalj Aug 5, 2025
dff86ce
chore: info message
bacalj Aug 5, 2025
234af0b
Fix async submission timing issues for cross-environment compatibility
bacalj Aug 5, 2025
85efc98
chorse: console info
bacalj Aug 5, 2025
55e6daa
2.5.1-debug.2
bacalj Aug 5, 2025
1cb59b0
debug: console.info statements that will persist through compilation …
bacalj Aug 5, 2025
2476e28
wip: adding file input validation
bacalj Aug 6, 2025
9dd932a
wip: simplifiy validation
bacalj Aug 6, 2025
f6fa681
fix: lint
bacalj Aug 6, 2025
02ca80a
fix: upload messages for users
bacalj Aug 6, 2025
eaf8c12
2.5.1-debug.3
bacalj Aug 6, 2025
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
2 changes: 1 addition & 1 deletion build/static/css/main.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/static/css/main.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/static/js/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/static/js/main.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ <h3>Bot Configuration</h3>
<label for="user-logged-in">User logged in</label>
<i>(toggle to control the bots login state)</i>
</div>

<div class="form-group">
<label for="user-email">User Email:</label>
<input type="email" id="user-email" placeholder="[email protected]" />
</div>

<div class="form-group">
<label for="user-name">User Name:</label>
<input type="text" id="user-name" placeholder="John Doe" />
</div>

<div class="form-group">
<label for="accessId">ACCESS ID:</label>
<input type="text" id="accessId" placeholder="johndoe123" />
</div>

<button id="update-bot" class="update-button">Update Bot Configuration</button>
<p class="help-text">Enter user information above and click "Update Bot Configuration" to test pre-populated ticket forms when logged in.</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions local-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ function recreateBots() {
bot2Controller.destroy();
bot2Controller = null;
}

// Clear containers
document.getElementById('qa-bot').innerHTML = '';
document.getElementById('custom-qa-bot').innerHTML = '';

// Recreate with new user info
initializeQABot();
initializeEmbeddedBot();
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@snf/access-qa-bot",
"version": "2.4.7",
"version": "2.5.1-debug.3",
"private": false,
"homepage": ".",
"description": "ACCESS Q&A Bot React Component with support ticket creation, feedback collection, and ProForma integration",
Expand All @@ -24,7 +24,7 @@
"@rcb-plugins/html-renderer": "^0.3.1",
"@rcb-plugins/input-validator": "^0.3.0",
"@rcb-plugins/markdown-renderer": "^0.3.1",
"react-chatbotify": "^2.1.0",
"react-chatbotify": "^2.2.0",
"uuid": "^11.1.0"
},
"peerDependencies": {
Expand Down
34 changes: 19 additions & 15 deletions src/components/QABot.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import { DEFAULT_CONFIG, buildWelcomeMessage } from '../config/constants';
import { createBotFlow } from '../utils/create-bot-flow';
import { FormProvider, useFormContext } from '../contexts/FormContext';

// Build signature for deployment verification
console.info(
`%c🤖 ACCESS QA Bot v2.5.1-debug.3 - Header Components Restored + Built-in File Upload + File Validation [${new Date().toISOString().slice(0,10)}]`
);

const generateSessionId = () => {
return `qa_bot_session_${uuidv4()}`;
Expand Down Expand Up @@ -61,7 +65,7 @@ const QABotInternal = React.forwardRef((props, botRef) => {
const sessionIdRef = useRef(getOrCreateSessionId());
const sessionId = sessionIdRef.current;
const [currentQueryId, setCurrentQueryId] = useState(null);

// Use Form Context instead of local state
const { ticketForm, feedbackForm, updateTicketForm, updateFeedbackForm, resetTicketForm, resetFeedbackForm } = useFormContext();

Expand Down Expand Up @@ -107,15 +111,15 @@ const QABotInternal = React.forwardRef((props, botRef) => {

const handleQuery = useHandleAIQuery(finalApiKey, sessionId, setCurrentQueryId);

const formContext = useMemo(() => ({
ticketForm: ticketForm || {},
feedbackForm: feedbackForm || {},
updateTicketForm,
updateFeedbackForm,
resetTicketForm,
resetFeedbackForm
const formContext = useMemo(() => ({
ticketForm: ticketForm || {},
feedbackForm: feedbackForm || {},
updateTicketForm,
updateFeedbackForm,
resetTicketForm,
resetFeedbackForm
}), [ticketForm, feedbackForm, updateTicketForm, updateFeedbackForm, resetTicketForm, resetFeedbackForm]);

const flow = useMemo(() => createBotFlow({
welcomeMessage,
isBotLoggedIn,
Expand Down Expand Up @@ -159,8 +163,8 @@ const QABotInternal = React.forwardRef((props, botRef) => {
}, []);

return (
<div
className={`qa-bot ${embedded ? "embedded-qa-bot" : ""}`}
<div
className={`qa-bot ${embedded ? "embedded-qa-bot" : ""}`}
ref={containerRef}
role="region"
aria-label="Ask ACCESS tool"
Expand All @@ -180,18 +184,18 @@ const QABotInternal = React.forwardRef((props, botRef) => {
plugins={[HtmlRenderer(), MarkdownRenderer(), InputValidator()]}
/>
{/* Live region for screen reader announcements */}
<div
aria-live="polite"
<div
aria-live="polite"
aria-label="Bot response updates"
className="sr-only"
id="bot-live-region"
/>

{/* Accessibility help text */}
<div id="chat-input-help" className="sr-only">
Type your message and press Enter to send. Use arrow keys to navigate through response options. Press Enter or Space to select an option.
</div>

{/* Keyboard navigation instructions */}
<div id="keyboard-help" className="sr-only">
Available keyboard shortcuts: Arrow keys to navigate options, Enter or Space to select, Tab to move between interactive elements, Escape to close dialogs.
Expand Down
16 changes: 11 additions & 5 deletions src/hooks/useChatBotSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ const useChatBotSettings = ({
loginUrl
}) => {
const isBotLoggedIn = isLoggedIn;

// Check if tooltip has been shown in this session
const hasShownTooltip = sessionStorage.getItem('qa_bot_tooltip_shown');
const tooltipMode = hasShownTooltip ? 'NEVER' : 'START';

const settings = useMemo(() => {
return {
general: {
Expand Down Expand Up @@ -94,18 +94,24 @@ const useChatBotSettings = ({
emoji: {
disabled: true,
},
fileAttachment: {
disabled: true,
},
notification: {
disabled: true,
},
footer: {
text: (<div key="footer-text"><a href="https://support.access-ci.org/tools/access-qa-tool">About this tool</a>.</div>),
buttons: [
Button.FILE_ATTACHMENT_BUTTON,
Button.EMOJI_PICKER_BUTTON,
<NewChatButton key="new-chat-button" />
]
},
fileAttachment: {
disabled: false,
multiple: true,
accept: ".pdf,.png,.jpg,.jpeg,.gif,.doc,.docx,.txt,.csv,.zip",
sendFileName: true,
showMediaDisplay: false
},
event: {
rcbToggleChatWindow: true // Enable chat window toggle event
}
Expand Down
Loading