Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
eb60e26
feat(messaging): show message history on message actions
nmajor25 Nov 17, 2026
d02f404
feat(messaging): add Messages buttons to action header and cards
nmajor25 Nov 17, 2026
1a5806c
feat(messaging): send texts from the message action composer
nmajor25 Nov 17, 2026
b652dbb
feat(messaging): send texts from the Interactions page
nmajor25 Nov 17, 2026
228f130
fix(messaging): add keyboard focus outline to the Messages buttons
nmajor25 Nov 18, 2026
63e76ae
fix(messaging): hide messages when the action form is expanded
nmajor25 Nov 18, 2026
f50ddf9
fix(messaging): wait for a pending timeline load before sending
nmajor25 Nov 18, 2026
3b677a6
fix(messaging): truncate long action names in message cards
nmajor25 Nov 18, 2026
04823f0
test(messaging): wait for loaded history after navigation
nmajor25 Nov 18, 2026
a616a54
feat(messaging): show Not delivered with the reason on rejected texts
nmajor25 Nov 18, 2026
b566b5d
feat(messaging): label and highlight today's messages
nmajor25 Nov 18, 2026
24c74fc
feat(messaging): link message cards by action name only
nmajor25 Nov 18, 2026
76f564f
feat(messaging): fade in texts as they are sent
nmajor25 Nov 18, 2026
15f6d50
feat(messaging): add the Messages section header
nmajor25 Nov 18, 2026
ea9ac94
feat(messaging): add Show more to long texts
nmajor25 Nov 18, 2026
6e99d6d
feat(messaging): jump to a date from the Messages date pills
nmajor25 Nov 18, 2026
510f715
fix(messaging): run the sent text fade-in only once
nmajor25 Nov 18, 2026
2305db1
feat(messaging): keep an unsent text for the browser session
nmajor25 Nov 19, 2026
74703c3
feat(messaging): live updates for action Messages
nmajor25 Nov 19, 2026
5c8c280
feat(messaging): show the beginning of messages once all texts are lo…
nmajor25 Nov 19, 2026
6cbcc61
feat(messaging): group back-to-back texts
nmajor25 Nov 19, 2026
ff45bc6
feat(messaging): show message history on actions tagged message
nmajor25 Nov 20, 2026
9ef34a4
feat(messaging): show a disabled composer when the patient has no mob…
nmajor25 Nov 20, 2026
e1023e7
test(interactions): keep history fixture dates the same in any timezone
nmajor25 Nov 20, 2026
d353380
refactor(messaging): restore an unsent text through the draft
nmajor25 Nov 20, 2026
f40924a
refactor(messaging): simplify message history grouping and loading
nmajor25 Nov 20, 2026
8706c4d
test(messaging): move messages button checks to their pages
nmajor25 Nov 20, 2026
21ed29e
feat(messaging): show the Messages button on Schedule list actions
nmajor25 Nov 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/js/apps/patients/patient/action/action-activity_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ export default App.extend({
onBeforeStart() {
this.showView(new ActionActivityLoadingView());
},
prepareStart({ action, patient }, { signal }) {
prepareStart({ action, patient, excludeTexts }, { signal }) {
return Promise.all([
Radio.request('entities', 'fetch:actionEvents:collection', action.id, { signal }),
Radio.request('entities', 'fetch:comments:collection:byAction', action.id, { signal }),
Radio.request('entities', 'fetch:interactions:models:forActivity', { patientId: patient.id, actionId: action.id }, { signal })
Radio.request('entities', 'fetch:interactions:models:forActivity', { patientId: patient.id, actionId: action.id, excludeTexts }, { signal })
.then(models => ({ models }), error => {
signal.throwIfAborted();
return { models: [], error };
Expand Down
11 changes: 11 additions & 0 deletions src/js/apps/patients/patient/action/action-details_views.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import InputWatcherBehavior from 'js/behaviors/input-watcher';
import { StateComponent, OwnerComponent, DueView, TimeComponent, DurationComponent } from 'js/apps/patients/shared/actions_views';
import { ReadOnlyStateView, ReadOnlyOwnerView, ReadOnlyDueDateTimeView, ReadOnlyDurationView } from 'js/apps/patients/shared/read-only_views';
import { DialerView } from 'js/apps/patients/patient/action/action-dialer_views';
import { canShowMessages } from 'js/apps/patients/shared/messaging/availability';

import ActionDetailsTemplate from './action-details.hbs';
import ActionEditTemplate from './action-edit.hbs';
Expand Down Expand Up @@ -50,10 +51,18 @@ const NameView = View.extend({
</span>
{{/if}}
<span class="patient-action__name" data-testid="patient-action-name">{{ name }}</span>
{{#if hasMessages}}<button class="patient-action__messages-button js-messages" type="button" aria-label="{{ @intl.patients.patient.action.detailsViews.nameView.messagesLabel }}">{{far "paper-plane-top"}}</button>{{/if}}
`,
ui: {
messages: '.js-messages',
},
triggers: {
'click @ui.messages': 'click:messages',
},
templateContext() {
return {
icon: getActionIcon(this.model),
hasMessages: canShowMessages(this.model),
};
},
});
Expand Down Expand Up @@ -150,6 +159,7 @@ const ReadOnlyActionView = View.extend({
childViewTriggers: {
'click:attachments': 'click:attachments',
'click:comments': 'click:comments',
'click:messages': 'click:messages',
},
onRender() {
this.showChildView('name', new NameView({ model: this.model }));
Expand Down Expand Up @@ -203,6 +213,7 @@ const ActionView = View.extend({
'cancel': 'cancel',
'click:attachments': 'click:attachments',
'click:comments': 'click:comments',
'click:messages': 'click:messages',
},
template: ActionEditTemplate,
regions: {
Expand Down
30 changes: 30 additions & 0 deletions src/js/apps/patients/patient/action/action.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.patient-action__header,
.patient-action__form,
.patient-action__messages,
.patient-action__attachments,
.patient-action__activity {
margin-inline: auto;
Expand Down Expand Up @@ -205,6 +206,33 @@
display: none;
}

.patient-action__messages-button {
align-items: center;
background: none;
border: 0;
color: color(blue);
cursor: pointer;
display: inline-flex;
font-size: 16px;
margin-left: 8px;
padding: 0;
vertical-align: middle;
}

.patient-action__messages-button:focus,
.patient-action__messages-button:hover {
color: color(blue, dark);
}

.patient-action__messages-button:focus-visible {
outline: 2px solid color(blue);
outline-offset: 2px;
}

.patient-action__messages-button .icon {
display: block;
}

.patient-action__count {
align-items: center;
background: transparent;
Expand Down Expand Up @@ -271,6 +299,7 @@

.patient-action--form-expanded .patient-action__header,
.patient-action--form-expanded .patient-action__form,
.patient-action--form-expanded .patient-action__messages,
.patient-action--form-expanded .patient-action__attachments,
.patient-action--form-expanded .patient-action__activity {
width: calc(100% - 48px);
Expand All @@ -284,6 +313,7 @@
}

.patient-action--form-expanded .patient-action__header,
.patient-action--form-expanded .patient-action__messages,
.patient-action--form-expanded .patient-action__attachments,
.patient-action--form-expanded .patient-action__activity {
display: none;
Expand Down
22 changes: 20 additions & 2 deletions src/js/apps/patients/patient/action/action_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ import { ActionView, ReadOnlyActionView } from 'js/apps/patients/patient/action/
import { FormLayoutView } from 'js/apps/patients/patient/action/action-forms_views';
import ActivityApp from 'js/apps/patients/patient/action/action-activity_app';
import AttachmentsApp from 'js/apps/patients/patient/action/action-attachments_app';
import MessagesApp from 'js/apps/patients/patient/action/messages/messages_app';
import FormApp from 'js/apps/patients/patient/form/form_app';
import { canShowMessages } from 'js/apps/patients/shared/messaging/availability';

export default App.extend({
childApps: {
activity: ActivityApp,
attachments: AttachmentsApp,
form: FormApp,
messages: MessagesApp,
},
initialize() {
this.listenTo(this.getChildApp('form'), 'toggle:expanded', this.onToggleFormExpanded);
Expand Down Expand Up @@ -125,8 +128,10 @@ export default App.extend({

this.showContent();
this.showMenu();
this.activityApp = this.startActivity(entryTarget?.section);
this.attachmentsApp = this.startAttachments(entryTarget?.section);
const section = entryTarget?.section;
this.startMessages(section);
this.activityApp = this.startActivity(section);
this.attachmentsApp = this.startAttachments(section);

this.updateContext();

Expand Down Expand Up @@ -188,6 +193,7 @@ export default App.extend({
this.listenTo(actionView, {
'click:attachments': () => this.attachmentsApp.focus(),
'click:comments': () => this.activityApp.focus(),
'click:messages': () => this.getChildApp('messages').focus(),
});
},
showMenu() {
Expand Down Expand Up @@ -276,10 +282,22 @@ export default App.extend({
action: this.action,
patient: this.patient,
focusOnLoad: initialSection === 'comments',
excludeTexts: canShowMessages(this.action),
}).catch(addError);

return activityApp;
},
startMessages(initialSection) {
if (!canShowMessages(this.action)) return;

this.getChildApp('messages').start({
region: this.getView().getRegion('messages'),
action: this.action,
patient: this.patient,
viewport: this.getView().getViewportElement(),
focusOnLoad: initialSection === 'messages',
}).catch(addError);
},
startAttachments(initialSection) {
const attachmentsApp = this.getChildApp('attachments');

Expand Down
4 changes: 4 additions & 0 deletions src/js/apps/patients/patient/action/action_views.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ const LayoutView = View.extend({
el: '[data-activity-region]',
regionClass: FocusablePreloadRegion,
},
messages: {
el: '[data-messages-region]',
regionClass: FocusablePreloadRegion,
},
attachments: {
el: '[data-attachments-region]',
regionClass: FocusablePreloadRegion,
Expand Down
1 change: 1 addition & 0 deletions src/js/apps/patients/patient/action/layout.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
<div data-menu-region></div>
</header>
<div class="patient-action__form" data-form-region></div>
<div class="patient-action__messages" data-messages-region tabindex="-1"></div>
Comment thread
nmajor25 marked this conversation as resolved.
Resolved
<div class="patient-action__attachments" data-attachments-region tabindex="-1"></div>
<div class="patient-detail-page__activity patient-action__activity" data-activity-region tabindex="-1"></div>
14 changes: 14 additions & 0 deletions src/js/apps/patients/patient/action/messages/layout.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<div class="messaging-history__header js-header">
<div class="messaging-history__title">
<span class="messaging-history__icon" aria-hidden="true">{{far "paper-plane-top"}}</span>
<h2 class="messaging-history__heading">{{ @intl.patients.patient.action.messages.messagesViews.heading }}</h2>
<span class="messaging-history__subheading">{{formatMessage (intlGet "patients.patient.action.messages.messagesViews.subheading") name=patientName}}</span>
</div>
<div class="messaging-history__header-date" data-current-date-region></div>
<button class="messaging-history__interactions js-interactions" type="button">{{far "right-left-large"}} {{ @intl.patients.patient.action.messages.messagesViews.viewOnInteractions }}</button>
</div>
<button class="button button--text messaging-history__older js-older" type="button" hidden>{{ @intl.patients.patient.action.messages.messagesViews.older }}</button>
<p class="messaging-history__beginning js-beginning" hidden>{{formatMessage (intlGet "patients.patient.action.messages.messagesViews.beginning") name=patientName}}</p>
<p class="messaging-history__status js-status" role="status"></p>
<ol data-days-region></ol>
<div data-composer-region></div>
Loading
Loading