fix: hide Notes from task list when notes are empty (#12668)

Co-authored-by: mkdev11 <MkDev11@users.noreply.github.com>
This commit is contained in:
MkDev11
2026-01-29 04:13:23 -05:00
committed by GitHub
parent df47b7b79d
commit 9e1ae86191
3 changed files with 19 additions and 6 deletions

View File

@@ -97,6 +97,15 @@ describe("TaskTrackingObservationContent", () => {
).toBeInTheDocument();
});
it("does not display Notes when notes are empty", () => {
render(<TaskTrackingObservationContent event={mockEvent} />);
// task-2 has no notes, so "Notes:" should not appear for it
// We have 2 tasks with notes, so there should be exactly 2 "Notes:" elements
const notesElements = screen.getAllByText(/^Notes:/);
expect(notesElements).toHaveLength(2);
});
it("does not render task list when command is not 'plan'", () => {
const eventWithoutPlan = {
...mockEvent,

View File

@@ -52,9 +52,11 @@ export function TaskItem({ task }: TaskItemProps) {
<Typography.Text className="text-[10px] text-[#A3A3A3] font-normal">
{t(I18nKey.TASK_TRACKING_OBSERVATION$TASK_ID)}: {task.id}
</Typography.Text>
<Typography.Text className="text-[10px] text-[#A3A3A3]">
{t(I18nKey.TASK_TRACKING_OBSERVATION$TASK_NOTES)}: {task.notes}
</Typography.Text>
{task.notes && (
<Typography.Text className="text-[10px] text-[#A3A3A3]">
{t(I18nKey.TASK_TRACKING_OBSERVATION$TASK_NOTES)}: {task.notes}
</Typography.Text>
)}
</div>
</div>
);

View File

@@ -45,9 +45,11 @@ export function TaskItem({ task }: TaskItemProps) {
>
{task.title}
</Typography.Text>
<Typography.Text className="text-[10px] text-[#A3A3A3]">
{t(I18nKey.TASK_TRACKING_OBSERVATION$TASK_NOTES)}: {task.notes}
</Typography.Text>
{task.notes && (
<Typography.Text className="text-[10px] text-[#A3A3A3]">
{t(I18nKey.TASK_TRACKING_OBSERVATION$TASK_NOTES)}: {task.notes}
</Typography.Text>
)}
</div>
</div>
);