community: fix nation viewing community exchange (fixes #9054) - #10278
community: fix nation viewing community exchange (fixes #9054)#10278Mutugiii wants to merge 1 commit into
Conversation
Viewing a child community's exchange from a nation (/community/:code) was broken in several ways: - Switching tabs called router.navigate([''])/['/voices/:id'], which are the routes of the planet the user is on, so the first tab click redirected back to the nation's own exchange. Skip that navigation when viewing another planet. - Voices used reply routes unconditionally, so opening replies navigated to the nation's /voices/:id instead of staying on the community's exchange. Filter replies in place when viewing another planet. - The Communities tab lists the local planet's children, so on a community's exchange it rendered the nation's child list under the community. Hide it when a planet code is present. - New Voice and Add/Remove Links wrote to the local planet's own documents while displaying the viewed planet's data, so the change never appeared. Hide them, matching the existing description buttons. - The calendar resize used a hardcoded tab index, which points at a different tab when the tab set changes; compare against the calendar tab instead. - Guard against a missing community registration doc leaving configuration undefined, which broke rendering of the whole view, and tear down the community data and configuration subscriptions on destroy. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T7XmWVVH1urqkJw1XrHap2
|
Warning Review limit reached
Next review available in: 23 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: QUIET Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e2d91ec2a
ℹ️ 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".
| if (!this.planetCode) { | ||
| if (index === 0) { | ||
| this.router.navigate([ this.lastReplyId ? `/voices/${this.lastReplyId}` : '' ]); | ||
| } else { | ||
| this.router.navigate([ '' ]); | ||
| } | ||
| } |
There was a problem hiding this comment.
Restore remote replies when returning to Voices
When viewing /community/:code, opening a reply and switching to another tab stores lastReplyId, but this branch skips the only restoration logic. Since the tab group does not enable preserveContent, Angular Material detaches and destroys the off-screen news list; returning to Our Voices recreates it at the root conversation instead of the reply the user was viewing. Preserve the tab content or explicitly restore lastReplyId for remote exchanges.
Useful? React with 👍 / 👎.
Fixes #9054
On
/community/:codethe component still assumed the user was on their own planet, so a nation viewing a child community's exchange was redirected away and shown the wrong data.tabChangednavigation to''//voices/:idwhenplanetCodeis set — those are the local planet's routes, so the first tab click bounced back to the nation's own exchange[useReplyRoutes]="!planetCode"incommunity.component.htmlso opening replies filters in place instead of navigating to the nation's/voices/:idCommunitiestab whenplanetCodeis set —community-list.component.tslists the local planet's children, so it rendered the nation's child list under the communityNew VoiceandAdd Link/Remove LinkswhenplanetCodeis set, matching the existing description buttons — both wrote to the local planet's docs while showing the viewed planet's data, so the change never appearedMatTabChangeEvent.tabinstead of the hardcodedindex === 5, which points at a different tab once the tab set changescommunityregistrationrequestsdoc matches the code, instead of leavingconfigurationundefined and breaking the whole viewView Exchangelink absolute, matching the siblingView Reportlink, and addstakeUntil(onDestroy$)to the community data and configuration subscriptionsVerified with
npm run lintandnpm run build; no CouchDB instance was available to click through the flow.Generated by Claude Code