An AI-powered task-management system you can drop into Cursor, Lovable, Windsurf, Roo, and others.
JavaScript aicursorcursor-aicursorailovablelovable-devroocodetask-managertaskstasks-listwindsurfwindsurf-ai
fix: improve display of subtasks based on storageType (#1400)
Ralph Khreishc62cf845dad1
diff --git a/.changeset/five-areas-heal.md b/.changeset/five-areas-heal.mdnew file mode 100644index 00000000..09397e6c--- /dev/null+++ b/.changeset/five-areas-heal.md@@ -0,0 +1,5 @@+---+"task-master-ai": patch+---++Fix subtasks not showing parent task when displaying in cli (eg. tm show 10)diff --git a/apps/cli/src/commands/next.command.ts b/apps/cli/src/commands/next.command.tsindex b055d583..f0b5f280 100644--- a/apps/cli/src/commands/next.command.ts+++ b/apps/cli/src/commands/next.command.ts@@ -211,7 +211,8 @@ export class NextCommand extends Command {displayTaskDetails(task, {customHeader,headerColor: 'green',- showSuggestedActions: true+ showSuggestedActions: true,+ storageType: result.storageType});}diff --git a/apps/cli/src/commands/show.command.ts b/apps/cli/src/commands/show.command.tsindex bd3332c1..65ca9dc4 100644--- a/apps/cli/src/commands/show.command.ts+++ b/apps/cli/src/commands/show.command.ts@@ -272,7 +272,8 @@ export class ShowCommand extends Command {displayTaskDetails(result.task, {statusFilter: options.status,showSuggestedActions: true,- originalTaskId: result.originalTaskId+ originalTaskId: result.originalTaskId,+ storageType: result.storageType});}diff --git a/apps/cli/src/commands/start.command.ts b/apps/cli/src/commands/start.command.tsindex e85065d4..50b1162a 100644--- a/apps/cli/src/commands/start.command.ts+++ b/apps/cli/src/commands/start.command.ts@@ -7,6 +7,7 @@import { spawn } from 'child_process';import {type StartTaskResult as CoreStartTaskResult,+ type StorageType,type TmCore,createTmCore} from '@tm/core';@@ -16,8 +17,8 @@ import { Command } from 'commander';import ora, { type Ora } from 'ora';import { displayTaskDetails } from '../ui/components/task-detail.component.js';import { displayError } from '../utils/error-handler.js';-import * as ui from '../utils/ui.js';import { getProjectRoot } from '../utils/project-root.js';+import * as ui from '../utils/ui.js';/*** CLI-specific options interface for the start command@@ -36,7 +37,7 @@ export interface StartCommandOptions {* Extends the core result with CLI-specific display information*/export interface StartCommandResult extends CoreStartTaskResult {- storageType?: string;+ storageType?: Exclude<StorageType, 'auto'>;}/**@@ -366,7 +367,8 @@ export class StartCommand extends Command {displayTaskDetails(task, {customHeader: headerText,- headerColor: 'yellow'+ headerColor: 'yellow',+ storageType: result.storageType});// Show claude-code promptdiff --git a/apps/cli/src/ui/components/task-detail.component.ts b/apps/cli/src/ui/components/task-detail.component.tsindex 4582fad2..054a8f6d 100644--- a/apps/cli/src/ui/components/task-detail.component.ts+++ b/apps/cli/src/ui/components/task-detail.component.ts@@ -3,7 +3,7 @@* Displays detailed task information in a structured format*/-import type { Subtask, Task } from '@tm/core';+import type { StorageType, Subtask, Task } from '@tm/core';import boxen from 'boxen';import chalk from 'chalk';import Table from 'cli-table3';@@ -198,7 +198,9 @@ export function displaySubtasks(status: any;description?: string;dependencies?: string[];- }>+ }>,+ parentTaskId?: string | number,+ storageType?: Exclude<StorageType, 'auto'>): void {const terminalWidth = process.stdout.columns * 0.95 || 100;// Display subtasks header@@ -233,7 +235,13 @@ export function displaySubtasks(});subtasks.forEach((subtask) => {- const subtaskId = String(subtask.id);+ // Format subtask ID based on storage type:+ // - File storage: Show parent prefix (e.g., 10.1, 10.2)+ // - API storage: Show subtask ID only (e.g., 1, 2)+ const subtaskId =+ storageType === 'file' && parentTaskId+ ? `${parentTaskId}.${subtask.id}`+ : String(subtask.id);// Format dependenciesconst deps =@@ -285,6 +293,7 @@ export function displayTaskDetails(customHeader?: string;headerColor?: string;originalTaskId?: string;+ storageType?: Exclude<StorageType, 'auto'>;}): void {const {@@ -292,7 +301,8 @@ export function displayTaskDetails(showSuggestedActions = false,customHeader,headerColor = 'blue',- originalTaskId+ originalTaskId,+ storageType} = options || {};// Display header - either custom or default@@ -338,7 +348,7 @@ export function displayTaskDetails(console.log(chalk.gray(` No subtasks with status '${statusFilter}'`));} else if (filteredSubtasks.length > 0) {console.log(); // Empty line for spacing- displaySubtasks(filteredSubtasks);+ displaySubtasks(filteredSubtasks, task.id, storageType);}}