Skip to content

Add loading progress bar for time series fetch (#26)#50

Open
aivanchenk wants to merge 4 commits into
ui-reworkfrom
26-progress-bar
Open

Add loading progress bar for time series fetch (#26)#50
aivanchenk wants to merge 4 commits into
ui-reworkfrom
26-progress-bar

Conversation

@aivanchenk

@aivanchenk aivanchenk commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Implements the loading progress bar from #26, and reworks the map's left panel per review feedback.

Progress bar (#26)

  • Real byte-level download percentage: a custom fetch on the zarr store streams each chunk response and reports loaded / total bytes, so the bar ramps smoothly and shows a percent plus a MB readout.
  • Falls back to an animated indeterminate bar when a response has no Content-Length, and never blocks the fetch.
  • Reusable ProgressBar component (determinate or indeterminate) with a prefers-reduced-motion fallback.

Left-panel rework

  • Flat inspector instead of three stacked cards: the clicked coordinate leads, the history control sits above the daily-mean chart (grouped, no divider between them), grid cell and array index drop to a quiet row.
  • Vertically centered, inviting empty state before a point is picked.

Verify

  • eslint, next build, and vitest (44 tests) all pass.
  • Verified against the live store that the percentage passes through intermediate values and ends at 100%, with real data returned.

Base is ui-rework because this builds on the time series feature from #47. Note: since the base is not the default branch, Closes #26 will not auto-close the issue on merge, so it can be closed manually once this lands.

Closes #26.

Introduce a reusable ProgressBar (src/components/ui/ProgressBar.tsx) and
show it in the sidebar readout while a pixel time series is downloading.

It runs in indeterminate mode: the pixel fetch is a single slice request
with no per-chunk hook and no known total, so an honest percentage is not
available without a byte-streaming store wrapper. The bar therefore shows
real activity via a sweeping accent segment rather than a fabricated
percent. The component already accepts a `value` prop, so a determinate
mode can be wired later if we add that wrapper.

Styling uses the editor/accent design tokens with a reduced-motion
fallback. Closes #26 once merged.

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

Copy link
Copy Markdown

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 introduces a new ProgressBar component that supports both determinate and indeterminate states, along with the necessary CSS animations and a media query for reduced motion. The progress bar is integrated into the MapReadout component to display during time series loading. The review feedback focuses on improving the accessibility, reusability, and robustness of the new ProgressBar component (such as avoiding aria-busy, extending standard HTML attributes, and handling NaN values), as well as preventing redundant screen reader announcements in MapReadout by hiding the visual progress bar using aria-hidden="true".

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/components/ui/ProgressBar.tsx Outdated
Comment thread src/components/map/MapReadout.tsx Outdated
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

🚀 Vercel preview deployed

Preview URL: https://earth-prints-4eqqthh8d-anastasiia-s-projects10.vercel.app

Anastasiia Ivanchenko added 2 commits July 6, 2026 23:33
Redesign the sidebar readout away from three stacked bordered cards into
one continuous inspector split by hairline rules:
- The clicked coordinate leads, the daily-mean chart is the hero, grid
  cell and array index drop to a quiet two-up row, history control sits
  at the foot.
- Inviting empty state before a point is picked.

Replace the indeterminate loader with a determinate percentage. The
reader now fetches the pixel series one time-chunk at a time in parallel
and reports completed-of-total as each chunk arrives, so the bar shows a
real "n of N chunks · X%". Segments are stitched back in chunk order, so
the values are identical to the previous single-slice fetch and the same
bytes are downloaded. Falls back to the animated bar until the first
count arrives.

The chart skeleton becomes a decorative axis frame so the percentage is
the single loading status.
Address panel feedback:
- Move the history-window control above the chart, and group it with the
  chart so there is no divider between them.
- Vertically center the empty "Click the map" state.
- The percentage was stuck at 0 because the default window is a single
  time-chunk, so chunk-counting only ever read 0 of 1. Progress is now
  byte-level: a custom fetch on the zarr store streams each chunk
  response and reports loaded/total bytes, so the bar ramps smoothly and
  shows a real percent plus a MB readout. If a response has no
  Content-Length it falls back to the animated bar, never blocking the
  fetch. Verified against the live store that the percent passes through
  intermediate values and ends at 100%.

This reverts the earlier per-time-chunk fetch back to the single-slice
pixel fetch, since byte progress no longer needs it.
@aivanchenk aivanchenk marked this pull request as ready for review July 7, 2026 04:54
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.

1 participant