Add field compilation notes batch PDF#224
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03c248f9c4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const current = hydrographImagesRef.current | ||
| const ready = neededHydrographs.every( | ||
| (bundle) => | ||
| typeof current[bundle.well.id] === 'string' && | ||
| current[bundle.well.id].length > 0 |
There was a problem hiding this comment.
Refresh hydrograph cache before treating images as ready
If the user exports the same wells twice, this ready check can succeed on the previous run's PNGs before the new hidden HydrographPngExporter instances have rendered. setHydrographImagesByWellId only schedules a state update, while hydrographImagesRef.current still holds the old entries until a later effect runs, so a second export can silently reuse stale hydrographs after observations changed.
Useful? React with 👍 / 👎.
| if (ready || Date.now() - startedAt > 8000) { | ||
| resolve( | ||
| Object.fromEntries( | ||
| neededHydrographs.map((bundle) => [ | ||
| bundle.well.id, | ||
| current[bundle.well.id] ?? '', | ||
| ]) |
There was a problem hiding this comment.
Remove the fixed 8s hydrograph render cutoff
On slower browsers or larger batches, some off-screen hydrographs can take longer than eight seconds to render. This branch resolves anyway and substitutes '' for any chart that is still pending, so wells with valid groundwater data export a Hydrograph unavailable page with no warning instead of the actual graph.
Useful? React with 👍 / 👎.
ed0e8b3 to
4ae2e80
Compare
Summary
Testing