goctests0 commited on
Commit
22afef7
·
verified ·
1 Parent(s): 7fe5601

Upload 2 files

Browse files
Files changed (2) hide show
  1. templates/patient.html +10 -1
  2. templates/provider.html +83 -50
templates/patient.html CHANGED
@@ -226,9 +226,18 @@
226
  <div class="card">
227
  <h2>Your consultations</h2>
228
  <p class="helper-text">Tap any message to reopen it.</p>
 
 
 
 
 
229
  <input type="text" class="search-input" id="history-search" placeholder="Search your messages" aria-label="Search your consultations">
230
  <div id="history-full-list" style="margin-top: var(--space-4);"></div>
231
- <p class="helper-text" id="history-empty-text" style="display: none;"></p>
 
 
 
 
232
  </div>
233
  <button type="button" class="btn btn-secondary" id="history-back-btn">Back</button>
234
  </section>
 
226
  <div class="card">
227
  <h2>Your consultations</h2>
228
  <p class="helper-text">Tap any message to reopen it.</p>
229
+ <div class="filter-chip-row" id="history-filter-chips" role="group" aria-label="Filter by status">
230
+ <button type="button" class="filter-chip active" data-filter="all">All</button>
231
+ <button type="button" class="filter-chip" data-filter="waiting">Waiting for reply</button>
232
+ <button type="button" class="filter-chip" data-filter="answered">Answered</button>
233
+ </div>
234
  <input type="text" class="search-input" id="history-search" placeholder="Search your messages" aria-label="Search your consultations">
235
  <div id="history-full-list" style="margin-top: var(--space-4);"></div>
236
+ <div class="empty-state" id="history-empty-state" style="display: none;">
237
+ <svg class="empty-state-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"/></svg>
238
+ <p class="empty-state-title" id="history-empty-title"></p>
239
+ <p class="empty-state-body" id="history-empty-body"></p>
240
+ </div>
241
  </div>
242
  <button type="button" class="btn btn-secondary" id="history-back-btn">Back</button>
243
  </section>
templates/provider.html CHANGED
@@ -60,8 +60,31 @@
60
 
61
  <div class="card">
62
  <input type="text" class="search-input" id="queue-search" placeholder="Search by language or message" aria-label="Search consultations" style="margin-bottom: var(--space-4);">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  <div id="pending-list"></div>
64
- <p class="helper-text" id="empty-pending" style="display: none;"></p>
 
 
 
 
65
  </div>
66
  </section>
67
 
@@ -89,6 +112,11 @@
89
  <span class="chat-label" id="respond-language-label">Patient</span>
90
  <span id="respond-translated-text"></span>
91
  </div>
 
 
 
 
 
92
  </div>
93
 
94
  <details class="original-transcript">
@@ -99,65 +127,70 @@
99
  <div class="nlu-summary" id="respond-nlu-summary"></div>
100
  </div>
101
 
102
- <!-- Only shown when this patient has other consultations on record.
103
- Read-only context for understanding this message, not clickable -
104
- switching the whole workspace to a different consultation from
105
- here would risk a provider replying to the wrong one. -->
106
  <div class="card" id="patient-history-card" style="display: none;">
107
  <h3>This patient's other consultations</h3>
108
  <div id="patient-history-list"></div>
109
  </div>
110
 
111
- <div class="card">
112
- <label for="response-text-input">Your reply (in English)</label>
113
- <div class="chip-row" id="quick-reply-chips">
114
- <button type="button" class="chip" data-text="Please come in for a check-up so we can look at this properly.">Come in for a check-up</button>
115
- <button type="button" class="chip" data-text="Please rest and stay hydrated, drink plenty of water.">Rest and stay hydrated</button>
116
- <button type="button" class="chip" data-text="This doesn't sound urgent. Please monitor it and reach out again if it gets worse.">Monitor and follow up</button>
117
- <button type="button" class="chip" data-text="I need a bit more detail, please describe your symptoms further.">Need more detail</button>
118
- </div>
119
- <textarea id="response-text-input" rows="4" placeholder="Type your reply here"></textarea>
120
-
121
- <button type="button" class="btn btn-secondary" id="preview-response-btn" style="margin-top: var(--space-3); width: 100%;">
122
- <span class="btn-spinner spinner" style="display: none;"></span>
123
- <span class="btn-label">Preview what the patient will get</span>
124
- </button>
125
-
126
- <!-- Real translation + real speech synthesis, same pipeline as an
127
- actual send, just not saved. Each click costs the same as
128
- sending, since it's a genuine API call, not a mock. -->
129
- <div class="preview-block" id="preview-block" style="display: none;">
130
- <p class="preview-label">Preview — exactly what the patient will receive</p>
131
- <div class="chat-bubble from-provider" id="preview-text-bubble"></div>
132
- <div class="audio-player">
133
- <audio id="preview-audio" preload="metadata"></audio>
134
- <div class="audio-player-controls">
135
- <button type="button" class="audio-btn" id="preview-audio-play-btn" aria-label="Play">
136
- <svg class="icon-play" viewBox="0 0 24 24" fill="currentColor"><polygon points="6 3 20 12 6 21 6 3"/></svg>
137
- <svg class="icon-pause" viewBox="0 0 24 24" fill="currentColor" style="display: none;"><rect x="5" y="3" width="5" height="18" rx="1"/><rect x="14" y="3" width="5" height="18" rx="1"/></svg>
138
- </button>
139
- <button type="button" class="audio-btn audio-btn-sm" id="preview-audio-replay-btn" aria-label="Replay from start">
140
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="1 4 1 10 7 10"/><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"/></svg>
141
- </button>
142
- <span class="audio-time" id="preview-audio-current-time">0:00</span>
143
- <input type="range" class="audio-seek" id="preview-audio-seek" min="0" max="0" value="0" step="0.1" aria-label="Seek audio position">
144
- <span class="audio-time" id="preview-audio-duration">0:00</span>
145
  </div>
146
  </div>
147
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  </div>
149
 
150
- <div class="btn-row">
151
- <button type="button" class="btn btn-secondary" id="back-to-list">Back</button>
152
- <button type="button" class="btn btn-provider" id="submit-response">
153
- <span class="btn-icon">
154
- <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
155
- <polyline points="20 6 9 17 4 12"/>
156
- </svg>
157
- </span>
158
- <span class="btn-spinner spinner" style="display: none;"></span>
159
- <span class="btn-label">Send reply</span>
160
- </button>
161
  </div>
162
  </div>
163
  </section>
 
60
 
61
  <div class="card">
62
  <input type="text" class="search-input" id="queue-search" placeholder="Search by language or message" aria-label="Search consultations" style="margin-bottom: var(--space-4);">
63
+ <!-- Filter chips and sort toggle only appear on the Completed tab,
64
+ where a provider might want to narrow by language or reverse order.
65
+ Hidden on Waiting/Active tabs via JS since filtering a short live
66
+ queue adds friction more than value. -->
67
+ <div id="completed-controls" style="display: none; margin-bottom: var(--space-4);">
68
+ <div class="filter-chip-row" id="language-filter-chips" role="group" aria-label="Filter by language">
69
+ <button type="button" class="filter-chip active" data-filter="all">All languages</button>
70
+ <button type="button" class="filter-chip" data-filter="english">English</button>
71
+ <button type="button" class="filter-chip" data-filter="yoruba">Yoruba</button>
72
+ <button type="button" class="filter-chip" data-filter="hausa">Hausa</button>
73
+ <button type="button" class="filter-chip" data-filter="igbo">Igbo</button>
74
+ <button type="button" class="filter-chip" data-filter="pidgin">Pidgin</button>
75
+ </div>
76
+ <button type="button" class="sort-toggle-btn" id="sort-toggle-btn" aria-label="Toggle sort order">
77
+ <svg id="sort-icon-asc" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:none"><line x1="12" y1="5" x2="12" y2="19"/><polyline points="19 12 12 19 5 12"/></svg>
78
+ <svg id="sort-icon-desc" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="19" x2="12" y2="5"/><polyline points="5 12 12 5 19 12"/></svg>
79
+ <span id="sort-label">Newest first</span>
80
+ </button>
81
+ </div>
82
  <div id="pending-list"></div>
83
+ <div class="empty-state" id="empty-pending" style="display: none;">
84
+ <svg class="empty-state-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>
85
+ <p class="empty-state-title" id="empty-pending-title"></p>
86
+ <p class="empty-state-body" id="empty-pending-body"></p>
87
+ </div>
88
  </div>
89
  </section>
90
 
 
112
  <span class="chat-label" id="respond-language-label">Patient</span>
113
  <span id="respond-translated-text"></span>
114
  </div>
115
+ <!-- Provider's reply, only visible in read-only (completed) mode -->
116
+ <div class="chat-bubble from-provider" id="respond-provider-bubble" style="display:none;">
117
+ <span class="chat-label">Your reply (translated)</span>
118
+ <span id="respond-provider-reply-text"></span>
119
+ </div>
120
  </div>
121
 
122
  <details class="original-transcript">
 
127
  <div class="nlu-summary" id="respond-nlu-summary"></div>
128
  </div>
129
 
 
 
 
 
130
  <div class="card" id="patient-history-card" style="display: none;">
131
  <h3>This patient's other consultations</h3>
132
  <div id="patient-history-list"></div>
133
  </div>
134
 
135
+ <!-- Compose area: shown only for unanswered (waiting) consultations -->
136
+ <div id="compose-area">
137
+ <div class="card">
138
+ <label for="response-text-input">Your reply (in English)</label>
139
+ <div class="chip-row" id="quick-reply-chips">
140
+ <button type="button" class="chip" data-text="Please come in for a check-up so we can look at this properly.">Come in for a check-up</button>
141
+ <button type="button" class="chip" data-text="Please rest and stay hydrated, drink plenty of water.">Rest and stay hydrated</button>
142
+ <button type="button" class="chip" data-text="This doesn't sound urgent. Please monitor it and reach out again if it gets worse.">Monitor and follow up</button>
143
+ <button type="button" class="chip" data-text="I need a bit more detail, please describe your symptoms further.">Need more detail</button>
144
+ </div>
145
+ <textarea id="response-text-input" rows="4" placeholder="Type your reply here"></textarea>
146
+
147
+ <button type="button" class="btn btn-secondary" id="preview-response-btn" style="margin-top: var(--space-3); width: 100%;">
148
+ <span class="btn-spinner spinner" style="display: none;"></span>
149
+ <span class="btn-label">Preview what the patient will get</span>
150
+ </button>
151
+
152
+ <div class="preview-block" id="preview-block" style="display: none;">
153
+ <p class="preview-label">Preview exactly what the patient will receive</p>
154
+ <div class="chat-bubble from-provider" id="preview-text-bubble"></div>
155
+ <div class="audio-player">
156
+ <audio id="preview-audio" preload="metadata"></audio>
157
+ <div class="audio-player-controls">
158
+ <button type="button" class="audio-btn" id="preview-audio-play-btn" aria-label="Play">
159
+ <svg class="icon-play" viewBox="0 0 24 24" fill="currentColor"><polygon points="6 3 20 12 6 21 6 3"/></svg>
160
+ <svg class="icon-pause" viewBox="0 0 24 24" fill="currentColor" style="display: none;"><rect x="5" y="3" width="5" height="18" rx="1"/><rect x="14" y="3" width="5" height="18" rx="1"/></svg>
161
+ </button>
162
+ <button type="button" class="audio-btn audio-btn-sm" id="preview-audio-replay-btn" aria-label="Replay from start">
163
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="1 4 1 10 7 10"/><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"/></svg>
164
+ </button>
165
+ <span class="audio-time" id="preview-audio-current-time">0:00</span>
166
+ <input type="range" class="audio-seek" id="preview-audio-seek" min="0" max="0" value="0" step="0.1" aria-label="Seek audio position">
167
+ <span class="audio-time" id="preview-audio-duration">0:00</span>
168
+ </div>
169
  </div>
170
  </div>
171
  </div>
172
+
173
+ <div class="btn-row">
174
+ <button type="button" class="btn btn-secondary" id="back-to-list">Back</button>
175
+ <button type="button" class="btn btn-provider" id="submit-response">
176
+ <span class="btn-icon">
177
+ <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
178
+ <polyline points="20 6 9 17 4 12"/>
179
+ </svg>
180
+ </span>
181
+ <span class="btn-spinner spinner" style="display: none;"></span>
182
+ <span class="btn-label">Send reply</span>
183
+ </button>
184
+ </div>
185
  </div>
186
 
187
+ <!-- Read-only view: shown when a completed consultation is opened.
188
+ No textarea, no Send button — a completed consultation is a
189
+ record, not a work item. -->
190
+ <div id="readonly-area" style="display: none;">
191
+ <div class="btn-row">
192
+ <button type="button" class="btn btn-secondary" id="back-to-list-readonly">Back</button>
193
+ </div>
 
 
 
 
194
  </div>
195
  </div>
196
  </section>