Repository navigation
Keep list reloads in the same view branch as loaded data - #107
Merged
Merged
Conversation
List screens drew "reloading with data on screen" in its own switch branch, separate from .hasData. SwiftUI then rebuilds the list on every reload and re-runs its .task. MyTurnTagCreator hit this as a reload loop after it began reloading the shops on each tag change; nothing in the template reloads that way yet, so this removes the trap. List screens now switch on DataState.listContent(isEmpty:). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LDCmJWEL2WvoVE4ThKsR2a
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.
Ports the structural part of MyTurnTagCreator-iOS#164.
Why
List screens drew "reloading with data on screen" (
.loading, not empty) in its ownswitchbranch, separate from.hasData. SwiftUI treats them as different views, so each reload rebuilds the list, re-registers itsnavigationDestinationand re-runs its.task. In MyTurnTagCreator 2.1.0 that, together with a reload of the shops after each tag change, became a loop ofGET /shops(~2/s) that hit the API's per-IP rate limit. Nothing in this template reloads that way today, so there is no live bug; this removes the trap before a future change springs it.Change
DataState.listContent(isEmpty:)maps a state to.loading/.list/.failed; a reload with data is.list. Screens: Shops, number tags.Verification
DataStateListContentTest(4 tests); breaking the.loadingmapping makesreloadingWithDataKeepsTheListfail.make lint: SwiftLint 0 violations, SwiftFormat 0 files to format.🤖 Generated with Claude Code
https://claude.ai/code/session_01LDCmJWEL2WvoVE4ThKsR2a