@@ -8,13 +8,8 @@ import { Separator } from "@/components/ui/separator";
8
8
import { Tabs , TabsContent , TabsList , TabsTrigger } from "@/components/ui/tabs" ;
9
9
import { Textarea } from "@/components/ui/textarea" ;
10
10
11
- import { MaxLengthSelector } from "@/components/ui/maxlength-selector" ;
12
- import { ModelSelector } from "@/components/ui/model-selector" ;
13
11
import { PresetActions } from "@/components/ui/preset-actions" ;
14
12
import { PresetSelector } from "@/components/ui/preset-selector" ;
15
- import { TemperatureSelector } from "@/components/ui/temperature-selector" ;
16
- import { TopPSelector } from "@/components/ui/top-p-selector" ;
17
- import { models , types } from "@/data/models" ;
18
13
import { current , future , past } from "@/data/presets" ;
19
14
import { useAppStateStore } from "@/lib/providers/app-state-store-provider" ;
20
15
import { useEffect , useState } from "react" ;
@@ -30,6 +25,14 @@ import { siteConfig } from "@/site.config";
30
25
import { CoachingSessionTitle } from "@/components/ui/coaching-sessions/coaching-session-title" ;
31
26
import { OverarchingGoalContainer } from "@/components/ui/coaching-sessions/overarching-goal-container" ;
32
27
import { Id } from "@/types/general" ;
28
+ import {
29
+ HoverCard ,
30
+ HoverCardContent ,
31
+ HoverCardTrigger ,
32
+ } from "@/components/ui/hover-card" ;
33
+ import { Label } from "@/components/ui/label" ;
34
+ import { Button } from "@/components/ui/button" ;
35
+ import { LockClosedIcon , SymbolIcon } from "@radix-ui/react-icons" ;
33
36
34
37
// export const metadata: Metadata = {
35
38
// title: "Coaching Session",
@@ -45,32 +48,34 @@ export default function CoachingSessionsPage() {
45
48
( state ) => state
46
49
) ;
47
50
48
- useEffect ( ( ) => {
49
- async function fetchNote ( ) {
50
- if ( ! coachingSession . id ) {
51
+ async function fetchNote ( ) {
52
+ if ( ! coachingSession . id ) {
53
+ console . error (
54
+ "Failed to fetch Note since coachingSession.id is not set."
55
+ ) ;
56
+ return ;
57
+ }
58
+
59
+ await fetchNotesByCoachingSessionId ( coachingSession . id )
60
+ . then ( ( notes ) => {
61
+ const note = notes [ 0 ] ;
62
+ if ( notes . length > 0 ) {
63
+ console . trace ( "note: " + noteToString ( note ) ) ;
64
+ setNoteId ( note . id ) ;
65
+ setNote ( note . body ) ;
66
+ setSyncStatus ( "Notes refreshed" ) ;
67
+ } else {
68
+ console . trace ( "No Notes associated with this coachingSession.id" ) ;
69
+ }
70
+ } )
71
+ . catch ( ( err ) => {
51
72
console . error (
52
- "Failed to fetch Note since coachingSession.id is not set."
73
+ "Failed to fetch Note for current coaching session: " + err
53
74
) ;
54
- return ;
55
- }
75
+ } ) ;
76
+ }
56
77
57
- await fetchNotesByCoachingSessionId ( coachingSession . id )
58
- . then ( ( notes ) => {
59
- const note = notes [ 0 ] ;
60
- if ( notes . length > 0 ) {
61
- console . trace ( "note: " + noteToString ( note ) ) ;
62
- setNoteId ( note . id ) ;
63
- setNote ( note . body ) ;
64
- } else {
65
- console . trace ( "No Notes associated with this coachingSession.id" ) ;
66
- }
67
- } )
68
- . catch ( ( err ) => {
69
- console . error (
70
- "Failed to fetch Note for current coaching session: " + err
71
- ) ;
72
- } ) ;
73
- }
78
+ useEffect ( ( ) => {
74
79
fetchNote ( ) ;
75
80
} , [ coachingSession . id , noteId ] ) ;
76
81
@@ -140,12 +145,12 @@ export default function CoachingSessionsPage() {
140
145
< TabsList className = "grid flex w-128 grid-cols-2 justify-start" >
141
146
< TabsTrigger value = "notes" > Notes</ TabsTrigger >
142
147
< TabsTrigger value = "console" > Console</ TabsTrigger >
143
- { /* <TabsTrigger value="coachs_notes">
144
- <div className="flex gap-2 items-start">
145
- <LockClosedIcon className="mt-1" />
146
- Coach's Notes
147
- </div>
148
- </TabsTrigger> */ }
148
+ < TabsTrigger value = "coachs_notes" className = "hidden ">
149
+ < div className = "flex gap-2 items-start" >
150
+ < LockClosedIcon className = "mt-1" />
151
+ Coach's Notes
152
+ </ div >
153
+ </ TabsTrigger >
149
154
</ TabsList >
150
155
< TabsContent value = "notes" >
151
156
< div className = "flex h-full flex-col space-y-4" >
@@ -158,8 +163,8 @@ export default function CoachingSessionsPage() {
158
163
</ div >
159
164
</ TabsContent >
160
165
< TabsContent value = "console" >
161
- < div className = "p-4 min-h-[400px] md:min-h-[630px] lg:min-h-[630px] bg-blue -500 text-white" >
162
- Console
166
+ < div className = "p-4 min-h-[400px] md:min-h-[630px] lg:min-h-[630px] bg-gray -500 text-white" >
167
+ Console placeholder
163
168
</ div >
164
169
</ TabsContent >
165
170
< TabsContent value = "coachs_notes" >
@@ -173,10 +178,29 @@ export default function CoachingSessionsPage() {
173
178
</ Tabs >
174
179
</ div >
175
180
< div className = "flex-col space-y-4 sm:flex md:order-2" >
176
- < ModelSelector types = { types } models = { models } />
177
- < TemperatureSelector defaultValue = { [ 0.56 ] } />
178
- < MaxLengthSelector defaultValue = { [ 256 ] } />
179
- < TopPSelector defaultValue = { [ 0.9 ] } />
181
+ < div className = "grid gap-2 pt-2" >
182
+ < HoverCard openDelay = { 200 } >
183
+ < HoverCardTrigger asChild >
184
+ < div className = "grid gap-4" >
185
+ < div className = "flex items-center justify-between" >
186
+ < Label htmlFor = "refresh" > Notes Actions</ Label >
187
+ </ div >
188
+ < Button id = "refresh" variant = "outline" onClick = { fetchNote } >
189
+ < SymbolIcon className = "mr-2 h-4 w-4" /> Refresh Notes
190
+ </ Button >
191
+ </ div >
192
+ </ HoverCardTrigger >
193
+ < HoverCardContent
194
+ align = "start"
195
+ className = "w-[260px] text-sm"
196
+ side = "left"
197
+ >
198
+ Notes refreshing is currently a manual process. To view
199
+ changes made by someone else in this session, before making
200
+ any new Notes changes yourself, click this button.
201
+ </ HoverCardContent >
202
+ </ HoverCard >
203
+ </ div >
180
204
</ div >
181
205
</ div >
182
206
</ div >
0 commit comments