fix: duplicate banner
This commit is contained in:
@@ -262,13 +262,10 @@ export class ListTasksCommand extends Command {
|
|||||||
// Get file path for display
|
// Get file path for display
|
||||||
const filePath = this.tmCore ? `.taskmaster/tasks/tasks.json` : undefined;
|
const filePath = this.tmCore ? `.taskmaster/tasks/tasks.json` : undefined;
|
||||||
|
|
||||||
// Display header with Task Master banner
|
// Display header without banner (banner already shown by main CLI)
|
||||||
displayHeader({
|
displayHeader({
|
||||||
version: '0.26.0', // You may want to get this dynamically
|
|
||||||
projectName: 'Taskmaster',
|
|
||||||
tag: tag || 'master',
|
tag: tag || 'master',
|
||||||
filePath: filePath,
|
filePath: filePath
|
||||||
showBanner: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// No tasks message
|
// No tasks message
|
||||||
@@ -303,13 +300,13 @@ export class ListTasksCommand extends Command {
|
|||||||
showComplexity: true // Enable complexity column
|
showComplexity: true // Enable complexity column
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
// Display recommended next task section immediately after table
|
// Display recommended next task section immediately after table
|
||||||
if (nextTask) {
|
if (nextTask) {
|
||||||
// Find the full task object to get description
|
// Find the full task object to get description
|
||||||
const fullTask = tasks.find(t => String(t.id) === String(nextTask.id));
|
const fullTask = tasks.find((t) => String(t.id) === String(nextTask.id));
|
||||||
const description = fullTask ? getTaskDescription(fullTask) : undefined;
|
const description = fullTask ? getTaskDescription(fullTask) : undefined;
|
||||||
|
|
||||||
displayRecommendedNextTask({
|
displayRecommendedNextTask({
|
||||||
...nextTask,
|
...nextTask,
|
||||||
status: 'pending', // Next task is typically pending
|
status: 'pending', // Next task is typically pending
|
||||||
@@ -318,7 +315,7 @@ export class ListTasksCommand extends Command {
|
|||||||
} else {
|
} else {
|
||||||
displayRecommendedNextTask(undefined);
|
displayRecommendedNextTask(undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display suggested next steps at the end
|
// Display suggested next steps at the end
|
||||||
displaySuggestedNextSteps();
|
displaySuggestedNextSteps();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,76 +4,26 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import boxen from 'boxen';
|
|
||||||
import figlet from 'figlet';
|
import figlet from 'figlet';
|
||||||
import gradient from 'gradient-string';
|
import gradient from 'gradient-string';
|
||||||
import packageJson from '../../../package.json';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Header configuration options
|
* Header configuration options
|
||||||
*/
|
*/
|
||||||
export interface HeaderOptions {
|
export interface HeaderOptions {
|
||||||
title?: string;
|
title?: string;
|
||||||
version?: string;
|
|
||||||
projectName?: string;
|
|
||||||
tag?: string;
|
tag?: string;
|
||||||
filePath?: string;
|
filePath?: string;
|
||||||
showBanner?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create the Task Master ASCII art banner
|
|
||||||
*/
|
|
||||||
function createBanner(): string {
|
|
||||||
const bannerText = figlet.textSync('Task Master', {
|
|
||||||
font: 'Standard',
|
|
||||||
horizontalLayout: 'default',
|
|
||||||
verticalLayout: 'default'
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a cool gradient effect
|
|
||||||
const coolGradient = gradient(['#0099ff', '#00ffcc']);
|
|
||||||
return coolGradient(bannerText);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the Task Master header with project info
|
* Display the Task Master header with project info
|
||||||
*/
|
*/
|
||||||
export function displayHeader(options: HeaderOptions = {}): void {
|
export function displayHeader(options: HeaderOptions = {}): void {
|
||||||
const {
|
const { filePath, tag } = options;
|
||||||
version = packageJson.version,
|
|
||||||
projectName = 'Taskmaster',
|
|
||||||
tag,
|
|
||||||
filePath,
|
|
||||||
showBanner = true
|
|
||||||
} = options;
|
|
||||||
|
|
||||||
// Display the ASCII banner if requested
|
|
||||||
if (showBanner) {
|
|
||||||
console.log(createBanner());
|
|
||||||
|
|
||||||
// Add creator credit line below the banner
|
|
||||||
console.log(
|
|
||||||
chalk.dim('by ') + chalk.cyan.underline('https://x.com/eyaltoledano')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create the version and project info box
|
|
||||||
const infoBoxContent = chalk.white(
|
|
||||||
`${chalk.bold('Version:')} ${version} ${chalk.bold('Project:')} ${projectName}`
|
|
||||||
);
|
|
||||||
|
|
||||||
console.log(
|
|
||||||
boxen(infoBoxContent, {
|
|
||||||
padding: { left: 1, right: 1, top: 0, bottom: 0 },
|
|
||||||
margin: { top: 1, bottom: 1 },
|
|
||||||
borderStyle: 'round',
|
|
||||||
borderColor: 'cyan'
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
// Display tag and file path info
|
// Display tag and file path info
|
||||||
if (tag || filePath) {
|
if (tag) {
|
||||||
let tagInfo = '';
|
let tagInfo = '';
|
||||||
|
|
||||||
if (tag && tag !== 'master') {
|
if (tag && tag !== 'master') {
|
||||||
@@ -95,10 +45,3 @@ export function displayHeader(options: HeaderOptions = {}): void {
|
|||||||
console.log(); // Empty line for spacing
|
console.log(); // Empty line for spacing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Display a simple header without the ASCII art
|
|
||||||
*/
|
|
||||||
export function displaySimpleHeader(options: HeaderOptions = {}): void {
|
|
||||||
displayHeader({ ...options, showBanner: false });
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -20,11 +20,7 @@
|
|||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true,
|
||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"types": ["node"],
|
"types": ["node"]
|
||||||
"paths": {
|
|
||||||
"@tm/core": ["../../packages/tm-core/src/index.ts"],
|
|
||||||
"@tm/core/*": ["../../packages/tm-core/src/*"]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"include": ["src/**/*"],
|
"include": ["src/**/*"],
|
||||||
"exclude": ["node_modules", "dist", "tests"]
|
"exclude": ["node_modules", "dist", "tests"]
|
||||||
|
|||||||
Reference in New Issue
Block a user