Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/stage-main-10-c' into stage-main…
Browse files Browse the repository at this point in the history
…-10-a
  • Loading branch information
schuyler1d committed Jan 11, 2021
2 parents b0a3757 + ac482c1 commit 42ab4f0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
30 changes: 23 additions & 7 deletions docs/REFERENCE-shortcut-rules.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
# Texter ShortCuts and when they are displayed
# Texter ShortCuts---Button Labels and When They Are Displayed

On the texter conversation screen, the UI creates "shortcut buttons" for some question responses
and canned replies.
On the texter conversation screen, the UI creates "shortcut buttons" for some question responses and canned replies.

Currently there is no UI to choose the shortcuts or enable/disable them or preview their visibility,
however we hope to do that in the future.
Currently there is no UI to choose the shortcuts or enable/disable them or preview their visibility (the hope is that one will exist in the future). In the meantime, there is a set of rules around character count and punctuation usage that cause shortcut buttons to be shown automatically based on the way the titles of responses are crafted.

The rules assume that buttons will have short labels and that there won't be too many buttons. The general idea is that a texter using a mobile device will see some shortcut buttons and still be able to read the conversation.

## Illustration
![](https://i.imgur.com/rlTEhos.png)
*Above: Some survey responses show up as shortcuts because they are under 36 characters (Yes, No, Undecided, Already Voted + 2 spaces for each = 28+2+2+2+2 = 36). After the survey responses some Other Responses are displayed (Empty text, Who are you?, Wrong Number).*

![](https://i.imgur.com/lPZKFNG.png)
*Above: The corresponding "All Responses" menu may show more survey responses and way more Other Responses. Note how "Another Option" was excluded because of the "-" in front of it. If the "-" hadn't been used the entire set of shortcuts would have disappeared because the character count would have been too high and the rules don't pick and choose for you.*

## TL;DR
Use short labels or strategically use punctuation to get the labels of responses short enough that shortcut buttons will appear.

Survey responses can be **excluded** by starting with a "-"

Other responses can be **included** by starting with a "+"

Adding a punctuation mark after the first word in a response label will truncate that label to just one word (e.g. "**Yes,** you can count on me" -> "**Yes**")

Tip: Use the staging server and open two tabs to test out a set of responses and see what will work. In one tab edit your interactions and canned responses. In the other tab, keep the responding ui open and refresh. This is the best way to experiment quickly and learn the rules either by trial and error or by reading below and trying out each permutation.

In the meantime we document the rules of when they are shown automatically. These rules are meant
to balance real-estate on the screen while avoiding confusion for the texter in some situations.

## Terminology

Expand Down
2 changes: 1 addition & 1 deletion src/components/AssignmentTexter/Controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ export class AssignmentTexterContactControls extends React.Component {
</Popover>
);
}
// TODO: max height and scroll-y
// TODO: max height
return <div className={css(flexStyles.sectionSideBox)}>{sideboxList}</div>;
}

Expand Down
1 change: 1 addition & 0 deletions src/components/AssignmentTexter/StyleControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export const flexStyles = StyleSheet.create({
},
sectionSideBox: {
flex: "0 1 240px",
overflowY: "scroll",
textAlign: "center",
padding: "24px",
maxWidth: "240px",
Expand Down
2 changes: 1 addition & 1 deletion src/server/api/lib/twilio.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const errorDescriptions = {
30006: "Landline or unreachable carrier",
30007: "Message Delivery - Carrier violation",
30008: "Message Delivery - Unknown error",
"-1": "Spoke failed to send the message and will try again.",
"-1": "Spoke failed to send the message, usually due to a temporary issue.",
"-2": "Spoke failed to send the message and will try again.",
"-3": "Spoke failed to send the message and will try again.",
"-4": "Spoke failed to send the message and will try again.",
Expand Down

0 comments on commit 42ab4f0

Please sign in to comment.