Skip to content

Commit 6f7e81b

Browse files
p2/p3 Bug fixes
1 parent 798dded commit 6f7e81b

File tree

8 files changed

+30
-9
lines changed

8 files changed

+30
-9
lines changed

src/frontend/src/api/apiService.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

src/frontend/src/components/content/TaskDetails.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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

src/frontend/src/components/content/TaskList.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff 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>

src/frontend/src/models/taskList.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

810
export interface TaskListProps {

src/frontend/src/pages/PlanPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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 = () => {

src/frontend/src/services/PlanDataService.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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);

src/frontend/src/services/TaskService.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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',

src/frontend/src/styles/TaskDetails.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,14 @@
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
}

0 commit comments

Comments
 (0)