Skip to content

community: fix nation viewing community exchange (fixes #9054) - #10278

Open
Mutugiii wants to merge 1 commit into
masterfrom
claude/planet-issue-9054-qxr13a
Open

community: fix nation viewing community exchange (fixes #9054)#10278
Mutugiii wants to merge 1 commit into
masterfrom
claude/planet-issue-9054-qxr13a

Conversation

@Mutugiii

Copy link
Copy Markdown
Member

Fixes #9054

On /community/:code the 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.

  • Skips the tabChanged navigation to '' / /voices/:id when planetCode is set — those are the local planet's routes, so the first tab click bounced back to the nation's own exchange
  • Binds [useReplyRoutes]="!planetCode" in community.component.html so opening replies filters in place instead of navigating to the nation's /voices/:id
  • Hides the Communities tab when planetCode is set — community-list.component.ts lists the local planet's children, so it rendered the nation's child list under the community
  • Hides New Voice and Add Link / Remove Links when planetCode is 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 appeared
  • Matches the calendar tab via MatTabChangeEvent.tab instead of the hardcoded index === 5, which points at a different tab once the tab set changes
  • Falls back when no communityregistrationrequests doc matches the code, instead of leaving configuration undefined and breaking the whole view
  • Makes the View Exchange link absolute, matching the sibling View Report link, and adds takeUntil(onDestroy$) to the community data and configuration subscriptions

Verified with npm run lint and npm run build; no CouchDB instance was available to click through the flow.


Generated by Claude Code

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
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Mutugiii, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Repository UI

Review profile: QUIET

Plan: Pro Plus

Run ID: 6cf5837b-b1d2-4167-9535-f3a6515bba06

📥 Commits

Reviewing files that changed from the base of the PR and between 6c3ea09 and 5e2d91e.

📒 Files selected for processing (3)
  • src/app/community/community-list.component.html
  • src/app/community/community.component.html
  • src/app/community/community.component.ts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Mutugiii Mutugiii added the WIP label Aug 12, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +586 to 592
if (!this.planetCode) {
if (index === 0) {
this.router.navigate([ this.lastReplyId ? `/voices/${this.lastReplyId}` : '' ]);
} else {
this.router.navigate([ '' ]);
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

community: nation unable to view community exchange

2 participants