Refine download CSV headers and preview UI - #6558
Conversation
Rename tidy CSV header constants to friendlier labels (e.g. "ISO code", "Date", "Value") to match the new download tool. Simplify page layout by removing an extra wrapper and render Preview directly. Improve Preview: move stat-var titles into the preview header, make header/button responsive, adjust padding/gaps, and add table styling (responsive overflow, borders, font sizing, and cell padding) for better readability and UX.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the download tool's CSV output and user interface. It standardizes header naming conventions for better clarity and optimizes the preview layout to be more responsive and visually consistent, ensuring a smoother user experience across different screen sizes. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request simplifies the CSV header labels in the backend and refactors the download tool's preview UI by moving the selected statistical variables list directly into the Preview component, adding responsive styles, and styling the preview table. Feedback includes capitalizing 'url' to 'URL' in the CSV headers for consistency, fixing an invalid CSS property ('overflow-scroll;'), using optional chaining to prevent potential runtime errors when accessing variable titles, and avoiding 'display: inline-block' on the table element to prevent layout issues.
Rename CSV header from "Provenance url" to "Provenance URL". In the preview component, prevent a potential crash by using optional chaining when reading stat var titles, remove redundant container overflow rules, and adjust table layout to use max-width:100%, overflow-x:scroll and display:block for more predictable horizontal scrolling and layout.
Adds the 'Variable properties name' column to tidy CSV output (moves header position and removes a duplicate) and populates it in get_point_within_tidy_csv_rows and get_series_tidy_csv_rows. Updates the preview UI to hide selected columns from the on-screen preview (while keeping them in the downloaded CSV) and override the 'Unit display name' label to 'Unit' in the preview. Improves CSV completeness and makes the preview display clearer without altering downloaded content.
Map "Variable properties name" to "Name" in PREVIEW_COLUMN_LABELS and add a CSS rule to set min-width: 180px for the second table column to prevent truncation/layout issues.
Align tidy CSV output with the new download tool and update the preview UI. server/routes/shared_api/csv.py: reworked TIDY_CSV_HEADER_ROW ordering and adjusted get_point_within_tidy_csv_rows / get_series_tidy_csv_rows to emit rows in the new column order (Entity name, ISO code, Variable DCID, Variable name, Date, Value, Unit, ...). static/js/tools/download/preview.tsx: changed preview-hidden columns, removed preview label overrides, added dynamic wide-column handling for "Variable name" (min-width styling applied to header/cells/empty row) and general cleanup of preview rendering.
Rename tidy CSV header constants to friendlier labels (e.g. "ISO code", "Date", "Value") to match the new download tool. Simplify page layout by removing an extra wrapper and render Preview directly. Improve Preview: move stat-var titles into the preview header, make header/button responsive, adjust padding/gaps, and add table styling (responsive overflow, borders, font sizing, and cell padding) for better readability and UX.