Skip to content

Commit 0f35907

Browse files
CopilotPierrunoYT
andcommitted
Address code review feedback: extract JSX and clarify comments
Co-authored-by: PierrunoYT <95778421+PierrunoYT@users.noreply.github.com>
1 parent f48d10d commit 0f35907

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

cli/src/index.tsx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -303,26 +303,25 @@ async function main(): Promise<void> {
303303

304304
const root = createRoot(renderer)
305305

306-
// Add SIGWINCH listener for terminal resize support on Windows PowerShell
307-
// This ensures the terminal UI updates when the window is resized
308-
// The listener triggers a re-render to update the layout with new dimensions
306+
// React component tree to render
307+
const app = (
308+
<QueryClientProvider client={queryClient}>
309+
<AppWithAsyncAuth />
310+
</QueryClientProvider>
311+
)
312+
313+
// Add resize event listener for terminal resize support on Windows PowerShell
314+
// On Windows, the SIGWINCH signal may not fire reliably, so we listen to
315+
// process.stdout 'resize' event to ensure the UI updates when the window is resized
309316
if (process.stdout.isTTY) {
310317
process.stdout.on('resize', () => {
311318
// Re-render the React tree to update with new terminal dimensions
312-
// This is necessary on Windows where SIGWINCH may not work reliably
313-
root.render(
314-
<QueryClientProvider client={queryClient}>
315-
<AppWithAsyncAuth />
316-
</QueryClientProvider>,
317-
)
319+
root.render(app)
318320
})
319321
}
320322

321-
root.render(
322-
<QueryClientProvider client={queryClient}>
323-
<AppWithAsyncAuth />
324-
</QueryClientProvider>,
325-
)
323+
// Initial render
324+
root.render(app)
326325
}
327326

328327
void main()

0 commit comments

Comments
 (0)