ใ……ใ…Žใ…‡ 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
Files changed (1) hide show
  1. 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
- #session_id_input input,
 
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
- with gr.Row():
171
- session_id_input = gr.Textbox(
172
- label="Session ID (์ด ID๊ฐ€ ๊ฐ™์œผ๋ฉด ๋Œ€ํ™”๊ฐ€ ์œ ์ง€๋ฉ๋‹ˆ๋‹ค)",
173
- value=str(uuid.uuid4()),
174
- interactive=True,
175
- placeholder="์„ธ์…˜ ID๋ฅผ ์ž…๋ ฅํ•˜๊ฑฐ๋‚˜ ๊ทธ๋Œ€๋กœ ๋‘์„ธ์š”",
176
- elem_id="session_id_input", # CSS ํƒ€๊ฒŸํŒ…์šฉ
177
- container=True, # ๋ ˆ์ด๋ธ” ํ‘œ์‹œ ๋ณด์žฅ
178
- scale=10 # Row ๋‚ด์—์„œ ์ƒ๋Œ€์  ํฌ๊ธฐ
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 ์ด๋ฒคํŠธ๋ฅผ ๋ฐ”์ธ๋”ฉ