From e44664cb17a84a2e7bcda910066a1225c90111f9 Mon Sep 17 00:00:00 2001 From: tusharmagar Date: Tue, 20 Jan 2026 02:24:42 +0530 Subject: [PATCH] remove unused token estimation logic add full-screen chat functionality --- apps/x/apps/renderer/src/App.tsx | 47 +++-------------- .../renderer/src/components/chat-sidebar.tsx | 52 ++++++++++++++----- 2 files changed, 48 insertions(+), 51 deletions(-) diff --git a/apps/x/apps/renderer/src/App.tsx b/apps/x/apps/renderer/src/App.tsx index 8a5548da..c41833de 100644 --- a/apps/x/apps/renderer/src/App.tsx +++ b/apps/x/apps/renderer/src/App.tsx @@ -80,11 +80,6 @@ type ConversationItem = ChatMessage | ToolCall | ReasoningBlock; type ToolState = 'input-streaming' | 'input-available' | 'output-available' | 'output-error'; -const estimateTokens = (text: string) => { - if (!text) return 0 - return Math.ceil(text.trim().length / 4) -} - const isChatMessage = (item: ConversationItem): item is ChatMessage => 'role' in item const isToolCall = (item: ConversationItem): item is ToolCall => 'name' in item const isReasoningBlock = (item: ConversationItem): item is ReasoningBlock => @@ -274,7 +269,7 @@ function ChatInputInner({ placeholder="Type your message..." disabled={isProcessing} onKeyDown={handleKeyDown} - className="min-h-[1.5rem] py-0 border-0 shadow-none focus-visible:ring-0 rounded-none" + className="min-h-6 py-0 border-0 shadow-none focus-visible:ring-0 rounded-none" /> - - New chat - - + {/* Content - delayed on open, hidden immediately on close to avoid layout issues during animation */} + {showContent && ( + <> + {/* Header - minimal, expand and new chat buttons */} +
+ {onOpenFullScreen && ( + + + + + Full screen chat + + )} + + + + + New chat + +
{/* Conversation area */}
@@ -536,6 +562,8 @@ export function ChatSidebar({ )}
+ + )} ) }