-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sample: Password input activity #1569
Conversation
Pull Request Test Coverage Report for Build 781
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicky things
93ff0d8
to
f93a9a9
Compare
@corinagum all comments fixed. 😄 |
What is the plan to address the coverage? |
@cwhitten Post 4.3, we will start writing tests. And in this mode, we will reject any PRs with decreased coverage. I don't know how far we could go if we strictly enforce it, but I suggest we should try this strategy out first and see how far we can stretch. For tests that is not visual (no UI), for example, speech, I already have a plan on how to make this feature visible for our visual regression test engine (hint: via middleware and ponyfill). For now, with only 1 test (Corina is adding some), the coverage number usually fluctuate +/- 2%. IMO, this is acceptable before we start writing comprehensive tests. |
f93a9a9
to
4d4c4f2
Compare
@corinagum can you review this again for me? I made some change to the timestamp grouping to fix test failures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments & one question :)
Background
This sample will add a custom activity that show a password input and the content will be submitted thru postback.
The custom activity looks like:
Design considerations
Today, we are hiding activities thru a predicate function named
shouldShowActivity
inBasicTranscript.js
. Although this approach make timestamp grouping logic straightforward, the user has no control on what type of activities will be visible. Currently, we only show message activity and bot's typing activity.We are moving hide/show logic to activity middleware instead. So all activity middleware will be able to process all types of activity and decide which should be show or hidden.
For our default activity middleware, we will show message and bot's typing activity, and hide empty message, event, postback and user's typing. For all other unhandled activity type, they will show up as an error box.
Since custom middleware are always executed before default middleware, any new activity type should be handled by custom middleware. Middleware can choose to override visibility. For example, in this sample, the middleware has chosen to show
event
activity as a password input box, before sinking the activity to the default middleware, which will hide theevent
activity.For this change, we are forced to group timestamp only after render complete (after middleware finish). Thus, we will need to use CSS to filter out timestamp on render time, instead of JavaScript logic as of today.
Changelog
Fixed
component
: Fix #1547. Fixed unhandled activity type should be forwarded to custom middleware, by @compulim in PR #1569Samples
component
: Password input activity, in #1569