Spaces:
Sleeping
Sleeping
ใ
ใ
ใ
commited on
Commit ยท
a400d33
1
Parent(s): c61475f
Fix: Improve Session ID input layout using Gradio Blocks pattern - Remove gr.Row() wrapper to allow full width usage - Improve CSS selectors for Textbox container and input elements - Follow official Gradio Blocks documentation pattern
Browse files- CodeWeaver/ui/app.py +19 -11
CodeWeaver/ui/app.py
CHANGED
|
@@ -46,16 +46,25 @@ CSS = """
|
|
| 46 |
}
|
| 47 |
.message { font-size: 1.1rem; line-height: 1.6; }
|
| 48 |
/* Session ID ์
๋ ฅ ํ๋ - elem_id๋ก ์ ํํ ํ๊ฒํ
*/
|
|
|
|
| 49 |
#session_id_input {
|
| 50 |
width: 100% !important;
|
| 51 |
min-width: 0 !important;
|
| 52 |
max-width: 100% !important;
|
| 53 |
box-sizing: border-box !important;
|
| 54 |
}
|
| 55 |
-
|
|
|
|
| 56 |
#session_id_input textarea {
|
| 57 |
width: 100% !important;
|
| 58 |
min-width: 0 !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
}
|
| 60 |
/* ๋ฉ์ถค ๋ฒํผ ์จ๊ธฐ๊ธฐ ๋ฐ ํด๋ฆญ ๋นํ์ฑํ */
|
| 61 |
button[aria-label*="Stop"],
|
|
@@ -167,16 +176,15 @@ def create_demo() -> gr.Blocks:
|
|
| 167 |
""")
|
| 168 |
|
| 169 |
# 2. Session ID ์
๋ ฅ์ฐฝ
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
)
|
| 180 |
|
| 181 |
# 3. ์ฑํ
์ธํฐํ์ด์ค
|
| 182 |
# Chatbot ๊ฐ์ฒด๋ฅผ ๋จผ์ ์์ฑํ์ฌ clear ์ด๋ฒคํธ๋ฅผ ๋ฐ์ธ๋ฉ
|
|
|
|
| 46 |
}
|
| 47 |
.message { font-size: 1.1rem; line-height: 1.6; }
|
| 48 |
/* Session ID ์
๋ ฅ ํ๋ - elem_id๋ก ์ ํํ ํ๊ฒํ
*/
|
| 49 |
+
/* Gradio Blocks ๋ฌธ์ ์ฐธ๊ณ : ์ ์ฒด ๋๋น ์ฌ์ฉ์ ์ํ ์คํ์ผ */
|
| 50 |
#session_id_input {
|
| 51 |
width: 100% !important;
|
| 52 |
min-width: 0 !important;
|
| 53 |
max-width: 100% !important;
|
| 54 |
box-sizing: border-box !important;
|
| 55 |
}
|
| 56 |
+
/* Textbox ๋ด๋ถ input ์์ ์คํ์ผ */
|
| 57 |
+
#session_id_input input[type="text"],
|
| 58 |
#session_id_input textarea {
|
| 59 |
width: 100% !important;
|
| 60 |
min-width: 0 !important;
|
| 61 |
+
box-sizing: border-box !important;
|
| 62 |
+
}
|
| 63 |
+
/* Textbox ์ปจํ
์ด๋ ์คํ์ผ */
|
| 64 |
+
#session_id_input.form,
|
| 65 |
+
#session_id_input > .form {
|
| 66 |
+
width: 100% !important;
|
| 67 |
+
max-width: 100% !important;
|
| 68 |
}
|
| 69 |
/* ๋ฉ์ถค ๋ฒํผ ์จ๊ธฐ๊ธฐ ๋ฐ ํด๋ฆญ ๋นํ์ฑํ */
|
| 70 |
button[aria-label*="Stop"],
|
|
|
|
| 176 |
""")
|
| 177 |
|
| 178 |
# 2. Session ID ์
๋ ฅ์ฐฝ
|
| 179 |
+
# Gradio Blocks ๋ฌธ์ ์ฐธ๊ณ : Row ์์ด ์ง์ ๋ฐฐ์นํ์ฌ ์ ์ฒด ๋๋น ์ฌ์ฉ
|
| 180 |
+
session_id_input = gr.Textbox(
|
| 181 |
+
label="Session ID (์ด ID๊ฐ ๊ฐ์ผ๋ฉด ๋ํ๊ฐ ์ ์ง๋ฉ๋๋ค)",
|
| 182 |
+
value=str(uuid.uuid4()),
|
| 183 |
+
interactive=True,
|
| 184 |
+
placeholder="์ธ์
ID๋ฅผ ์
๋ ฅํ๊ฑฐ๋ ๊ทธ๋๋ก ๋์ธ์",
|
| 185 |
+
elem_id="session_id_input", # CSS ํ๊ฒํ
์ฉ
|
| 186 |
+
container=True # ๋ ์ด๋ธ ํ์ ๋ณด์ฅ
|
| 187 |
+
)
|
|
|
|
| 188 |
|
| 189 |
# 3. ์ฑํ
์ธํฐํ์ด์ค
|
| 190 |
# Chatbot ๊ฐ์ฒด๋ฅผ ๋จผ์ ์์ฑํ์ฌ clear ์ด๋ฒคํธ๋ฅผ ๋ฐ์ธ๋ฉ
|