@@ -4,7 +4,7 @@ import { useShallow } from 'zustand/react/shallow'
44import stringWidth from 'string-width'
55
66import { AgentModeToggle } from './components/agent-mode-toggle'
7- import { LoginScreen } from './components/login-screen '
7+ import { LoginModal } from './components/login-modal '
88import {
99 MultilineInput,
1010 type MultilineInputHandle,
@@ -99,15 +99,15 @@ export const App = ({
9999 const { width: measuredWidth } = useTerminalDimensions()
100100 const scrollRef = useRef<ScrollBoxRenderable | null>(null)
101101 const inputRef = useRef<MultilineInputHandle | null>(null)
102- const sanitizeDimension = (value: number | null | undefined): number | null => {
102+ const sanitizeDimension = (
103+ value: number | null | undefined,
104+ ): number | null => {
103105 if (typeof value !== 'number') return null
104106 if (!Number.isFinite(value) || value <= 0) return null
105107 return value
106108 }
107109 const resolvedTerminalWidth =
108- sanitizeDimension(measuredWidth) ??
109- sanitizeDimension(renderer?.width) ??
110- 80
110+ sanitizeDimension(measuredWidth) ?? sanitizeDimension(renderer?.width) ?? 80
111111 const terminalWidth = resolvedTerminalWidth
112112 const separatorWidth = Math.max(1, Math.floor(terminalWidth) - 2)
113113
@@ -117,7 +117,9 @@ export const App = ({
117117
118118 const [exitWarning, setExitWarning] = useState<string | null>(null)
119119 const exitArmedRef = useRef(false)
120- const exitWarningTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)
120+ const exitWarningTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(
121+ null,
122+ )
121123 const lastSigintTimeRef = useRef<number>(0)
122124
123125 // Track authentication state
@@ -289,7 +291,10 @@ export const App = ({
289291 // If already armed, exit immediately
290292 if (exitArmedRef.current) {
291293 const flushed = flushAnalytics()
292- if (flushed && typeof (flushed as Promise<void>).finally === 'function') {
294+ if (
295+ flushed &&
296+ typeof (flushed as Promise<void>).finally === 'function'
297+ ) {
293298 ;(flushed as Promise<void>).finally(() => process.exit(0))
294299 } else {
295300 process.exit(0)
@@ -781,7 +786,9 @@ export const App = ({
781786 ) : null
782787
783788 const shouldShowQueuePreview = queuedMessages.length > 0
784- const shouldShowStatusLine = Boolean(exitWarning || hasStatus || shouldShowQueuePreview)
789+ const shouldShowStatusLine = Boolean(
790+ exitWarning || hasStatus || shouldShowQueuePreview,
791+ )
785792 const statusIndicatorNode = (
786793 <StatusIndicator
787794 isProcessing={isWaitingForResponse}
@@ -790,17 +797,6 @@ export const App = ({
790797 />
791798 )
792799
793- // Show login screen if not authenticated
794- if (!isAuthenticated) {
795- return (
796- <LoginScreen
797- onLoginSuccess={handleLoginSuccess}
798- theme={theme}
799- hasInvalidCredentials={hasInvalidCredentials}
800- />
801- )
802- }
803-
804800 return (
805801 <box
806802 style={{
@@ -951,6 +947,15 @@ export const App = ({
951947 </box>
952948 <Separator theme={theme} width={separatorWidth} />
953949 </box>
950+
951+ {/* Login Modal Overlay - show when not authenticated */}
952+ {!isAuthenticated && (
953+ <LoginModal
954+ onLoginSuccess={handleLoginSuccess}
955+ theme={theme}
956+ hasInvalidCredentials={hasInvalidCredentials}
957+ />
958+ )}
954959 </box>
955960 )
956961}
0 commit comments