Skip to content

Commit

Permalink
add chat send history sample (#1678)
Browse files Browse the repository at this point in the history
* add chat send history sample

* update changelog

* do not step through history when use has modified input

* move samples to correct place in changelog
  • Loading branch information
a-b-r-o-w-n authored Feb 4, 2019
1 parent bd3c22c commit ba2a382
Show file tree
Hide file tree
Showing 16 changed files with 17,171 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- `core`: Added `sendEvent`, in PR [#1286](https://github.com/Microsoft/BotFramework-WebChat/pull/1286)
- `core`: Added `CONNECT_FULFILLING` action to workaround `redux-saga` [design decision](https://github.com/redux-saga/redux-saga/issues/1651), in PR [#1286](https://github.com/Microsoft/BotFramework-WebChat/pull/1286)
- `component`: Added missing Spanish (es-ES) locale by [@schgressive](https://github.com/schgressive) in PR [#1615](https://github.com/Microsoft/BotFramework-WebChat/pull/1615)
- `samples`: Added selectable chat activity sample, by [@a-b-r-o-w-n](https://github.com/a-b-r-o-w-n), in PR [#1624](https://github.com/Microsoft/BotFramework-WebChat/pull/1624)
- Added missing Spanish (es-ES) locale by [@schgressive](https://github.com/schgressive) in PR [#1615](https://github.com/Microsoft/BotFramework-WebChat/pull/1615)
- Fix [#1602](https://github.com/Microsoft/BotFramework-WebChat/issues/1602). Fix suggested actions regression of buttons, by [@corinagum](https://github.com/corinagum) in PR [#1616](https://github.com/Microsoft/BotFramework-WebChat/pull/1616)
- `core`: Send `conversationUpdate` activity on connect, by [@compulim](https://github.com/compulim), in PR [#1608](https://github.com/Microsoft/BotFramework-WebChat/pull/1608)
Expand Down Expand Up @@ -80,6 +79,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- `*`: Updated [minimizable Web Chat](https://microsoft.github.io/BotFramework-WebChat/12.customization-minimizable-web-chat/) sample to use `WEB_CHAT/SEND_EVENT` action, in [#1631](https://github.com/Microsoft/BotFramework-WebChat/pull/1631)
- `component`: [Hybrid speech engine](https://microsoft.github.io/BotFramework-WebChat/06.f.hybrid-speech/), in [#1617](https://github.com/Microsoft/BotFramework-WebChat/pull/1617)
- `component`: Use Speech Services token for [speech UI sample](https://microsoft.github.io/BotFramework-WebChat/13.customization-speech-ui/), in [#1634](https://github.com/Microsoft/BotFramework-WebChat/pull/1634)
- `component`: [Selectable Activity](https://microsoft.github.io/BotFramework-WebChat/16.customization-selectable-activity/), in [#1624](https://github.com/Microsoft/BotFramework-WebChat/pull/1624)
- `component`: [Chat Send History](https://microsoft.github.io/BotFramework-WebChat/17.chat-send-history/), in [#1678](https://github.com/Microsoft/BotFramework-WebChat/pull/1678)

## [4.2.0] - 2018-12-11
### Added
Expand Down
3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"samples/12.customization-minimizable-web-chat",
"samples/13.customization-speech-ui",
"samples/14.customization-piping-to-redux",
"samples/16.customization-selectable-activity"
"samples/16.customization-selectable-activity",
"samples/17.chat-send-history"
],
"version": "0.0.0"
}
1 change: 1 addition & 0 deletions packages/component/src/SendBox/TextBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export default connectSendTextBox(
{ ({ sendFocusRef }) =>
<input
aria-label={ typeYourMessageString }
data-id="webchat-sendbox-input"
disabled={ disabled }
onChange={ onChange }
placeholder={ typeYourMessageString }
Expand Down
21 changes: 21 additions & 0 deletions samples/17.chat-send-history/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
26 changes: 26 additions & 0 deletions samples/17.chat-send-history/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Chat Send History

This sample shows how to implement a chat history that can be accessed by using the arrow keys when the
sendbox input has focus. It aims to give an experience similar to a terminal history.

> _Note: This is just a proof of concept thus should not be used in production
> and lacks performance and security considerations._
# Test out the hosted sample

- [Try out with MockBot](https://microsoft.github.io/BotFramework-WebChat/17.chat-send-history)

# Things to try out

- Send some messages to the bot.
- Use the up and down arrow keys to cycle through the send history.
- Modify an entry in the history, this creates a new entry.

# Other ideas

- Autocomplete using history
- Search through history

## Full list of Web Chat hosted samples

View the list of available samples by clicking [here](https://github.com/Microsoft/BotFramework-WebChat/tree/master/samples)
Loading

0 comments on commit ba2a382

Please sign in to comment.