-
Notifications
You must be signed in to change notification settings - Fork 0
UX improvements: clearer copy, consistent naming, no fabricated replies #12
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
Open
alfredodelfabro
wants to merge
9
commits into
develop
Choose a base branch
from
fix/ux-improvements
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f61fffe
fix: adds custom start message in the help command
alfredodelfabro 43bdbec
fix: show bot reply name as Time-Off instead of TimeOff Bot
alfredodelfabro f2d69ff
fix: changes app's name in the list command
alfredodelfabro 8ad98d8
fix: refine Time-off UX copy and naming consistency
alfredodelfabro 5180c1d
feat: add friendly hint when typing /time-off command
alfredodelfabro bdc8cfe
fix: align status-out message with not-started copy
alfredodelfabro 686b68a
fix: render time-off message as blockquote instead of preview block
alfredodelfabro e5ef7cc
feat: clarify time-off start confirmation message
alfredodelfabro a9466d9
fix: stop sending fabricated reply messages on user's behalf
alfredodelfabro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,22 @@ | ||
| export const NOTIFICATION_MESSAGES = { | ||
| started: `You are marked as Time Off, we will see you when you get back. Use \`/time-off end\` to end your time off.`, | ||
| default_reply_message: `I am out of office, I will get back to you soon.`, | ||
| started: (customMessage?: string): string => { | ||
| const intro = `*Time off on*\nI will automatically reply to any direct messages you receive to let the sender know you're on time off.`; | ||
| const reminder = `Remember to use the \`/time-off end\` command when you get back.`; | ||
|
|
||
| if (customMessage) { | ||
| const quoted = customMessage | ||
| .split('\n') | ||
| .map((line) => `> ${line}`) | ||
| .join('\n'); | ||
| return `${intro}\n\nI will also include the following custom message:\n${quoted}\n\n${reminder}`; | ||
| } | ||
|
|
||
| return `${intro}\n\nYou have not set a custom reply message.\n\n${reminder}`; | ||
| }, | ||
| ended: `Welcome back! You are no longer marked as Time Off.`, | ||
| not_started: `You are not marked as Time Off. Use \`/time-off start\` to start your time off.`, | ||
| not_started: `*Time-off off*\nI will not automatically reply to any direct messages you receive.`, | ||
| status_in: `You are currently marked as Time Off. Your message is: `, | ||
| status_out: `You are \`not\` marked as Time Off.`, | ||
| status_in_no_message: `You are currently marked as Time Off. You have not set a custom reply message.`, | ||
| status_out: `*Time-off off*\nI will not automatically reply to any direct messages you receive.`, | ||
| error: `An error occurred while updating your Time Off status. Please try again later.`, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,36 @@ | ||
| import { LayoutBlock } from '@rocket.chat/ui-kit'; | ||
|
|
||
| export class TimeOffMessageFormatter { | ||
| public static format(username: string, message: string): LayoutBlock[] { | ||
| return [ | ||
| public static format(username: string, message?: string): LayoutBlock[] { | ||
| const headerText = message | ||
| ? `${username} is currently on time off. They left the following message:` | ||
| : `${username} is currently on time off.`; | ||
|
|
||
| const blocks: LayoutBlock[] = [ | ||
| { | ||
| type: 'section', | ||
| text: { | ||
| type: 'mrkdwn', | ||
| text: `${username} is currently *unavailable* to answer your message, however they left the following message:\n\n`, | ||
| text: headerText, | ||
| }, | ||
| }, | ||
| { | ||
| type: 'preview', | ||
| title: [], | ||
| description: [ | ||
| { | ||
| type: 'mrkdwn', | ||
| text: message, | ||
| }, | ||
| ], | ||
| }, | ||
| ]; | ||
|
|
||
| if (message) { | ||
| const quoted = message | ||
| .split('\n') | ||
| .map((line) => `> ${line}`) | ||
| .join('\n'); | ||
|
|
||
| blocks.push({ | ||
| type: 'section', | ||
| text: { | ||
| type: 'mrkdwn', | ||
| text: quoted, | ||
| }, | ||
| }); | ||
| } | ||
|
|
||
| return blocks; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "Time_Off_Command_Description": "Manage your time off — start, end, or check your status", | ||
| "Time_Off_Command_Params_Example": "start | end | status | help" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Legacy-message gap: entries created before this PR have the old default
"I am out of office, I will get back to you soon."persisted inmessage— the previousStart.tswrote it into the record at save time. For anyone already on time off when this version deploys, this branch still sees a truthymessage, so the app keeps sending the fabricated text — now explicitly framed as "They left the following message:", i.e. presented as something the user personally wrote./time-off statushas the same problem, so the PR's headline goal (never put words in the user's mouth) silently fails for exactly those users, with no migration to fix it.Suggested fix: normalize at read time in
TimeOffRepository.findByUserId— if the storedmessageequals the legacy default string, treat it as unset:A single read-time check covers both this handler and the status command, and it self-heals persistence: the next
saveTimeOff(e.g. the cooldown-timestamp update) writes the record back without the legacy message.