Crocolil Claude Sonnet 4.6 commited on
Commit
5e0ac66
Β·
1 Parent(s): c385ccd

Visual polish: show forecast table column headers, restyle Link Neighbours button, move assistant panel under forecast

Browse files
Files changed (2) hide show
  1. app.py +12 -11
  2. static/style.css +58 -1
app.py CHANGED
@@ -623,17 +623,6 @@ with gr.Blocks(title="🌿 Plant Watering Planner") as app:
623
  return_btn = gr.Button("πŸ”™ Back to gallery")
624
  action_status = gr.Markdown()
625
 
626
- # Ask-the-assistant panel β€” hidden until a plant is selected
627
- with gr.Group(visible=False) as advisor_panel:
628
- advisor_question = gr.Textbox(label="Ask about this plant πŸ§‘β€πŸŒΎ", placeholder="e.g. Why are the leaves turning yellow?")
629
- advisor_ask_btn = gr.Button("πŸ€– Ask the assistant")
630
- advisor_answer = gr.Markdown()
631
-
632
- gr.Markdown("---")
633
- health_upload = gr.Image(type="pil", label="πŸ“· Upload a photo to check this plant's health", elem_id="health-upload")
634
- health_btn = gr.Button("🩺 Diagnose health")
635
- health_result = gr.Markdown()
636
-
637
  # ── Sidebar: watering recommendations + forecast ────────────────────
638
  with gr.Column(scale=2, elem_id="sidebar"):
639
  gr.Markdown("### πŸ’§ Watering today")
@@ -659,6 +648,18 @@ with gr.Blocks(title="🌿 Plant Watering Planner") as app:
659
  city_input = gr.Textbox(label="City", value=WEATHER_CITY, placeholder="e.g. Paris")
660
  forecast_btn = gr.Button("πŸ” Get forecast", variant="primary")
661
 
 
 
 
 
 
 
 
 
 
 
 
 
662
  # ── Events ────────────────────────────────────────────────────────────────
663
  # Track which plant is selected (index stored in State)
664
  selected_idx = gr.State(value=None)
 
623
  return_btn = gr.Button("πŸ”™ Back to gallery")
624
  action_status = gr.Markdown()
625
 
 
 
 
 
 
 
 
 
 
 
 
626
  # ── Sidebar: watering recommendations + forecast ────────────────────
627
  with gr.Column(scale=2, elem_id="sidebar"):
628
  gr.Markdown("### πŸ’§ Watering today")
 
648
  city_input = gr.Textbox(label="City", value=WEATHER_CITY, placeholder="e.g. Paris")
649
  forecast_btn = gr.Button("πŸ” Get forecast", variant="primary")
650
 
651
+ # Ask-the-assistant panel β€” hidden until a plant is selected
652
+ with gr.Group(visible=False) as advisor_panel:
653
+ gr.Markdown("### πŸ€– Plant assistant")
654
+ advisor_question = gr.Textbox(label="Ask about this plant πŸ§‘β€πŸŒΎ", placeholder="e.g. Why are the leaves turning yellow?")
655
+ advisor_ask_btn = gr.Button("πŸ€– Ask the assistant")
656
+ advisor_answer = gr.Markdown()
657
+
658
+ gr.Markdown("---")
659
+ health_upload = gr.Image(type="pil", label="πŸ“· Upload a photo to check this plant's health", elem_id="health-upload")
660
+ health_btn = gr.Button("🩺 Diagnose health")
661
+ health_result = gr.Markdown()
662
+
663
  # ── Events ────────────────────────────────────────────────────────────────
664
  # Track which plant is selected (index stored in State)
665
  selected_idx = gr.State(value=None)
static/style.css CHANGED
@@ -214,10 +214,25 @@ footer {
214
  }
215
 
216
  /* "Relier des plantes" toggle button */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
  #link-mode-btn.link-mode-active {
218
  background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%) !important;
219
  color: #ffffff !important;
220
  border-color: transparent !important;
 
221
  }
222
 
223
  .garden-sprite img {
@@ -283,7 +298,49 @@ footer {
283
  background: transparent !important;
284
  }
285
 
286
- #watering-cards .header-table thead, #forecast-strip .header-table thead {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  display: none;
288
  }
289
 
 
214
  }
215
 
216
  /* "Relier des plantes" toggle button */
217
+ #link-mode-btn {
218
+ border-radius: 999px !important;
219
+ padding: 0.45rem 1.25rem !important;
220
+ background: #ffffff !important;
221
+ border: 1.5px solid #cfe8cf !important;
222
+ color: #3f5b3f !important;
223
+ box-shadow: 0 2px 8px rgba(76, 175, 80, 0.10);
224
+ }
225
+
226
+ #link-mode-btn:hover {
227
+ background: #f3f9f1 !important;
228
+ border-color: #81c784 !important;
229
+ }
230
+
231
  #link-mode-btn.link-mode-active {
232
  background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%) !important;
233
  color: #ffffff !important;
234
  border-color: transparent !important;
235
+ box-shadow: 0 3px 10px rgba(67, 160, 71, 0.25);
236
  }
237
 
238
  .garden-sprite img {
 
298
  background: transparent !important;
299
  }
300
 
301
+ #watering-cards .header-table thead {
302
+ display: none;
303
+ }
304
+
305
+ /* Forecast table: show the column titles as a styled label row above the cards */
306
+ #forecast-strip .header-table {
307
+ display: block;
308
+ width: 100% !important;
309
+ margin-bottom: 6px;
310
+ }
311
+
312
+ #forecast-strip .header-table thead {
313
+ display: block;
314
+ }
315
+
316
+ #forecast-strip .header-table thead tr {
317
+ display: flex;
318
+ width: 100%;
319
+ gap: 6px;
320
+ }
321
+
322
+ #forecast-strip .header-table tbody {
323
+ display: none;
324
+ }
325
+
326
+ #forecast-strip .header-cell {
327
+ border: none !important;
328
+ background: #e3efe0 !important;
329
+ border-radius: 10px !important;
330
+ flex: 1 1 0% !important;
331
+ width: auto !important;
332
+ min-width: 0 !important;
333
+ }
334
+
335
+ #forecast-strip .header-cell .header-content span {
336
+ font-size: 0.7rem;
337
+ font-weight: 700;
338
+ color: #2e7d32;
339
+ text-transform: uppercase;
340
+ letter-spacing: 0.02em;
341
+ }
342
+
343
+ #forecast-strip .header-cell .cell-menu-button {
344
  display: none;
345
  }
346