File tree Expand file tree Collapse file tree 8 files changed +30
-9
lines changed
Expand file tree Collapse file tree 8 files changed +30
-9
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ export class APIService {
160160
161161 if ( useCache ) {
162162 const cachedPlan = this . _cache . get < { plan_with_steps : PlanWithSteps ; messages : PlanMessage [ ] } > ( cacheKey ) ;
163- // if (cachedPlan) return cachedPlan;
163+ if ( cachedPlan ) return cachedPlan ;
164164
165165 return this . _requestTracker . trackRequest ( cacheKey , fetcher ) ;
166166 }
Original file line number Diff line number Diff line change @@ -118,7 +118,13 @@ const TaskDetails: React.FC<TaskDetailsProps> = ({
118118 </ div >
119119 </ div >
120120 < div >
121- < Body1Strong > { planData . plan . initial_goal } </ Body1Strong >
121+ < Tooltip content = { planData . plan . initial_goal } relationship = { "label" } >
122+ < Body1Strong
123+ className = "goal-text"
124+ >
125+ { planData . plan . initial_goal }
126+ </ Body1Strong >
127+ </ Tooltip >
122128 < br />
123129 < Text size = { 200 } >
124130 { completedCount } of { total } completed
Original file line number Diff line number Diff line change @@ -45,11 +45,12 @@ const TaskList: React.FC<TaskListProps> = ({
4545 < div className = "task-name-truncated" title = { task . name } >
4646 { task . name }
4747 </ div >
48-
49-
50- { task . date && (
48+ { task . date && task . status == "completed" && (
5149 < Caption1 className = "task-list-task-date" > { task . date } </ Caption1 >
5250 ) }
51+ { task . status == "inprogress" && (
52+ < Caption1 className = "task-list-task-date" > { `${ task ?. completed_steps } of ${ task ?. total_steps } completed` } </ Caption1 >
53+ ) }
5354 </ div >
5455 < Menu >
5556 < MenuTrigger >
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ export interface Task {
33 name : string ;
44 status : 'inprogress' | 'completed' ;
55 date ?: string ;
6+ completed_steps ?: number ;
7+ total_steps ?: number ;
68}
79
810export interface TaskListProps {
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ const PlanPage: React.FC = () => {
6969 }
7070
7171 setError ( null ) ;
72- const data = await PlanDataService . fetchPlanData ( planId ) ;
72+ const data = await PlanDataService . fetchPlanData ( planId , navigate ) ;
7373 console . log ( "Fetched plan data:" , data ) ;
7474 setPlanData ( data ) ;
7575 } catch ( err ) {
@@ -146,7 +146,7 @@ const PlanPage: React.FC = () => {
146146
147147
148148 useEffect ( ( ) => {
149- loadPlanData ( ) ;
149+ loadPlanData ( true ) ;
150150 } , [ loadPlanData ] ) ;
151151
152152 const handleNewTaskButton = ( ) => {
Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ export class PlanDataService { /**
1010 * @param planId Plan ID to fetch
1111 * @returns Promise with processed plan data
1212 */
13- static async fetchPlanData ( planId : string ) : Promise < ProcessedPlanData > {
13+ static async fetchPlanData ( planId : string , useCache : boolean ) : Promise < ProcessedPlanData > {
1414 try {
1515 // Use optimized getPlanById method for better performance
16- const planBody = await apiService . getPlanById ( planId ) ;
16+ const planBody = await apiService . getPlanById ( planId , useCache ) ;
1717 return this . processPlanData ( planBody . plan_with_steps , planBody . messages || [ ] ) ;
1818 } catch ( error ) {
1919 console . log ( 'Failed to fetch plan data:' , error ) ;
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ export class TaskService {
2424 const task : Task = {
2525 id : plan . session_id ,
2626 name : plan . initial_goal ,
27+ completed_steps : plan . completed ,
28+ total_steps : plan . total_steps ,
2729 status : apiService . isPlanComplete ( plan ) ? 'completed' : 'inprogress' ,
2830 date : new Date ( plan . timestamp ) . toLocaleDateString ( 'en-US' , {
2931 month : 'short' ,
Original file line number Diff line number Diff line change 146146}
147147.strikethrough {
148148 text-decoration : line-through;
149+ }
150+
151+ .goal-text {
152+ display : -webkit-box !important ;
153+ -webkit-line-clamp : 2 !important ;
154+ -webkit-box-orient : vertical !important ;
155+ overflow : hidden !important ;
156+ text-overflow : ellipsis !important ;
157+ white-space : normal !important ;
158+ max-width : 300px ;
149159}
You can’t perform that action at this time.
0 commit comments