fix: re-fetch route list after closing direct-link route view#594
Open
sshane wants to merge 2 commits into
Open
fix: re-fetch route list after closing direct-link route view#594sshane wants to merge 2 commits into
sshane wants to merge 2 commits into
Conversation
Visiting /dongleId/log_id directly takes a fast path that fetches just that one route via the segmentRange filter. The fetch then dispatched ACTION_ROUTES_METADATA with the full filter range as the covered range, so hasRoutesData reported true even though only one route had been loaded. Clicking X to close back to the dashboard left the user looking at a one-route list, since DriveList's checkRoutesData visibility hook saw cached metadata and didn't re-fetch. Mark the metadata range as null when the fetch was segment-scoped, so the next checkRoutesData (fired by DriveList becoming visible) fills in the full filter range. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Welcome to connect! Make sure to:
deployed preview: https://594.connect-d5y.pages.dev |
VisibilityHandler in DriveList only triggers onVisible from visibilitychange/focus/blur events, not on mount. When the user clicks X to close a route view, the dashboard remounts but no fetch runs — the metadata fix from the previous commit is necessary but not sufficient on its own. Pass onInit so the handler fires once on mount; minInterval=60 still gates subsequent visibility events. checkRoutesData's own hasRoutesData check prevents redundant fetches when the cache is already valid. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When you visit `/dongleId/log_id` directly (no back history) and then click X to close, the dashboard shows only that one route until you refresh.
`checkRoutesData` takes a fast path when `state.segmentRange` is set, fetching only the targeted route. But it then dispatched `ACTION_ROUTES_METADATA` with `start`/`end` equal to the full filter range, so `hasRoutesData` returned true on the next check. `DriveList`'s visibility hook saw cached metadata and didn't refetch.
Pass `null` start/end when the fetch was segment-scoped. `hasRoutesData` then returns false, and the next `checkRoutesData` (fired by `DriveList` becoming visible after close) fills in the full filter range.
Test plan
🤖 Generated with Claude Code