Skip to content

Commit 88f57f7

Browse files
committed
refactor: clean up console logs and improve UI consistency
- Removed unnecessary console log statements from various components including TextInputPanel, FormatSection, and FormattedOutput to enhance code clarity. - Updated text in integration tests for better accuracy in progress indicators. - Refactored className formatting in WorkspacePage for improved readability and consistency in UI elements.
1 parent 05d6db4 commit 88f57f7

6 files changed

Lines changed: 250 additions & 262 deletions

File tree

src/__tests__/integration/component-integration.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ describe('Component Integration Tests', () => {
9797
)
9898

9999
// Should show progress indicator
100-
expect(screen.getByText(/Generating Formats \(/)).toBeInTheDocument()
101-
expect(screen.getByText(/1\/3/)).toBeInTheDocument()
100+
expect(screen.getByText(/Generating Formats \(Format/)).toBeInTheDocument()
101+
expect(screen.getByText(/Format 1 of 3/)).toBeInTheDocument()
102102

103103
// Should show currently processing format
104104
expect(screen.getByText(/Currently processing: paragraphs/)).toBeInTheDocument()

src/components/input/TextInputPanel.tsx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,8 @@ export const TextInputPanel = ({
249249
text,
250250
selectedFormats,
251251
(format, content, isComplete) => {
252-
console.log('[TextInputPanel] Streaming callback:', format, 'isComplete:', isComplete, 'content length:', content.length)
253252
if (isComplete) {
254253
aggregatedResults[format] = content
255-
console.log('[TextInputPanel] ✅ Format SAVED to aggregatedResults:', format, 'Content length:', content.length)
256-
} else {
257-
console.log('[TextInputPanel] ⏳ Format streaming (not saved yet):', format)
258254
}
259255
// Pass streaming updates to parent
260256
onStreamingUpdate?.(format, content, isComplete)
@@ -518,13 +514,12 @@ export const TextInputPanel = ({
518514
<div className="ml-auto flex flex-col items-end gap-1">
519515
<div className="flex items-center gap-2 text-sm text-neutral-600">
520516
<span
521-
className={`h-2.5 w-2.5 rounded-full ${
522-
formatTransform.availability === 'available' || formatTransform.availability === 'readily'
523-
? 'bg-green-500'
524-
: formatTransform.availability === 'downloadable'
525-
? 'bg-yellow-500 animate-pulse'
526-
: 'bg-red-500'
527-
}`}
517+
className={`h-2.5 w-2.5 rounded-full ${formatTransform.availability === 'available' || formatTransform.availability === 'readily'
518+
? 'bg-green-500'
519+
: formatTransform.availability === 'downloadable'
520+
? 'bg-yellow-500 animate-pulse'
521+
: 'bg-red-500'
522+
}`}
528523
aria-hidden="true"
529524
/>
530525
<span>

src/components/output/FormatSection.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,10 @@ const FormatSectionComponent = ({
5858
onToggle,
5959
onCopy,
6060
}: FormatSectionProps) => {
61-
console.log(`[FormatSection ${format}] RENDER - content length: ${content?.length || 0}, isLoading: ${isLoading}, isExpanded: ${isExpanded}`)
6261

6362
const [copySuccess, setCopySuccess] = useState(false)
6463
const formatConfig = useMemo(() => getFormatConfig(format), [format])
6564

66-
console.log(`[FormatSection ${format}] formatConfig:`, formatConfig ? 'found' : 'NOT FOUND')
6765

6866
const handleCopy = useCallback(async () => {
6967
onCopy()
@@ -130,7 +128,7 @@ const FormatSectionComponent = ({
130128
<path
131129
className="opacity-75"
132130
fill="currentColor"
133-
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 714 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
131+
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 0 1 4 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
134132
/>
135133
</svg>
136134
<span className="font-medium">Processing...</span>
@@ -155,9 +153,8 @@ const FormatSectionComponent = ({
155153
</div>
156154
) : (
157155
<svg
158-
className={`h-5 w-5 text-neutral-400 transition-transform dark:text-neutral-500 ${
159-
isExpanded ? 'rotate-180' : ''
160-
}`}
156+
className={`h-5 w-5 text-neutral-400 transition-transform dark:text-neutral-500 ${isExpanded ? 'rotate-180' : ''
157+
}`}
161158
fill="none"
162159
viewBox="0 0 24 24"
163160
stroke="currentColor"

src/components/output/FormattedOutput.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,6 @@ export const FormattedOutput = ({
409409
const isFormatLoading = isLoading?.get(format) ?? false
410410
const isFormatExpanded = expandedFormats.has(format)
411411

412-
console.log(`[FormattedOutput RENDER FormatSection] format: ${format}, content length: ${content.length}, isLoading: ${isFormatLoading}, isExpanded: ${isFormatExpanded}`)
413-
414412
return (
415413
<FormatSection
416414
key={format}

src/lib/chrome-ai/services/FormatTransformService.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,6 @@ export class FormatTransformService {
354354
for await (const chunk of this.transformToFormatStreaming(content, format, options)) {
355355
fullContent += chunk
356356
chunkCount++
357-
358-
console.log(`[FormatTransform] ${format} chunk ${chunkCount}: length=${chunk.length}, total=${fullContent.length}`)
359-
360357
// Always split chunks for consistent streaming (more aggressive)
361358
// Even small chunks get split for smooth progressive display
362359
if (chunk.length > 20) {
@@ -378,7 +375,6 @@ export class FormatTransformService {
378375
}
379376
}
380377

381-
console.log(`[FormatTransform] ${format} complete: ${chunkCount} chunks, ${fullContent.length} chars total`)
382378
yield { format, content: fullContent, isComplete: true }
383379
}
384380
}

0 commit comments

Comments
 (0)