Skip to content

Commit

Permalink
Add word-wrap to messageActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
Corina committed Mar 21, 2019
1 parent 1512fe6 commit 41bde7d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed
- Fix [#1423](https://github.com/Microsoft/BotFramework-WebChat/issues/1423). Added sample for hosting WebChat in Angular, by [@omarsourour](https://github.com/omarsourour) in PR [#1813](https://github.com/Microsoft/BotFramework-WebChat/pull/1813)
- Fix [#1767](https://github.com/Microsoft/BotFramework-WebChat/issues/1767). Remove `cursor: pointer` from buttons, by [@corinagum](https://github.com/corinagum) in PR [#1819](https://github.com/Microsoft/BotFramework-WebChat/pull/1819)
- Fix [#1774](https://github.com/Microsoft/BotFramework-WebChat/issues/1774). Add `styleSetOption` to allow word break. Default to `break-word` , by [@corinagum](https://github.com/corinagum) in PR [#zzz](https://github.com/Microsoft/BotFramework-WebChat/pull/zzz)

## [4.3.0] - 2019-03-04

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions __tests__/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,16 @@ test('setup', async () => {

expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions);
});

test('long urls', async () => {
const { driver, pageObjects} = await setupWebDriver();

await pageObjects.sendMessageViaSendBox('https://subdomain.domain.com/pathname0/pathname1/pathname2/pathname3/pathname4/')

await driver.wait(minNumActivitiesShown(2), 2000);
await driver.wait(allImagesLoaded(), 2000);

const base64PNG = await driver.takeScreenshot();

expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions);
});
4 changes: 3 additions & 1 deletion packages/component/src/Styles/StyleSet/Bubble.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ export default function createBubbleStyle({
bubbleFromUserTextColor,
bubbleMaxWidth,
bubbleMinHeight,
bubbleTextColor
bubbleTextColor,
messageActivityWordBreak
}) {
return {
maxWidth: bubbleMaxWidth,
minHeight: bubbleMinHeight,
wordBreak: messageActivityWordBreak,

'&:not(.from-user)': {
background: bubbleBackground,
Expand Down
5 changes: 4 additions & 1 deletion packages/component/src/Styles/defaultStyleSetOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const DEFAULT_OPTIONS = {
paddingWide: 20,
subtle: DEFAULT_SUBTLE,

// Word break
messageActivityWordBreak: 'break-word', // 'normal' || 'break-all' || 'break-word' || 'keep-all'

// fonts
primaryFont: fontFamily(['Calibri', 'Helvetica Neue', 'Arial', 'sans-serif']),
monospaceFont: fontFamily(['Consolas', 'Courier New', 'monospace']),
Expand Down Expand Up @@ -43,7 +46,7 @@ const DEFAULT_OPTIONS = {
// Root
rootHeight: '100%',
rootWidth: '100%',

// Send box
hideSendBox: false,
hideUploadButton: false,
Expand Down

0 comments on commit 41bde7d

Please sign in to comment.