|
1223 | 1223 | // Removed problematic reactive statement that caused infinite loops |
1224 | 1224 | </script> |
1225 | 1225 |
|
1226 | | -<div class="relative h-full overflow-hidden flex"> |
| 1226 | +<div class="h-full flex overflow-hidden"> |
1227 | 1227 | <!-- Progress bar - positioned absolutely at top --> |
1228 | 1228 | {#if !$isModelLoaded && $modelLoadingProgress < 100} |
1229 | 1229 | <div |
1230 | | - class="absolute top-0 left-0 right-0 z-20 p-4 bg-surface-100-800-token border-b border-surface-300-600-token" |
| 1230 | + class="absolute top-0 left-0 z-20 p-4 bg-surface-100-800-token border-b border-surface-300-600-token" |
| 1231 | + class:right-0={!showRAGPanel} |
| 1232 | + class:right-80={showRAGPanel} |
1231 | 1233 | > |
1232 | 1234 | <div class="flex items-center justify-between mb-2"> |
1233 | 1235 | <span class="text-sm font-medium text-surface-700-200-token" |
|
1241 | 1243 | {/if} |
1242 | 1244 |
|
1243 | 1245 | <!-- Main chat area --> |
1244 | | - <div class="flex-1 relative"> |
| 1246 | + <div class="flex-1 min-h-0 flex flex-col transition-all duration-300" class:mr-80={showRAGPanel}> |
1245 | 1247 | <!-- Chat messages with drag-and-drop --> |
1246 | | - <DragDropZone className="h-full" on:files={handleFilesDropped} on:error={handleFileError}> |
| 1248 | + <DragDropZone className="flex-1 min-h-0" on:files={handleFilesDropped} on:error={handleFileError}> |
1247 | 1249 | <div |
1248 | 1250 | bind:this={chatContainer} |
1249 | | - class="absolute inset-0 overflow-y-auto p-4 space-y-4 scroll-smooth" |
| 1251 | + class="h-full overflow-y-auto p-4 space-y-4 scroll-smooth" |
1250 | 1252 | class:pt-24={!$isModelLoaded && $modelLoadingProgress < 100} |
1251 | | - style="padding-bottom: 10rem; scroll-behavior: smooth; -webkit-overflow-scrolling: touch;" |
| 1253 | + style="scroll-behavior: smooth; -webkit-overflow-scrolling: touch;" |
1252 | 1254 | on:scroll={handleScroll} |
1253 | 1255 | > |
1254 | 1256 | {#if $currentMessages.length === 0} |
|
1277 | 1279 | </div> |
1278 | 1280 | </DragDropZone> |
1279 | 1281 |
|
1280 | | - <!-- Gradient fade for smooth scroll under effect --> |
1281 | | - <div |
1282 | | - class="absolute bottom-20 left-0 right-0 h-24 bg-gradient-to-t from-surface-100/50 dark:from-surface-800/50 to-transparent pointer-events-none z-40" |
1283 | | - ></div> |
1284 | | - |
1285 | | - <!-- Input area --> |
1286 | | - <div |
1287 | | - class="absolute bottom-0 left-0 right-0 bg-surface-100-800-token border-t border-surface-300-600-token p-4 z-50" |
1288 | | - > |
1289 | | - <div class="relative max-w-4xl mx-auto"> |
1290 | | - <div |
1291 | | - class="flex items-end gap-2 p-2 bg-surface-200-700-token rounded-full ring-2 ring-surface-300-600-token hover:ring-primary-500 focus-within:ring-primary-500 transition-all duration-200 shadow-sm" |
1292 | | - > |
1293 | | - <button |
1294 | | - class="btn-icon btn-icon-sm variant-soft-surface ml-1" |
1295 | | - disabled={uploadingFiles} |
1296 | | - aria-label="Upload documents" |
1297 | | - on:click={handleFileButtonClick} |
1298 | | - > |
1299 | | - {#if uploadingFiles} |
1300 | | - <i class="fa fa-spinner fa-spin"></i> |
1301 | | - {:else} |
1302 | | - <i class="fa fa-paperclip"></i> |
1303 | | - {/if} |
1304 | | - </button> |
1305 | | - <textarea |
1306 | | - id="message-input" |
1307 | | - bind:value={messageInput} |
1308 | | - on:keydown={handleKeydown} |
1309 | | - placeholder={$isModelLoaded |
1310 | | - ? 'Write a message...' |
1311 | | - : 'Model loading... You can type but wait to send'} |
1312 | | - disabled={isSubmitting || $isTyping} |
1313 | | - class="flex-1 bg-transparent border-0 ring-0 resize-none px-2 py-1.5 leading-normal min-h-[2.5rem] max-h-32" |
1314 | | - rows="1" |
1315 | | - style="field-sizing: content;" |
1316 | | - ></textarea> |
1317 | | - <button |
1318 | | - on:click={handleSubmit} |
1319 | | - disabled={!messageInput.trim() || isSubmitting || $isTyping} |
1320 | | - class="btn-icon btn-icon-sm variant-filled-primary mr-1" |
| 1282 | + <!-- Input area at bottom --> |
| 1283 | + <div class="fixed bottom-0 left-80 flex flex-col bg-surface-100-800-token border-t border-surface-300-600-token p-4 z-30 transition-all duration-300" class:right-80={showRAGPanel} class:right-0={!showRAGPanel}> |
| 1284 | + <!-- Gradient fade above input --> |
| 1285 | + <div class="absolute -top-4 left-0 right-0 h-4 bg-gradient-to-t from-surface-100-800-token to-transparent pointer-events-none"></div> |
| 1286 | + <div class="relative w-full"> |
| 1287 | + <div |
| 1288 | + class="flex items-end gap-2 p-2 bg-surface-200-700-token rounded-full ring-2 ring-surface-300-600-token hover:ring-primary-500 focus-within:ring-primary-500 transition-all duration-200 shadow-sm" |
1321 | 1289 | > |
1322 | | - {#if isSubmitting || $isTyping} |
1323 | | - <i class="fa fa-spinner fa-spin"></i> |
1324 | | - {:else} |
1325 | | - <i class="fa fa-arrow-up"></i> |
1326 | | - {/if} |
1327 | | - </button> |
| 1290 | + <button |
| 1291 | + class="btn-icon btn-icon-sm variant-soft-surface ml-1" |
| 1292 | + disabled={uploadingFiles} |
| 1293 | + aria-label="Upload documents" |
| 1294 | + on:click={handleFileButtonClick} |
| 1295 | + > |
| 1296 | + {#if uploadingFiles} |
| 1297 | + <i class="fa fa-spinner fa-spin"></i> |
| 1298 | + {:else} |
| 1299 | + <i class="fa fa-paperclip"></i> |
| 1300 | + {/if} |
| 1301 | + </button> |
| 1302 | + <textarea |
| 1303 | + id="message-input" |
| 1304 | + bind:value={messageInput} |
| 1305 | + on:keydown={handleKeydown} |
| 1306 | + placeholder={$isModelLoaded |
| 1307 | + ? 'Write a message...' |
| 1308 | + : 'Model loading... You can type but wait to send'} |
| 1309 | + disabled={isSubmitting || $isTyping} |
| 1310 | + class="flex-1 bg-transparent border-0 ring-0 resize-none px-2 py-1.5 leading-normal min-h-[2.5rem] max-h-32" |
| 1311 | + rows="1" |
| 1312 | + style="field-sizing: content;" |
| 1313 | + ></textarea> |
| 1314 | + <button |
| 1315 | + on:click={handleSubmit} |
| 1316 | + disabled={!messageInput.trim() || isSubmitting || $isTyping} |
| 1317 | + class="btn-icon btn-icon-sm variant-filled-primary mr-1" |
| 1318 | + > |
| 1319 | + {#if isSubmitting || $isTyping} |
| 1320 | + <i class="fa fa-spinner fa-spin"></i> |
| 1321 | + {:else} |
| 1322 | + <i class="fa fa-arrow-up"></i> |
| 1323 | + {/if} |
| 1324 | + </button> |
| 1325 | + </div> |
| 1326 | + |
| 1327 | + <!-- Hidden file input for upload button --> |
| 1328 | + <input |
| 1329 | + bind:this={fileInput} |
| 1330 | + type="file" |
| 1331 | + multiple |
| 1332 | + accept=".pdf,.txt,.md,.docx" |
| 1333 | + on:change={handleFileInputChange} |
| 1334 | + style="display: none;" |
| 1335 | + /> |
1328 | 1336 | </div> |
1329 | 1337 |
|
1330 | | - <!-- Hidden file input for upload button --> |
1331 | | - <input |
1332 | | - bind:this={fileInput} |
1333 | | - type="file" |
1334 | | - multiple |
1335 | | - accept=".pdf,.txt,.md,.docx" |
1336 | | - on:change={handleFileInputChange} |
1337 | | - style="display: none;" |
1338 | | - /> |
| 1338 | + {#if !$isModelLoaded && $modelLoadingProgress < 100} |
| 1339 | + <div class="text-xs text-surface-700-200-token opacity-70 mt-2"> |
| 1340 | + Model is loading ({$modelLoadingProgress}%)... Messages will queue until ready. |
| 1341 | + </div> |
| 1342 | + {/if} |
1339 | 1343 | </div> |
1340 | | - |
1341 | | - {#if !$isModelLoaded && $modelLoadingProgress < 100} |
1342 | | - <div class="text-xs text-surface-700-200-token opacity-70 mt-2"> |
1343 | | - Model is loading ({$modelLoadingProgress}%)... Messages will queue until ready. |
1344 | | - </div> |
1345 | | - {/if} |
1346 | 1344 | </div> |
1347 | | - </div> |
1348 | 1345 |
|
1349 | | - <!-- RAG Context Panel --> |
1350 | | - <RAGContext |
1351 | | - bind:isVisible={showRAGPanel} |
1352 | | - bind:lastQuery={lastRAGQuery} |
1353 | | - forceRefresh={ragRefreshCounter} |
1354 | | - /> |
| 1346 | + <!-- RAG Context Panel - fixed sidebar --> |
| 1347 | + {#if showRAGPanel} |
| 1348 | + <RAGContext |
| 1349 | + bind:isVisible={showRAGPanel} |
| 1350 | + bind:lastQuery={lastRAGQuery} |
| 1351 | + forceRefresh={ragRefreshCounter} |
| 1352 | + /> |
| 1353 | + {/if} |
1355 | 1354 | </div> |
1356 | 1355 |
|
1357 | 1356 | <!-- RAG Toggle Button --> |
|
0 commit comments