bradnow commited on
Commit
faae316
·
1 Parent(s): 28d7df1

Improve CSS height adjustment to avoid weird height over-growing issues

Browse files
Files changed (2) hide show
  1. app.py +3 -2
  2. styles.css +16 -26
app.py CHANGED
@@ -117,7 +117,7 @@ def run_chat_inference(history, message, state):
117
 
118
  # Reinitialize the OpenAI client with a random endpoint from the list
119
  setup_model(model_config.get('MODEL_KEY'))
120
- log_info("Using model {model_name} with endpoint {model_config.get('base_url')}")
121
 
122
  if len(history) == 0:
123
  state["chat_id"] = uuid4().hex
@@ -531,7 +531,8 @@ with gr.Blocks(theme=theme, css=custom_css) as demo:
531
 
532
  chatbot = gr.Chatbot(
533
  type="messages",
534
- height="calc(100dvh - 310px)",
 
535
  elem_classes="chatbot",
536
  )
537
 
 
117
 
118
  # Reinitialize the OpenAI client with a random endpoint from the list
119
  setup_model(model_config.get('MODEL_KEY'))
120
+ log_info(f"Using model {model_name} with endpoint {model_config.get('base_url')}")
121
 
122
  if len(history) == 0:
123
  state["chat_id"] = uuid4().hex
 
531
 
532
  chatbot = gr.Chatbot(
533
  type="messages",
534
+ height="calc(100svh - 320px)",
535
+ max_height="calc(100svh - 320px)",
536
  elem_classes="chatbot",
537
  )
538
 
styles.css CHANGED
@@ -26,10 +26,6 @@
26
  padding: 0;
27
  }
28
 
29
- .chatbot {
30
- max-height: 1400px;
31
- }
32
-
33
  .user-input-container .multimodal-textbox{
34
  border: none !important;
35
  }
@@ -62,7 +58,19 @@ button.cancel:hover, .cancel[disabled] {
62
  color: var(--neutral-400) !important;
63
  }
64
 
65
- @media (max-width: 800px) {
 
 
 
 
 
 
 
 
 
 
 
 
66
  .responsive-row {
67
  flex-direction: column;
68
  }
@@ -78,7 +86,7 @@ button.cancel:hover, .cancel[disabled] {
78
  }
79
 
80
  .chatbot {
81
- max-height: 800px;
82
  }
83
  }
84
 
@@ -98,30 +106,12 @@ button.cancel:hover, .cancel[disabled] {
98
  }
99
 
100
  .chatbot {
101
- max-height: 360px;
102
- }
103
- }
104
-
105
- @media (max-width: 1280px) {
106
- .chatbot {
107
- max-height: 900px;
108
  }
109
  }
110
 
111
  @media (max-height: 932px) {
112
  .chatbot {
113
- max-height: calc(100dvh - 400px);
114
- }
115
- }
116
-
117
- @media (max-height: 1280px) {
118
- .chatbot {
119
- max-height: calc(100dvh - 400px);
120
  }
121
  }
122
-
123
- @media (min-height: 1281px) {
124
- .chatbot {
125
- /*max-height: calc(100dvh - 400px);*/
126
- }
127
- }
 
26
  padding: 0;
27
  }
28
 
 
 
 
 
29
  .user-input-container .multimodal-textbox{
30
  border: none !important;
31
  }
 
58
  color: var(--neutral-400) !important;
59
  }
60
 
61
+ .chatbot {
62
+ height: calc(100svh - 320px) !important;
63
+ max_height: calc(100svh - 320px) !important;
64
+ max-height: 1400px;
65
+ }
66
+
67
+ @media (max-width: 1280px) {
68
+ .chatbot {
69
+ max-height: calc(-320px + 100svh) !important;
70
+ }
71
+ }
72
+
73
+ @media (max-width: 1024px) {
74
  .responsive-row {
75
  flex-direction: column;
76
  }
 
86
  }
87
 
88
  .chatbot {
89
+ max-height: calc(-450px + 100svh) !important;
90
  }
91
  }
92
 
 
106
  }
107
 
108
  .chatbot {
109
+ max-height: 360px !important;
 
 
 
 
 
 
110
  }
111
  }
112
 
113
  @media (max-height: 932px) {
114
  .chatbot {
115
+ min-height: 320px;
 
 
 
 
 
 
116
  }
117
  }