rahul7star commited on
Commit
a6ba9d3
·
verified ·
1 Parent(s): d0e0693

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -28
app.py CHANGED
@@ -213,14 +213,19 @@ def build_ui():
213
  with gr.Blocks(
214
  theme=gr.themes.Soft(primary_hue="indigo"),
215
  css="""
216
- /* --- Hide share & delete buttons (Gradio v4 compatible) --- */
217
- [class*="message-actions"] button,
218
- [class*="message-controls"] button {
 
 
 
 
 
219
  display: none !important;
220
  visibility: hidden !important;
221
  }
222
 
223
- /* --- Chat layout styling --- */
224
  #ohamlab .message.user {
225
  background-color: #4f46e5 !important;
226
  color: white !important;
@@ -228,10 +233,9 @@ def build_ui():
228
  align-self: flex-end !important;
229
  text-align: right !important;
230
  margin-left: 25%;
231
- padding: 0.6rem 1rem !important;
232
- max-width: 70%;
233
  }
234
 
 
235
  #ohamlab .message.assistant {
236
  background-color: #f8f9fa !important;
237
  color: #111 !important;
@@ -239,24 +243,12 @@ def build_ui():
239
  align-self: flex-start !important;
240
  text-align: left !important;
241
  margin-right: 25%;
242
- padding: 0.6rem 1rem !important;
243
- max-width: 70%;
244
- }
245
-
246
- /* --- Replace circular bot icon text with 'OhamLab' --- */
247
- #ohamlab .avatar span,
248
- #ohamlab .avatar {
249
- background: none !important;
250
- color: #4f46e5 !important;
251
- font-weight: 700 !important;
252
- font-size: 0.9rem !important;
253
- }
254
- #ohamlab .avatar::before {
255
- content: "OhamLab" !important;
256
- display: inline-block;
257
  }
 
 
 
258
 
259
- /* --- Container and Inputs --- */
260
  .gradio-container {
261
  max-width: 900px !important;
262
  margin: auto;
@@ -268,7 +260,6 @@ def build_ui():
268
  border: 1px solid #d1d5db !important;
269
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
270
  }
271
-
272
  button.primary {
273
  background-color: #4f46e5 !important;
274
  color: white !important;
@@ -277,11 +268,9 @@ def build_ui():
277
  font-weight: 600;
278
  transition: all 0.2s ease-in-out;
279
  }
280
-
281
  button.primary:hover {
282
  background-color: #4338ca !important;
283
  }
284
-
285
  button.secondary {
286
  background-color: #f3f4f6 !important;
287
  border-radius: 10px !important;
@@ -289,15 +278,12 @@ def build_ui():
289
  font-weight: 500;
290
  transition: all 0.2s ease-in-out;
291
  }
292
-
293
  button.secondary:hover {
294
  background-color: #e5e7eb !important;
295
  }
296
  """,
297
  ) as demo:
298
 
299
-
300
-
301
  # Chatbot area
302
  chatbot = gr.Chatbot(
303
  label="💠 OhamLab Conversation",
 
213
  with gr.Blocks(
214
  theme=gr.themes.Soft(primary_hue="indigo"),
215
  css="""
216
+ /* --- Hide share/delete icons --- */
217
+ #ohamlab .wrap.svelte-1lcyrj3 > div > div > button {
218
+ display: none !important;
219
+ }
220
+ [data-testid="share-btn"],
221
+ [data-testid="delete-btn"],
222
+ .message-controls,
223
+ .message-actions {
224
  display: none !important;
225
  visibility: hidden !important;
226
  }
227
 
228
+ /* --- User (Right) Message Bubble --- */
229
  #ohamlab .message.user {
230
  background-color: #4f46e5 !important;
231
  color: white !important;
 
233
  align-self: flex-end !important;
234
  text-align: right !important;
235
  margin-left: 25%;
 
 
236
  }
237
 
238
+ /* --- OhamLab (Left) Message Bubble --- */
239
  #ohamlab .message.assistant {
240
  background-color: #f8f9fa !important;
241
  color: #111 !important;
 
243
  align-self: flex-start !important;
244
  text-align: left !important;
245
  margin-right: 25%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
  }
247
+ #ohamlab .chatbot .wrap.svelte-1lcyrj3 > div > div > button {
248
+ display: none !important; /* hide share/delete icons */
249
+ }
250
 
251
+ /* --- Overall Container --- */
252
  .gradio-container {
253
  max-width: 900px !important;
254
  margin: auto;
 
260
  border: 1px solid #d1d5db !important;
261
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
262
  }
 
263
  button.primary {
264
  background-color: #4f46e5 !important;
265
  color: white !important;
 
268
  font-weight: 600;
269
  transition: all 0.2s ease-in-out;
270
  }
 
271
  button.primary:hover {
272
  background-color: #4338ca !important;
273
  }
 
274
  button.secondary {
275
  background-color: #f3f4f6 !important;
276
  border-radius: 10px !important;
 
278
  font-weight: 500;
279
  transition: all 0.2s ease-in-out;
280
  }
 
281
  button.secondary:hover {
282
  background-color: #e5e7eb !important;
283
  }
284
  """,
285
  ) as demo:
286
 
 
 
287
  # Chatbot area
288
  chatbot = gr.Chatbot(
289
  label="💠 OhamLab Conversation",