Skip to content

Commit cb02ff7

Browse files
Merge pull request #7 from Roopan-Microsoft/PSL-BUG-8413
fix: [Internal-UX] | [Accessibility] | Bug - BYOc - Chat Conversations with chat history
2 parents 0cf1f6c + ef77694 commit cb02ff7

File tree

9 files changed

+32
-8
lines changed

9 files changed

+32
-8
lines changed

ClientAdvisor/App/frontend/src/components/Cards/Cards.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ const Cards: React.FC<CardsProps> = ({ onCardClick }) => {
1717
const [selectedClientId, setSelectedClientId] = useState<string | null>(null);
1818
const [loadingUsers, setLoadingUsers] = useState<boolean>(true);
1919

20+
21+
useEffect(() => {
22+
if(selectedClientId != null && appStateContext?.state.clientId == ''){
23+
setSelectedClientId('')
24+
}
25+
},[appStateContext?.state.clientId]);
26+
2027
useEffect(() => {
2128
const fetchUsers = async () => {
2229
try {

ClientAdvisor/App/frontend/src/components/ChatHistory/ChatHistoryPanel.module.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,11 @@
7777
width: 100%;
7878
}
7979
}
80+
81+
@media screen and (-ms-high-contrast: active), (forced-colors: active) {
82+
.container{
83+
border: 2px solid WindowText;
84+
background-color: Window;
85+
color: WindowText;
86+
}
87+
}

ClientAdvisor/App/frontend/src/components/ChatHistory/ChatHistoryPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export function ChatHistoryPanel(_props: ChatHistoryPanelProps) {
111111
<StackItem>
112112
<Text
113113
role="heading"
114-
aria-level={2}
114+
aria-level={3}
115115
style={{
116116
alignSelf: 'center',
117117
fontWeight: '600',

ClientAdvisor/App/frontend/src/components/common/Button.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
.historyButtonRoot {
2626
width: 180px;
2727
border: 1px solid #d1d1d1;
28+
border-radius: 5px;
2829
}
2930

3031
.historyButtonRoot:hover {

ClientAdvisor/App/frontend/src/pages/chat/Chat.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ html, body {
3535
0px 0px 2px rgba(0, 0, 0, 0.12);
3636
border-radius: 8px;
3737
overflow-y: auto;
38-
max-height: calc(100vh - 300px);
38+
max-height: calc(100vh - 240px);
3939
height: 100vh;
4040
width: 100%;
4141
}

ClientAdvisor/App/frontend/src/pages/chat/Chat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ const Chat = (props: any) => {
751751
<Stack className={styles.chatEmptyState}>
752752
<img src={ui?.chat_logo ? ui.chat_logo : TeamAvatar} className={styles.chatIcon} aria-hidden="true" />
753753
<h1 className={styles.chatEmptyStateTitle}>{ui?.chat_title}</h1>
754-
<h2 className={styles.chatEmptyStateSubtitle}>{ui?.chat_description}</h2>
754+
<h3 className={styles.chatEmptyStateSubtitle}>{ui?.chat_description}</h3>
755755
</Stack>
756756
) : (
757757
<div id="chatMessagesContainer" className={styles.chatMessageStream} style={{ marginBottom: isLoading ? '40px' : '0px' }} role="log">

ClientAdvisor/App/frontend/src/pages/layout/Layout.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ const Layout = () => {
5252
fetchpbi()
5353
}, [])
5454

55+
const resetClientId= ()=>{
56+
appStateContext?.dispatch({ type: 'RESET_CLIENT_ID' });
57+
setSelectedUser(null);
58+
setShowWelcomeCard(true);
59+
}
5560

5661
const closePopup = () => {
5762
setIsVisible(!isVisible);
@@ -157,7 +162,7 @@ const Layout = () => {
157162
/>
158163
<div className={styles.cardsColumn}>
159164
<div className={styles.selectClientHeading}>
160-
<h3 className={styles.meeting}>Upcoming meetings</h3>
165+
<h2 className={styles.meeting}>Upcoming meetings</h2>
161166
</div>
162167

163168
<Cards onCardClick={handleCardClick} />
@@ -167,9 +172,9 @@ const Layout = () => {
167172
<Stack horizontal verticalAlign="center" horizontalAlign="space-between">
168173
<Stack horizontal verticalAlign="center">
169174
<img src={ui?.logo ? ui.logo : TeamAvatar} className={styles.headerIcon} aria-hidden="true" alt="" />
170-
<Link to="/" className={styles.headerTitleContainer}>
171-
<h1 className={styles.headerTitle}>{ui?.title}</h1>
172-
</Link>
175+
<div className={styles.headerTitleContainer} onClick={resetClientId} onKeyDown={e => (e.key === 'Enter' || e.key === ' ' ? resetClientId() : null)} tabIndex={-1}>
176+
<h2 className={styles.headerTitle} tabIndex={0}>{ui?.title}</h2>
177+
</div>
173178
</Stack>
174179
<Stack horizontal tokens={{ childrenGap: 4 }} className={styles.shareButtonContainer}>
175180
{appStateContext?.state.isCosmosDBAvailable?.status !== CosmosDBStatus.NotConfigured && (

ClientAdvisor/App/frontend/src/state/AppProvider.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ export type Action =
5151
| { type: 'GET_FEEDBACK_STATE'; payload: string }
5252
| { type: 'UPDATE_CLIENT_ID'; payload: string }
5353
| { type: 'SET_IS_REQUEST_INITIATED'; payload: boolean }
54-
| { type: 'TOGGLE_LOADER' };
54+
| { type: 'TOGGLE_LOADER' }
55+
| { type: 'RESET_CLIENT_ID'};
5556

5657
const initialState: AppState = {
5758
isChatHistoryOpen: false,

ClientAdvisor/App/frontend/src/state/AppReducer.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ export const appStateReducer = (state: AppState, action: Action): AppState => {
8080
return {...state, isRequestInitiated : action.payload}
8181
case 'TOGGLE_LOADER':
8282
return {...state, isLoader : !state.isLoader}
83+
case 'RESET_CLIENT_ID':
84+
return {...state, clientId: ''}
8385
default:
8486
return state
8587
}

0 commit comments

Comments
 (0)