Skip to content

Refine download CSV headers and preview UI - #6558

Open
pablonoel wants to merge 8 commits into
datacommonsorg:masterfrom
pablonoel:download_tool-table
Open

Refine download CSV headers and preview UI#6558
pablonoel wants to merge 8 commits into
datacommonsorg:masterfrom
pablonoel:download_tool-table

Conversation

@pablonoel

@pablonoel pablonoel commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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.

localhost_8080_tools_download(Laptop SM) localhost_8080_tools_download(Laptop SM) (1)

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.
@pablonoel
pablonoel requested a review from nick-nlb August 3, 2026 22:43
@pablonoel pablonoel self-assigned this Aug 3, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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

  • CSV Header Updates: Renamed internal CSV header constants to more user-friendly labels to align with the new download tool requirements.
  • UI/UX Improvements: Simplified the page layout by removing redundant wrappers and integrated the Preview component directly.
  • Preview Component Refinement: Enhanced the Preview component with responsive design, improved stat-var title placement, and added comprehensive table styling for better readability.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread server/routes/shared_api/csv.py Outdated
Comment thread static/js/tools/download/preview.tsx
Comment thread static/js/tools/download/preview.tsx Outdated
Comment thread static/js/tools/download/preview.tsx Outdated
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.
@pablonoel
pablonoel marked this pull request as ready for review August 3, 2026 23:08
Comment thread server/routes/shared_api/csv.py Outdated
Comment thread server/routes/shared_api/csv.py
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants