Spaces:
Sleeping
Sleeping
Update ui.py
Browse files
ui.py
CHANGED
|
@@ -71,8 +71,9 @@ def create_interface(agent):
|
|
| 71 |
#root,
|
| 72 |
.gradio-container {
|
| 73 |
position: relative !important;
|
|
|
|
| 74 |
min-height: 100vh !important;
|
| 75 |
-
max-height:
|
| 76 |
}
|
| 77 |
|
| 78 |
/* App background */
|
|
@@ -113,8 +114,8 @@ def create_interface(agent):
|
|
| 113 |
|
| 114 |
/* Chat container - flexible height for HF Spaces */
|
| 115 |
.chat-container {
|
| 116 |
-
min-height:
|
| 117 |
-
max-height:
|
| 118 |
height: auto !important;
|
| 119 |
background: var(--panel) !important;
|
| 120 |
border-radius: 16px !important;
|
|
@@ -390,7 +391,9 @@ def create_interface(agent):
|
|
| 390 |
/* Responsive tables */
|
| 391 |
.gradio-container .dataframe {
|
| 392 |
overflow-x: auto !important;
|
|
|
|
| 393 |
max-width: 100% !important;
|
|
|
|
| 394 |
}
|
| 395 |
|
| 396 |
.gradio-container table {
|
|
@@ -398,16 +401,39 @@ def create_interface(agent):
|
|
| 398 |
font-size: 14px !important;
|
| 399 |
}
|
| 400 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 401 |
@media (max-width: 768px) {
|
| 402 |
.gradio-container table {
|
| 403 |
font-size: 12px !important;
|
| 404 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 405 |
}
|
| 406 |
|
| 407 |
/* Hugging Face Spaces specific fixes */
|
| 408 |
.gradio-container {
|
| 409 |
min-height: 100vh !important;
|
| 410 |
-
overflow-y:
|
| 411 |
}
|
| 412 |
|
| 413 |
/* Fix for HF iframe container */
|
|
@@ -433,7 +459,7 @@ def create_interface(agent):
|
|
| 433 |
.gradio-container .tabs,
|
| 434 |
.gradio-container [role="tablist"] + div {
|
| 435 |
height: auto !important;
|
| 436 |
-
min-height:
|
| 437 |
}
|
| 438 |
|
| 439 |
/* Responsive Design */
|
|
|
|
| 71 |
#root,
|
| 72 |
.gradio-container {
|
| 73 |
position: relative !important;
|
| 74 |
+
height: auto !important;
|
| 75 |
min-height: 100vh !important;
|
| 76 |
+
max-height: 100vh !important; /* Constrain to viewport to prevent infinite scrolling */
|
| 77 |
}
|
| 78 |
|
| 79 |
/* App background */
|
|
|
|
| 114 |
|
| 115 |
/* Chat container - flexible height for HF Spaces */
|
| 116 |
.chat-container {
|
| 117 |
+
min-height: 400px !important;
|
| 118 |
+
max-height: 600px !important;
|
| 119 |
height: auto !important;
|
| 120 |
background: var(--panel) !important;
|
| 121 |
border-radius: 16px !important;
|
|
|
|
| 391 |
/* Responsive tables */
|
| 392 |
.gradio-container .dataframe {
|
| 393 |
overflow-x: auto !important;
|
| 394 |
+
overflow-y: auto !important;
|
| 395 |
max-width: 100% !important;
|
| 396 |
+
max-height: calc(100vh - 300px) !important; /* Constrain DataFrame height */
|
| 397 |
}
|
| 398 |
|
| 399 |
.gradio-container table {
|
|
|
|
| 401 |
font-size: 14px !important;
|
| 402 |
}
|
| 403 |
|
| 404 |
+
/* Specific constraints for tab DataFrames */
|
| 405 |
+
.gradio-container .tabitem .dataframe {
|
| 406 |
+
max-height: calc(100vh - 350px) !important; /* Even more constrained in tabs */
|
| 407 |
+
overflow-y: auto !important;
|
| 408 |
+
}
|
| 409 |
+
|
| 410 |
+
/* Constrain textboxes in tabs */
|
| 411 |
+
.gradio-container .tabitem textarea,
|
| 412 |
+
.gradio-container .tabitem .textbox textarea {
|
| 413 |
+
max-height: calc(100vh - 400px) !important; /* Limit textbox height in tabs */
|
| 414 |
+
overflow-y: auto !important;
|
| 415 |
+
}
|
| 416 |
+
|
| 417 |
@media (max-width: 768px) {
|
| 418 |
.gradio-container table {
|
| 419 |
font-size: 12px !important;
|
| 420 |
}
|
| 421 |
+
|
| 422 |
+
/* Tighter constraints for mobile */
|
| 423 |
+
.gradio-container .tabitem .dataframe {
|
| 424 |
+
max-height: calc(100vh - 400px) !important;
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
.gradio-container .tabitem textarea,
|
| 428 |
+
.gradio-container .tabitem .textbox textarea {
|
| 429 |
+
max-height: calc(100vh - 450px) !important;
|
| 430 |
+
}
|
| 431 |
}
|
| 432 |
|
| 433 |
/* Hugging Face Spaces specific fixes */
|
| 434 |
.gradio-container {
|
| 435 |
min-height: 100vh !important;
|
| 436 |
+
overflow-y: visible !important; /* Let tab content handle its own scrolling */
|
| 437 |
}
|
| 438 |
|
| 439 |
/* Fix for HF iframe container */
|
|
|
|
| 459 |
.gradio-container .tabs,
|
| 460 |
.gradio-container [role="tablist"] + div {
|
| 461 |
height: auto !important;
|
| 462 |
+
min-height: auto !important; /* Don't force full height */
|
| 463 |
}
|
| 464 |
|
| 465 |
/* Responsive Design */
|