Skip to content

fix: only show unlisted project chip when it's the main project#4690

Draft
SylvainChevalier wants to merge 1 commit into
mainfrom
claude/issue-4687-only-show-unlisted-project-chip
Draft

fix: only show unlisted project chip when it's the main project#4690
SylvainChevalier wants to merge 1 commit into
mainfrom
claude/issue-4687-only-show-unlisted-project-chip

Conversation

@SylvainChevalier
Copy link
Copy Markdown
Contributor

Closes #4687

Summary

Hides unlisted project chips in the question page sidebar when the unlisted project is a secondary project. Unlisted projects are still shown when they are the question's main (default) project.

Implementation

Added a filter in sidebar_question_projects.tsx that drops any project with visibility === ProjectVisibility.Unlisted unless its id matches default_project.id.

Generated with Claude Code

Closes #4687

Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a3982215-0c89-4644-be70-4efa36f9a49e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-4687-only-show-unlisted-project-chip

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

🚀 Preview Environment

Your preview environment is ready!

Resource Details
🌐 Preview URL https://metaculus-pr-4690-claude-issue-4687-only-show-un-preview.mtcl.cc
📦 Docker Image ghcr.io/metaculus/metaculus:claude-issue-4687-only-show-unlisted-project-chip-35a7b0f
🗄️ PostgreSQL NeonDB branch preview/pr-4690-claude-issue-4687-only-show-un
Redis Fly Redis mtc-redis-pr-4690-claude-issue-4687-only-show-un

Details

  • Commit: 35a7b0f05b4ac9816a72ceb0a812fc1cb7bd31e4
  • Branch: claude/issue-4687-only-show-unlisted-project-chip
  • Fly App: metaculus-pr-4690-claude-issue-4687-only-show-un

ℹ️ Preview Environment Info

Isolation:

  • PostgreSQL and Redis are fully isolated from production
  • Each PR gets its own database branch and Redis instance
  • Changes pushed to this PR will trigger a new deployment

Limitations:

  • Background workers and cron jobs are not deployed in preview environments
  • If you need to test background jobs, use Heroku staging environments

Cleanup:

  • This preview will be automatically destroyed when the PR is closed

@SylvainChevalier
Copy link
Copy Markdown
Contributor Author

@claude the unlisted project chips are still visible even when they're not the default project.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 15, 2026

Claude finished @SylvainChevalier's task in 7m 6s —— View job


Investigation

  • Read the modified file (sidebar_question_projects.tsx)
  • Trace the filter logic through to backend serializers
  • Reviewed ProjectVisibility enum (frontend "unlisted") and backend Visibility.UNLISTED = "unlisted" — values match
  • Confirmed TournamentShortSerializer and CommunitySerializer include visibility in their output

Analysis

The filter at sidebar_question_projects.tsx:44-49 reads:

.filter(
  (project) =>
    !("visibility" in project) ||
    project.visibility !== ProjectVisibility.Unlisted ||
    project.id === defaultProjectId
);

Equivalent to: filter OUT a project when has visibility AND is unlisted AND id !== default_project.id. By inspection this should correctly hide a non-default unlisted tournament/community chip. Categories and leaderboard tags have no visibility and are unaffected.

Before I push a code change, I want to make sure I understand what you're seeing — could you confirm one of these for me:

  1. Is it that the filter isn't running at all? e.g. you're on a preview where the latest commit hasn't deployed. The current preview image (...-35a7b0f) was built 10 days ago — please confirm you're testing https://metaculus-pr-4690-claude-issue-4687-only-show-un-preview.mtcl.cc or local with this branch.
  2. Or do you actually want unlisted chips hidden in all cases, including when the unlisted project is the default project? The current PR intentionally keeps the chip in that case (per the PR description), but if you want them always hidden, that's a one-line change (drop the project.id === defaultProjectId exception).
  3. Or is the chip you're seeing not a tournament/community/index — e.g. is it a category or leaderboard_tag tied to an unlisted project? Those types don't carry a visibility field, so the current filter can't hide them.

If you can paste the URL of a question where you observe the bug (and ideally which chip is still showing), I can dig into the specific data and push a targeted fix.
• Branch: claude/issue-4687-only-show-unlisted-project-chip

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only show unlisted project chip if it's the main project of the question

1 participant