mirror of
https://github.com/jlengrand/Maestro.git
synced 2026-03-10 08:31:19 +00:00
MAESTRO: audit viewer and display components - remove dead code
- ImageDiffViewer.tsx: Remove unused React import - MermaidRenderer.tsx: Remove unused React import - ThinkingStatusPill.tsx: Remove unused React import and debug console.log - ThinkingStatusPill.test.tsx: Remove debug logging tests (no longer applicable)
This commit is contained in:
@@ -90,17 +90,12 @@ function createThinkingSession(overrides: Partial<Session> = {}): Session {
|
||||
}
|
||||
|
||||
describe('ThinkingStatusPill', () => {
|
||||
let consoleSpy: ReturnType<typeof vi.spyOn>;
|
||||
|
||||
beforeEach(() => {
|
||||
vi.useFakeTimers();
|
||||
// Suppress console.log for debug logging in component
|
||||
consoleSpy = vi.spyOn(console, 'log').mockImplementation(() => {});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.useRealTimers();
|
||||
consoleSpy.mockRestore();
|
||||
});
|
||||
|
||||
describe('render conditions', () => {
|
||||
@@ -1332,48 +1327,6 @@ describe('ThinkingStatusPill', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('debug logging', () => {
|
||||
it('logs state check when busy sessions exist', () => {
|
||||
const session = createThinkingSession();
|
||||
render(
|
||||
<ThinkingStatusPill
|
||||
sessions={[session]}
|
||||
theme={mockTheme}
|
||||
/>
|
||||
);
|
||||
|
||||
// Console.log should have been called with state check info
|
||||
expect(consoleSpy).toHaveBeenCalledWith(
|
||||
'[ThinkingStatusPill] State check:',
|
||||
expect.objectContaining({
|
||||
thinkingCount: 1,
|
||||
busySessionsCount: 1,
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('logs when sessions have busy tabs but session not busy', () => {
|
||||
const busyTab = createMockAITab({ state: 'busy' });
|
||||
const session = createMockSession({
|
||||
state: 'idle', // Session is idle
|
||||
aiTabs: [busyTab], // But has busy tab
|
||||
});
|
||||
render(
|
||||
<ThinkingStatusPill
|
||||
sessions={[session]}
|
||||
theme={mockTheme}
|
||||
/>
|
||||
);
|
||||
|
||||
expect(consoleSpy).toHaveBeenCalledWith(
|
||||
'[ThinkingStatusPill] State check:',
|
||||
expect.objectContaining({
|
||||
sessionsWithBusyTabsCount: 1,
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('component display names', () => {
|
||||
it('ThinkingStatusPill has correct displayName', () => {
|
||||
expect(ThinkingStatusPill.displayName).toBe('ThinkingStatusPill');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useState, useEffect } from 'react';
|
||||
import { ImageIcon, AlertCircle, Plus, Trash2 } from 'lucide-react';
|
||||
import type { Theme } from '../types';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import mermaid from 'mermaid';
|
||||
import DOMPurify from 'dompurify';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* When AutoRun is active, shows a special AutoRun pill with total elapsed time instead.
|
||||
*/
|
||||
import React, { memo, useState, useEffect } from 'react';
|
||||
import { memo, useState, useEffect } from 'react';
|
||||
import { GitBranch } from 'lucide-react';
|
||||
import type { Session, Theme, AITab, BatchRunState } from '../types';
|
||||
import { formatTokensCompact } from '../utils/formatters';
|
||||
@@ -288,23 +288,6 @@ function ThinkingStatusPillInner({ sessions, theme, onSessionClick, namedSession
|
||||
s => s.state === 'busy' && s.busySource === 'ai'
|
||||
);
|
||||
|
||||
// DEBUG: Log all sessions' busy state to diagnose thinking pill disappearing
|
||||
const busySessions = sessions.filter(s => s.state === 'busy');
|
||||
const sessionsWithBusyTabs = sessions.filter(s => s.aiTabs?.some(t => t.state === 'busy'));
|
||||
if (busySessions.length > 0 || sessionsWithBusyTabs.length > 0) {
|
||||
console.log('[ThinkingStatusPill] State check:', {
|
||||
thinkingCount: thinkingSessions.length,
|
||||
busySessionsCount: busySessions.length,
|
||||
sessionsWithBusyTabsCount: sessionsWithBusyTabs.length,
|
||||
details: sessions.map(s => ({
|
||||
id: s.id.substring(0, 8),
|
||||
state: s.state,
|
||||
busySource: s.busySource,
|
||||
busyTabs: s.aiTabs?.filter(t => t.state === 'busy').map(t => t.id.substring(0, 8))
|
||||
}))
|
||||
});
|
||||
}
|
||||
|
||||
if (thinkingSessions.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user