Files
claude-task-master/apps/cli/src/ui/components/watch-footer.component.ts
Eyal Toledano 38c2c08af1 feat(cli): add --watch flag to list command for real-time updates (#1526)
Co-authored-by: Ralph Khreish <35776126+Crunchyman-ralph@users.noreply.github.com>
Fixes #1526 PR review comments from CodeRabbit and changeset-bot
2025-12-18 20:11:40 +01:00

42 lines
1017 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @fileoverview Watch mode footer component for real-time task updates
*/
import chalk from 'chalk';
import { formatTime } from '@tm/core';
/**
* Get display label for storage source
*/
function getSourceLabel(storageType: 'api' | 'file'): string {
return storageType === 'api' ? 'Hamster Studio' : 'tasks.json';
}
/**
* Display watch status footer
*/
export function displayWatchFooter(
storageType: 'api' | 'file',
lastSync: Date
): void {
const syncTime = formatTime(lastSync);
const source = getSourceLabel(storageType);
console.log(chalk.dim(`\nWatching ${source} for changes...`));
console.log(chalk.gray(`Last synced: ${syncTime}`));
console.log(chalk.dim('Press Ctrl+C to exit'));
}
/**
* Display sync notification message
*/
export function displaySyncMessage(
storageType: 'api' | 'file',
syncTime: Date
): void {
const formattedTime = formatTime(syncTime);
const source = getSourceLabel(storageType);
console.log(chalk.blue(`\n ${source} updated at ${formattedTime}`));
}