ciyidogan commited on
Commit
0ceb246
·
verified ·
1 Parent(s): c166c74

Update flare-ui/src/app/components/chat/chat.component.html

Browse files
flare-ui/src/app/components/chat/chat.component.html CHANGED
@@ -16,6 +16,16 @@
16
  </mat-select>
17
  <mat-hint>Choose an enabled project with published version</mat-hint>
18
  </mat-form-field>
 
 
 
 
 
 
 
 
 
 
19
  </mat-card-content>
20
 
21
  <mat-card-actions align="end">
@@ -39,6 +49,7 @@
39
  <mat-card-title>{{ selectedProject }}</mat-card-title>
40
  <mat-card-subtitle>Session: {{ sessionId.substring(0, 8) }}...</mat-card-subtitle>
41
  <div class="spacer"></div>
 
42
  <button mat-icon-button (click)="endSession()" matTooltip="End Session">
43
  <mat-icon>close</mat-icon>
44
  </button>
@@ -46,9 +57,14 @@
46
 
47
  <mat-divider></mat-divider>
48
 
 
 
 
 
 
49
  <div class="chat-history" #scrollMe>
50
  <div
51
- *ngFor="let msg of messages"
52
  [ngClass]="{
53
  'msg-row': true,
54
  'me': msg.author === 'user',
@@ -58,7 +74,17 @@
58
  <mat-icon class="msg-icon">
59
  {{ msg.author === 'user' ? 'person' : 'smart_toy' }}
60
  </mat-icon>
61
- <span class="bubble">{{ msg.text }}</span>
 
 
 
 
 
 
 
 
 
 
62
  </div>
63
  </div>
64
 
@@ -82,10 +108,13 @@
82
  mat-fab
83
  color="primary"
84
  type="submit"
85
- [disabled]="input.invalid || !input.value?.trim()"
86
  class="send-button">
87
  <mat-icon>send</mat-icon>
88
  </button>
89
  </form>
90
  </mat-card>
 
 
 
91
  </div>
 
16
  </mat-select>
17
  <mat-hint>Choose an enabled project with published version</mat-hint>
18
  </mat-form-field>
19
+
20
+ <mat-checkbox
21
+ [(ngModel)]="useTTS"
22
+ [disabled]="!ttsAvailable"
23
+ class="tts-checkbox">
24
+ Use TTS
25
+ </mat-checkbox>
26
+ <div *ngIf="!ttsAvailable" class="tts-hint">
27
+ TTS is not configured. Please configure a TTS engine in Environment settings.
28
+ </div>
29
  </mat-card-content>
30
 
31
  <mat-card-actions align="end">
 
49
  <mat-card-title>{{ selectedProject }}</mat-card-title>
50
  <mat-card-subtitle>Session: {{ sessionId.substring(0, 8) }}...</mat-card-subtitle>
51
  <div class="spacer"></div>
52
+ <mat-icon *ngIf="useTTS" matTooltip="TTS Enabled" class="tts-indicator">record_voice_over</mat-icon>
53
  <button mat-icon-button (click)="endSession()" matTooltip="End Session">
54
  <mat-icon>close</mat-icon>
55
  </button>
 
57
 
58
  <mat-divider></mat-divider>
59
 
60
+ <!-- Audio Waveform Visualization -->
61
+ <div *ngIf="playingAudio" class="waveform-container">
62
+ <canvas #waveformCanvas width="800" height="100"></canvas>
63
+ </div>
64
+
65
  <div class="chat-history" #scrollMe>
66
  <div
67
+ *ngFor="let msg of messages; let i = index"
68
  [ngClass]="{
69
  'msg-row': true,
70
  'me': msg.author === 'user',
 
74
  <mat-icon class="msg-icon">
75
  {{ msg.author === 'user' ? 'person' : 'smart_toy' }}
76
  </mat-icon>
77
+ <div class="msg-content">
78
+ <span class="bubble">{{ msg.text }}</span>
79
+ <button
80
+ *ngIf="msg.audioUrl && msg.author === 'assistant'"
81
+ mat-icon-button
82
+ (click)="playAudio(msg.audioUrl)"
83
+ class="play-button"
84
+ matTooltip="Play audio">
85
+ <mat-icon>play_arrow</mat-icon>
86
+ </button>
87
+ </div>
88
  </div>
89
  </div>
90
 
 
108
  mat-fab
109
  color="primary"
110
  type="submit"
111
+ [disabled]="input.invalid || !input.value?.trim() || loading"
112
  class="send-button">
113
  <mat-icon>send</mat-icon>
114
  </button>
115
  </form>
116
  </mat-card>
117
+
118
+ <!-- Hidden audio player -->
119
+ <audio #audioPlayer style="display: none;"></audio>
120
  </div>