Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -324,7 +324,7 @@ desktop_css = """
|
|
| 324 |
flex-direction: column !important;
|
| 325 |
}
|
| 326 |
|
| 327 |
-
/* CHAT CONTAINER -
|
| 328 |
.desktop-chat {
|
| 329 |
background: linear-gradient(180deg, #111111 0%, #0a0a0a 100%) !important;
|
| 330 |
border: 1px solid #262626 !important;
|
|
@@ -338,6 +338,131 @@ desktop_css = """
|
|
| 338 |
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
|
| 339 |
height: 100% !important;
|
| 340 |
min-width: 0 !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 341 |
}
|
| 342 |
|
| 343 |
/* Override Gradio's column behavior for exact alignment */
|
|
@@ -742,48 +867,66 @@ with gr.Blocks(css=desktop_css, title="Coding Copilot Pro - Desktop", theme=gr.t
|
|
| 742 |
""")
|
| 743 |
|
| 744 |
# Right Chat Container - MUCH LARGER and properly aligned
|
| 745 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 746 |
|
| 747 |
-
|
| 748 |
-
|
| 749 |
-
|
| 750 |
-
|
| 751 |
-
|
| 752 |
-
|
| 753 |
-
|
| 754 |
-
|
| 755 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 756 |
)
|
| 757 |
-
|
| 758 |
-
# Input area at bottom - better organized
|
| 759 |
-
with gr.Column(elem_classes=["chat-input-area"]):
|
| 760 |
-
# Download status and file
|
| 761 |
-
download_status = gr.HTML("", visible=True)
|
| 762 |
-
download_file = gr.File(label="π₯ Download Generated Code", visible=False)
|
| 763 |
-
|
| 764 |
-
# File upload - better positioned
|
| 765 |
-
files = gr.File(
|
| 766 |
-
label="π Upload Code Files (.py, .ipynb)",
|
| 767 |
-
file_count="multiple",
|
| 768 |
-
file_types=[".py", ".ipynb"],
|
| 769 |
-
container=True,
|
| 770 |
-
elem_classes=["file-upload-area"]
|
| 771 |
-
)
|
| 772 |
-
|
| 773 |
-
# LARGER Message input
|
| 774 |
-
msg = gr.Textbox(
|
| 775 |
-
label="",
|
| 776 |
-
placeholder="Describe what you want to build, analyze, or improve... Type 'continue' to extend previous code.",
|
| 777 |
-
show_label=False,
|
| 778 |
-
lines=3,
|
| 779 |
-
max_lines=6,
|
| 780 |
-
elem_classes=["message-input"]
|
| 781 |
-
)
|
| 782 |
-
|
| 783 |
-
# Button row - better spaced
|
| 784 |
-
with gr.Row(elem_classes=["button-row"]):
|
| 785 |
-
clear = gr.Button("CLEAR", variant="secondary", elem_classes=["secondary-button"])
|
| 786 |
-
submit = gr.Button("SEND", variant="primary", elem_classes=["primary-button"])
|
| 787 |
|
| 788 |
# Hidden state
|
| 789 |
chat_history = gr.State([])
|
|
|
|
| 324 |
flex-direction: column !important;
|
| 325 |
}
|
| 326 |
|
| 327 |
+
/* CHAT CONTAINER - MUCH LARGER and properly aligned */
|
| 328 |
.desktop-chat {
|
| 329 |
background: linear-gradient(180deg, #111111 0%, #0a0a0a 100%) !important;
|
| 330 |
border: 1px solid #262626 !important;
|
|
|
|
| 338 |
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
|
| 339 |
height: 100% !important;
|
| 340 |
min-width: 0 !important;
|
| 341 |
+
visibility: visible !important;
|
| 342 |
+
opacity: 1 !important;
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
+
/* CHAT CONTAINER - MUCH LARGER */
|
| 346 |
+
.chat-main {
|
| 347 |
+
flex: 1 !important;
|
| 348 |
+
display: flex !important;
|
| 349 |
+
flex-direction: column !important;
|
| 350 |
+
height: 100% !important;
|
| 351 |
+
overflow: hidden !important;
|
| 352 |
+
visibility: visible !important;
|
| 353 |
+
opacity: 1 !important;
|
| 354 |
+
}
|
| 355 |
+
|
| 356 |
+
/* CHAT MESSAGES - MUCH BIGGER AREA */
|
| 357 |
+
.chat-messages {
|
| 358 |
+
flex: 1 !important;
|
| 359 |
+
overflow-y: auto !important;
|
| 360 |
+
padding: 1.5rem !important;
|
| 361 |
+
height: 0 !important;
|
| 362 |
+
min-height: 500px !important;
|
| 363 |
+
visibility: visible !important;
|
| 364 |
+
opacity: 1 !important;
|
| 365 |
+
}
|
| 366 |
+
|
| 367 |
+
/* LARGER CHATBOT - FORCE VISIBILITY */
|
| 368 |
+
.chatbot {
|
| 369 |
+
height: 600px !important;
|
| 370 |
+
min-height: 600px !important;
|
| 371 |
+
visibility: visible !important;
|
| 372 |
+
opacity: 1 !important;
|
| 373 |
+
display: block !important;
|
| 374 |
+
}
|
| 375 |
+
|
| 376 |
+
/* CHAT INPUT AREA - FORCE VISIBILITY */
|
| 377 |
+
.chat-input-area {
|
| 378 |
+
flex-shrink: 0 !important;
|
| 379 |
+
background: #1a1a1a !important;
|
| 380 |
+
border-top: 1px solid #262626 !important;
|
| 381 |
+
padding: 1.5rem !important;
|
| 382 |
+
max-height: none !important;
|
| 383 |
+
min-height: 200px !important;
|
| 384 |
+
visibility: visible !important;
|
| 385 |
+
opacity: 1 !important;
|
| 386 |
+
display: flex !important;
|
| 387 |
+
flex-direction: column !important;
|
| 388 |
+
gap: 1rem !important;
|
| 389 |
+
}
|
| 390 |
+
|
| 391 |
+
/* File Upload Styling - FORCE VISIBILITY */
|
| 392 |
+
.file-upload-area {
|
| 393 |
+
background: #1a1a1a !important;
|
| 394 |
+
border: 1px dashed #404040 !important;
|
| 395 |
+
border-radius: 8px !important;
|
| 396 |
+
padding: 1rem !important;
|
| 397 |
+
margin-bottom: 1rem !important;
|
| 398 |
+
transition: all 0.3s ease !important;
|
| 399 |
+
visibility: visible !important;
|
| 400 |
+
opacity: 1 !important;
|
| 401 |
+
display: block !important;
|
| 402 |
+
}
|
| 403 |
+
|
| 404 |
+
/* Input Styling - FORCE VISIBILITY */
|
| 405 |
+
.message-input {
|
| 406 |
+
background: #262626 !important;
|
| 407 |
+
border: 1px solid #404040 !important;
|
| 408 |
+
border-radius: 8px !important;
|
| 409 |
+
color: #ffffff !important;
|
| 410 |
+
padding: 1rem !important;
|
| 411 |
+
font-size: 0.95rem !important;
|
| 412 |
+
line-height: 1.4 !important;
|
| 413 |
+
resize: vertical !important;
|
| 414 |
+
transition: all 0.3s ease !important;
|
| 415 |
+
width: 100% !important;
|
| 416 |
+
margin-bottom: 1rem !important;
|
| 417 |
+
min-height: 80px !important;
|
| 418 |
+
visibility: visible !important;
|
| 419 |
+
opacity: 1 !important;
|
| 420 |
+
display: block !important;
|
| 421 |
+
}
|
| 422 |
+
|
| 423 |
+
/* Button Row - FORCE VISIBILITY */
|
| 424 |
+
.button-row {
|
| 425 |
+
display: flex !important;
|
| 426 |
+
gap: 1rem !important;
|
| 427 |
+
align-items: center !important;
|
| 428 |
+
justify-content: flex-end !important;
|
| 429 |
+
visibility: visible !important;
|
| 430 |
+
opacity: 1 !important;
|
| 431 |
+
}
|
| 432 |
+
|
| 433 |
+
/* Buttons - FORCE VISIBILITY */
|
| 434 |
+
.primary-button, .secondary-button {
|
| 435 |
+
visibility: visible !important;
|
| 436 |
+
opacity: 1 !important;
|
| 437 |
+
display: inline-block !important;
|
| 438 |
+
}
|
| 439 |
+
|
| 440 |
+
/* Override any Gradio hiding */
|
| 441 |
+
.gradio-container .block,
|
| 442 |
+
.gradio-container .form,
|
| 443 |
+
.gradio-container .wrap {
|
| 444 |
+
visibility: visible !important;
|
| 445 |
+
opacity: 1 !important;
|
| 446 |
+
display: block !important;
|
| 447 |
+
}
|
| 448 |
+
|
| 449 |
+
/* Force all gradio components to be visible */
|
| 450 |
+
.gr-form,
|
| 451 |
+
.gr-box,
|
| 452 |
+
.gr-panel {
|
| 453 |
+
visibility: visible !important;
|
| 454 |
+
opacity: 1 !important;
|
| 455 |
+
display: block !important;
|
| 456 |
+
}
|
| 457 |
+
|
| 458 |
+
/* Specific Gradio component fixes */
|
| 459 |
+
gradio-file,
|
| 460 |
+
gradio-textbox,
|
| 461 |
+
gradio-button,
|
| 462 |
+
gradio-chatbot {
|
| 463 |
+
visibility: visible !important;
|
| 464 |
+
opacity: 1 !important;
|
| 465 |
+
display: block !important;
|
| 466 |
}
|
| 467 |
|
| 468 |
/* Override Gradio's column behavior for exact alignment */
|
|
|
|
| 867 |
""")
|
| 868 |
|
| 869 |
# Right Chat Container - MUCH LARGER and properly aligned
|
| 870 |
+
# Right Chat Container - MUCH LARGER and properly aligned
|
| 871 |
+
with gr.Column(elem_classes=["desktop-chat"], scale=1, visible=True):
|
| 872 |
+
|
| 873 |
+
with gr.Column(elem_classes=["chat-main"], visible=True):
|
| 874 |
+
# MUCH LARGER Chat messages area
|
| 875 |
+
chatbot = gr.Chatbot(
|
| 876 |
+
height=600,
|
| 877 |
+
show_label=False,
|
| 878 |
+
container=True,
|
| 879 |
+
bubble_full_width=False,
|
| 880 |
+
avatar_images=("π¨βπ»", "π€"),
|
| 881 |
+
elem_classes=["chat-messages", "chatbot"],
|
| 882 |
+
visible=True
|
| 883 |
+
)
|
| 884 |
+
|
| 885 |
+
# Input area at bottom - better organized
|
| 886 |
+
with gr.Column(elem_classes=["chat-input-area"], visible=True):
|
| 887 |
+
# Download status and file
|
| 888 |
+
download_status = gr.HTML("", visible=True)
|
| 889 |
+
download_file = gr.File(
|
| 890 |
+
label="π₯ Download Generated Code",
|
| 891 |
+
visible=False,
|
| 892 |
+
elem_classes=["download-section"]
|
| 893 |
+
)
|
| 894 |
|
| 895 |
+
# File upload - better positioned
|
| 896 |
+
files = gr.File(
|
| 897 |
+
label="π Upload Code Files (.py, .ipynb)",
|
| 898 |
+
file_count="multiple",
|
| 899 |
+
file_types=[".py", ".ipynb"],
|
| 900 |
+
container=True,
|
| 901 |
+
elem_classes=["file-upload-area"],
|
| 902 |
+
visible=True
|
| 903 |
+
)
|
| 904 |
+
|
| 905 |
+
# LARGER Message input
|
| 906 |
+
msg = gr.Textbox(
|
| 907 |
+
label="",
|
| 908 |
+
placeholder="Describe what you want to build, analyze, or improve... Type 'continue' to extend previous code.",
|
| 909 |
+
show_label=False,
|
| 910 |
+
lines=3,
|
| 911 |
+
max_lines=6,
|
| 912 |
+
elem_classes=["message-input"],
|
| 913 |
+
visible=True
|
| 914 |
+
)
|
| 915 |
+
|
| 916 |
+
# Button row - better spaced
|
| 917 |
+
with gr.Row(elem_classes=["button-row"], visible=True):
|
| 918 |
+
clear = gr.Button(
|
| 919 |
+
"CLEAR",
|
| 920 |
+
variant="secondary",
|
| 921 |
+
elem_classes=["secondary-button"],
|
| 922 |
+
visible=True
|
| 923 |
+
)
|
| 924 |
+
submit = gr.Button(
|
| 925 |
+
"SEND",
|
| 926 |
+
variant="primary",
|
| 927 |
+
elem_classes=["primary-button"],
|
| 928 |
+
visible=True
|
| 929 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 930 |
|
| 931 |
# Hidden state
|
| 932 |
chat_history = gr.State([])
|