fix(nav): register HashtagFeedRoute on every tab's navigation stack#401
Open
dmnyc wants to merge 1 commit into
Open
fix(nav): register HashtagFeedRoute on every tab's navigation stack#401dmnyc wants to merge 1 commit into
dmnyc wants to merge 1 commit into
Conversation
Tapping a hashtag (e.g. #foodstr) in a note viewed outside the Home feed — inside a thread opened from Search or Notifications, or on a profile reached from those tabs — pushed a HashtagFeedRoute onto a stack that had no matching .navigationDestination, so SwiftUI rendered its built-in "no destination" placeholder: a blank screen with a yellow warning icon. Only the Home feed stack registered the destination. Register it on the Search, Notifications, and placeholder stacks too, parameterize hashtagFeedView(for:path:) by the destination path so nested hashtag taps push onto the correct stack, and wire the previously no-op ProfileView onHashtagTap closures on those stacks. Fixes #400. Supersedes #365 and #259 (same missing-destination root cause).
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
Tapping a hashtag (e.g.⚠️ warning icon and no explanation.
#foodstr) in a note viewed outside the Home feed — inside a thread opened from Search or Notifications, or on a profile reached from those tabs — navigated to a blank screen with only a yellowRoot cause
HashtagFeedRoute's.navigationDestination(for:)was registered on only the Home feed tab's stack ($feedPath).ThreadView.push(_:)appends routes to whicheverpathbinding it was handed, so a thread opened from Search hands it$searchPath; tapping a hashtag there pushed aHashtagFeedRouteonto a stack with no matching destination → SwiftUI's built-in "no destination registered" placeholder (the blank view + yellow triangle).Compounding it,
ProfileView'sonHashtagTapwas a no-op{ _ in }on the Search and Notifications stacks and unset on the placeholder stack, so hashtag taps on profiles in those tabs silently did nothing.Fix
.navigationDestination(for: HashtagFeedRoute.self)on the Search, Notifications, and placeholder stacks.hashtagFeedView(for:path:)by the destination path so a nested hashtag tap (a#taginside a hashtag feed) pushes onto the correct stack instead of always$feedPath.onHashtagTapclosures on those stacks' ProfileViews.DMs don't route hashtags (separate known issue #329), so they're unaffected.
Fixes / supersedes
Test plan
#foodstrin a note within a thread opened from Search / Notifications opens the hashtag feed (verified)