Skip to content

Download tool#6411

Draft
pablonoel wants to merge 6 commits into
datacommonsorg:masterfrom
pablonoel:download-tool
Draft

Download tool#6411
pablonoel wants to merge 6 commits into
datacommonsorg:masterfrom
pablonoel:download-tool

Conversation

@pablonoel

@pablonoel pablonoel commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This PR address the Download Tool refactor, it includes fixing the Facet selector and streamline the interface.

  • Complete download page.tsx refactor
  • Move state elements into contex.tsx ( as per maps / scatter tools use )
  • Add Theme / App wrapper
  • Remove Date
  • Fix Facet selector
  • Refactor URL/Path handling
  • Remove Preview button, implement auto-preview
localhost_8080_tools_download(Laptop XS) (2) localhost_8080_tools_download(Laptop XS) (1) localhost_8080_tools_download(Laptop XS)

Things to consider:

  • Download tool uses its own EnclosedPlacesSelector and FacetSelector, we should consider that to be shared among the rest of the tools.
  • There might be space for further refactor of the loadStateFromURL and some other elements
  • There is no current change on the html/styles structure, that will be implemented separately

- Separate the UI Logic
- Add page (app) provider with theme
- Move state elements into contex.tsx ( as per maps / scatter tools use )
- Remove data range, defaulting to DATE_ALL, updating the validation/url params.
- Update facet fetching
- Add pill examples
- Remove info_places references an info
- Refactor stat_var_chooser access
- Add download to shared vis tool components
- Add redirects to allow pill link construction
- Refactor dowload flash template
- Removes preview button, content reloads when a varStat is selected
- Refactor messages and filters logics
- Fix url based loader for pills
- Reset content when options are emptied
@pablonoel pablonoel requested a review from nick-nlb June 25, 2026 19:52
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the summary. You can try again by commenting /gemini summary.

@pablonoel

Copy link
Copy Markdown
Contributor Author

@nick-nlb ready for review, let me know if you need more context.

@nick-nlb nick-nlb 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.

Thank you Pablo for all of this!

There are some inline comments, but I'll put a couple of behavioral notes here.

Mismatch of responsive breakpoints.

  • View in a wide desktop view
  • Select a location (say “United States”)
  • Select a breakdown (say “State”)
  • You will see “Pick a statistical variable in the left pane” as well as the statistical variable explorer on the left.
  • Slowly shrink the viewport
  • At a certain point, we flip into mobile/tablet, where the lefthand explorer disappears.
  • At this point, the message correctly switches to “Pick a statistical variable using the “select variable” button above.”
  • However, the button does not appear.
  • Shrink the viewport further, and the button will appear.

Facet Selector State state correspond with selected stat vars [I've suggested a fix in the comments]

  • Select “United States”
  • Select “State”
  • Select Health: Medical Condition: Diabetes: Percentage…”
  • You will see two facets (these are correct).
  • Now select Total Population
  • We expect 15 facets now be available (but we only see the two).
  • Refresh the page - you will see fifteen.

Comment thread static/js/i18n/i18n_tool_messages.ts
Comment thread static/js/tools/download/context.ts Outdated
Comment thread static/js/tools/download/page.tsx Outdated
Comment thread static/js/tools/download/page.tsx Outdated
Comment thread static/js/tools/download/page.tsx Outdated
Remove preview and validation state management from the download context since they are no longer used. This includes removing PreviewWrapper and ValidationWrapper interfaces, and their associated state from useInitialContext(). Also update loadStateFromURL to accept only the setOptions function instead of the entire context object, and destructure facet methods directly for cleaner code.
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