chore: commit unrelated local changes
This commit is contained in:
@@ -13,18 +13,15 @@ export interface MessageListProps {
|
||||
|
||||
// Helper to format timestamp in human-readable way
|
||||
function formatTimestamp(timestamp: number): string {
|
||||
const now = Date.now();
|
||||
const diff = now - timestamp;
|
||||
const seconds = Math.floor(diff / 1000);
|
||||
const minutes = Math.floor(seconds / 60);
|
||||
const hours = Math.floor(minutes / 60);
|
||||
const days = Math.floor(hours / 24);
|
||||
const date = new Date(timestamp);
|
||||
const now = new Date();
|
||||
const isSameDay = date.toDateString() === now.toDateString();
|
||||
|
||||
if (seconds < 60) {return 'just now';}
|
||||
if (minutes < 60) {return `${minutes}m ago`;}
|
||||
if (hours < 24) {return `${hours}h ago`;}
|
||||
if (days < 7) {return `${days}d ago`;}
|
||||
return new Date(timestamp).toLocaleDateString([], { month: 'short', day: 'numeric' });
|
||||
if (isSameDay) {
|
||||
return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
|
||||
}
|
||||
|
||||
return date.toLocaleString([], { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' });
|
||||
}
|
||||
|
||||
// Individual message component
|
||||
@@ -37,7 +34,7 @@ const MessageItem = memo(function MessageItem({
|
||||
}): React.ReactElement {
|
||||
const isUser = message.role === 'user';
|
||||
const accentColor = isUser ? 'blue' : '#ff8c00';
|
||||
const timestampText = message.timestamp ? formatTimestamp(message.timestamp) : '';
|
||||
const timestampText = message.timestamp ? formatTimestamp(message.timestamp) : 'unknown time';
|
||||
|
||||
return (
|
||||
<Box
|
||||
|
||||
@@ -46,6 +46,14 @@ export function formatPrompt(state: 'default' | 'thinking'): string {
|
||||
return `${colors.orange}${colors.bold}flynn>${colors.reset} `;
|
||||
}
|
||||
|
||||
function formatMessageTime(timestamp: number): string {
|
||||
return new Date(timestamp).toLocaleTimeString([], {
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
second: '2-digit',
|
||||
});
|
||||
}
|
||||
|
||||
export interface MinimalTuiConfig {
|
||||
session: ManagedSession;
|
||||
modelClient: ModelClient;
|
||||
@@ -771,7 +779,9 @@ export class MinimalTui {
|
||||
|
||||
private async handleMessage(content: string): Promise<void> {
|
||||
// Print Flynn label before response
|
||||
process.stdout.write(`\n${colors.orange}${colors.bold}Flynn:${colors.reset}\n`);
|
||||
process.stdout.write(
|
||||
`\n${colors.orange}${colors.bold}Flynn${colors.reset} ${colors.gray}[${formatMessageTime(Date.now())}]${colors.reset}\n`,
|
||||
);
|
||||
|
||||
try {
|
||||
// Use agent if available (supports tool loop)
|
||||
|
||||
Reference in New Issue
Block a user