Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Commit 64d0eb7

Browse files
authored
Merge branch 'master' into toanzian/state
2 parents e60786f + 3b1c824 commit 64d0eb7

12 files changed

Lines changed: 83 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
- [client/main] Moved duplicate redux store code (actions / reducers / helpers) to `app/shared` package in PR [2060](https://github.com/microsoft/BotFramework-Emulator/pull/2060)
1616
- [client] Fixed an issue where trying to add a QnA KB manually after signing into Azure was causing the app to crash in PR [2066](https://github.com/microsoft/BotFramework-Emulator/pull/2066)
1717
- [client] Removed buble background on attachments [2067](https://github.com/microsoft/BotFramework-Emulator/pull/2067)
18+
- [client] Fixed an issue where the themes menu was empty on Windows & Linux in PR [2069](https://github.com/microsoft/BotFramework-Emulator/pull/2069)
1819

1920
## Removed
2021
- [client/main] Removed legacy payments code in PR [2058](https://github.com/microsoft/BotFramework-Emulator/pull/2058)

packages/app/client/src/ui/editor/emulator/parts/chat/chat.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3232
//
3333

34+
:export { bubbleContentColor: var(--bubble-text-color); }
35+
3436
.chat {
3537
background-color: white;
3638
display: flex;

packages/app/client/src/ui/editor/emulator/parts/chat/chat.scss.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// This is a generated file. Changes are likely to result in being overwritten
2+
export const bubbleContentColor: string;
23
export const chat: string;
34
export const disconnected: string;
45
export const chatActivity: string;

packages/app/client/src/ui/editor/emulator/parts/chat/chat.spec.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ import webChatStyleOptions from './webChatTheme';
5555
import { ChatContainer } from './chatContainer';
5656
import { ChatProps, Chat } from './chat';
5757

58+
jest.mock('./chat.scss', () => ({
59+
get bubbleContentColor() {
60+
return '#fff';
61+
},
62+
}));
63+
5864
jest.mock('electron', () => ({
5965
ipcMain: new Proxy(
6066
{},
@@ -155,6 +161,20 @@ describe('<ChatContainer />', () => {
155161
padding: '1px',
156162
};
157163

164+
styleSet.uploadAttachment = {
165+
...styleSet.uploadAttachment,
166+
'& > .name, & > .size': {
167+
color: '#fff',
168+
},
169+
};
170+
171+
const mutatedDownloadAttachment = {
172+
...styleSet.downloadAttachment,
173+
};
174+
mutatedDownloadAttachment['& > a']['& > .details']['& > .name'].color = '#fff';
175+
mutatedDownloadAttachment['& > a']['& > .icon'].fill = '#fff';
176+
styleSet.downloadAttachment = mutatedDownloadAttachment;
177+
158178
expect(webChat.exists()).toBe(true);
159179
const wcProps = webChat.props();
160180
expect(wcProps.bot).toEqual({ id: defaultDocument.botId, name: 'Bot' });

packages/app/client/src/ui/editor/emulator/parts/chat/chat.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,19 @@ interface ChatState {
6565
highlightedActivities?: Activity[];
6666
}
6767

68+
const updateDownloadAttachmentStyle = downloadAttachment => {
69+
try {
70+
const mutatedDownloadAttachment = {
71+
...downloadAttachment,
72+
};
73+
mutatedDownloadAttachment['& > a']['& > .details']['& > .name'].color = styles.bubbleContentColor;
74+
mutatedDownloadAttachment['& > a']['& > .icon'].fill = styles.bubbleContentColor;
75+
return mutatedDownloadAttachment;
76+
} catch {
77+
return downloadAttachment;
78+
}
79+
};
80+
6881
export class Chat extends PureComponent<ChatProps, ChatState> {
6982
public state = { waitForSpeechToken: false } as ChatState;
7083
private activityMap: { [activityId: string]: Activity } = {};
@@ -87,10 +100,18 @@ export class Chat extends PureComponent<ChatProps, ChatState> {
87100

88101
const styleSet = createStyleSet({ ...webChatStyleOptions, hideSendBox: isDisabled });
89102

103+
// Overriding default styles of webchat as these properties are not exposed directly
90104
styleSet.uploadButton = {
91105
...styleSet.uploadButton,
92106
padding: '1px',
93107
};
108+
styleSet.uploadAttachment = {
109+
...styleSet.uploadAttachment,
110+
'& > .name, & > .size': {
111+
color: styles.bubbleContentColor,
112+
},
113+
};
114+
styleSet.downloadAttachment = updateDownloadAttachmentStyle(styleSet.downloadAttachment);
94115

95116
if (directLine) {
96117
const bot = {
@@ -146,10 +167,19 @@ export class Chat extends PureComponent<ChatProps, ChatState> {
146167
popup.location.href = url;
147168
break;
148169
}
170+
149171
case 'downloadFile':
172+
//Fall through
173+
150174
case 'playAudio':
175+
//Fall through
176+
151177
case 'playVideo':
178+
//Fall through
179+
152180
case 'showImage':
181+
//Fall through
182+
153183
case 'openUrl':
154184
if (value) {
155185
this.props.showOpenUrlDialog(value).then(result => {

packages/app/client/src/ui/editor/emulator/parts/chat/webChatTheme.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export default {
3838
primaryFont: 'var(--default-font-family)',
3939

4040
bubbleBackground: 'var(--webchat-bubble-bg)',
41+
bubbleFromUserBackground: 'var(--webchat-user-bubble-bg)',
4142
bubbleFromUserTextColor: 'var(--webchat-user-bubble-text)',
4243
bubbleTextColor: 'var(--webchat-bubble-text)',
4344
bubbleMinHeight: 20,

packages/app/client/src/ui/editor/ngrokDebugger/ngrokStatusIndicator.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
%common-tunnel-indicator {
1616
margin-right: 3px;
1717
padding: 5px;
18-
color: var(--focused-list-item);
18+
color: var(--ngrok-text-color);
1919
}
2020

2121
.tunnel-details-list {

packages/app/client/src/ui/shell/appMenu/appMenu.spec.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,25 @@ describe('<AppMenu />', () => {
112112
...instance.props,
113113
activeBot: undefined,
114114
activeDocumentType: SharedConstants.ContentTypes.CONTENT_TYPE_WELCOME_PAGE,
115+
availableThemes: [
116+
{ name: 'Light', href: '' },
117+
{ name: 'Dark', href: '' },
118+
{ name: 'High contrast', href: '' },
119+
],
120+
currentTheme: 'Light',
121+
recentBots: [
122+
{ displayName: 'bot1', path: 'path1' },
123+
{ displayName: 'bot2', path: 'path2' },
124+
{ displayName: 'bot3', path: 'path3' },
125+
{ displayName: 'bot4', path: 'path4' },
126+
],
115127
};
116128
const menuTemplate = (instance as any).updateMenu(AppMenuTemplate.template);
117129

118130
expect(Object.keys(menuTemplate)).toHaveLength(6);
131+
expect(menuTemplate['file'][3].items.length).toBe(4); // recent bots menu should be populated
119132
expect(menuTemplate['file'][7].disabled).toBe(true); // "Close tab" should be disabled
133+
expect(menuTemplate['file'][14].items.length).toBe(3); // themes menu should be populated
120134
expect(menuTemplate['conversation'][0].disabled).toBe(true); // send activity menu should be disabled on welcome page
121135
});
122136

packages/app/client/src/ui/shell/appMenu/appMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class AppMenu extends React.Component<AppMenuProps, {}> {
8686

8787
private updateMenu(template: { [key: string]: MenuItem[] }): { [key: string]: MenuItem[] } {
8888
const fileMenu = template['file'];
89-
fileMenu[12].items = this.getThemeMenuItems();
89+
fileMenu[14].items = this.getThemeMenuItems();
9090
fileMenu[3].items = this.getRecentBotsMenuItems();
9191
// disable / enable "Close tab" button
9292
fileMenu[7].disabled = !this.props.activeBot;

packages/app/client/src/ui/styles/themes/dark.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ html {
297297
--ngrok-active: #47B07F;
298298
--ngrok-error: #BE1100;
299299
--ngrok-error-outline: #F5B1B1;
300+
--ngrok-text-color: #fff;
301+
302+
/* Webchat style overrides */
303+
--bubble-text-color: #fff;
300304
}
301305

302306
.dialog {

0 commit comments

Comments
 (0)