Spaces:
Running
Running
|
Download ORIGINAL_REQUEST.md from climateexploer/imgw: direct link, hf CLI and curl.
- Browser
- Download file 5.15 kB
-
https://huggingface.co/spaces/climateexploer/imgw/resolve/main/ORIGINAL_REQUEST.md
- Command line
-
hf download hf://spaces/climateexploer/imgw/ORIGINAL_REQUEST.md
-
curl -L -o ORIGINAL_REQUEST.md https://huggingface.co/spaces/climateexploer/imgw/resolve/main/ORIGINAL_REQUEST.md
5.15 kB
Original User Request
Initial Request — 2026-09-19T16:23:52Z
This is a single self-contained fix; keep it small and focused. Implement station deselection and symmetric tab jumping behavior in the IMGW Climate Explorer Shiny application, replicating the behavior from the HungaroMet reference implementation.
Working directory: /Users/alexandrudumitrescu/Documents/clima/2026/imgw Integrity mode: demo
Reference Resources
- Reference implementation:
/Users/alexandrudumitrescu/Documents/clima/2026/hungaromet(notablysections/server_hungaromet.Rlines 234–300,sections/ui_hungaromet.R,www/app.js, andtests/stress_test_m2_m3_challenger_1_gen2.R). - Target codebase:
/Users/alexandrudumitrescu/Documents/clima/2026/imgw(server.R,ui.R,www/app.js,www/styles.css).
Requirements
R1. Symmetric Tab Navigation & Jumping
- Selecting a station (via map point click, dropdown search, or station table double-click) must select the station and switch the active navigation tab to the Dashboard (
bslib::nav_select("main_nav", "Dashboard")). - Deselecting a station while actively on the Dashboard tab must switch the navigation tab back to Map View (
bslib::nav_select("main_nav", "Map View")). - Deselection triggered by dataset or temporal resolution changes must support silent clearing (
jump_to_map = FALSE), keeping the current view intact.
R2. Centralized Deselection State & Map Reset
- Implement a centralized
clear_station_selection(jump_to_map = TRUE)handler inserver.Rthat:- Clears
current_station_uid(NULL)and resets station fetch error state. - Resets the station search/dropdown input to empty / "All".
- Removes the MapLibre highlighted selection layer (
clear_layer("selected-highlight")). - Smoothly resets map viewport bounds back to Poland overview extent (
c(14.1, 49.0, 24.1, 54.9)or centerc(19.1451, 51.9194), zoom 5.5). - Navigates from Dashboard to Map View if
jump_to_map = TRUE.
- Clears
R3. Interactive Deselection Affordances
- Map Floating Chip: Display a floating chip badge on the Map View when a station is selected, showing station name, ID, elevation, and an interactive "Deselect Esc" button (
clear_station_chip). - Sidebar Deselect Button: Display an action button in the sidebar (
clear_station_sidebar) whenever a station is selected. - Global Esc Shortcut: Listen for
Escape/Esckeydown inwww/app.jsduring the capture phase, closing any open MapLibre popups, blurring active focus, and signalingesc_clear_stationto Shiny. Guard against triggering if loading overlay is active or a modal dialog is open. - Home Button Reset: Ensure clicking the map Home button (
zoom_home) invokesclear_station_selection(). - Dropdown Reset: Clearing the station dropdown or selecting "All" invokes
clear_station_selection(jump_to_map = TRUE).
R4. Automated Verification Test Suite
- Provide an automated test script (
tests/test_deselection_and_jumping.R) usingshiny::testServerthat tests:- Station selection switches
main_navto "Dashboard". clear_station_sidebarclears selection and switchesmain_navback to "Map View".clear_station_chipclears selection and switchesmain_navback to "Map View".esc_clear_stationclears selection and switchesmain_navback to "Map View".- Selecting "All" or empty on
station_selectorclears selection and switchesmain_navback to "Map View". zoom_homeclears selection.- Inactive /
jump_to_map = FALSEclears selection without modifyingmain_nav. - Syntax and server load checks (
Rscript test_server_load.R) succeed without warnings or errors.
- Station selection switches
Acceptance Criteria
Tab Jumping & Selection
- Selecting a station from map click, table double-click, or dropdown updates
current_station_uidand setsinput$main_navto "Dashboard". - Deselecting an active station while
input$main_nav == "Dashboard"setsinput$main_navto "Map View". - Deselecting when
jump_to_map = FALSEdoes not changeinput$main_nav.
Deselection UI & Interactions
- A floating chip (
station_chip_ui) appears over the Map View whenever a station is active and disappears when deselected. - Clicking the chip's Deselect button triggers
clear_station_selection(jump_to_map = TRUE). - Sidebar displays a "Deselect Station (Esc)" button when a station is active, and clicking it triggers deselection.
- Pressing
Escanywhere in the app triggersesc_clear_stationwithout interfering with modals or the freeze overlay. - Clicking the Home button (
zoom_home) clears the station selection and resets map bounds. - Changing
station_selectorto empty / "All" clears the station selection.
Code Quality & Docker Sync
- No
logical(0)errors in reactive conditionals (adhering to user rules:!is.null(...) && length(...) > 0). - Any newly introduced dependencies are checked against
Dockerfile. - The automated test suite (
Rscript tests/test_deselection_and_jumping.R) runs to completion with exit code 0 and all assertions passing.