Skip to content

Add option to promote subteams to Teams directory (#432)#187

Open
peterdrier wants to merge 2 commits intomainfrom
sprint/2026-04-08/batch-6
Open

Add option to promote subteams to Teams directory (#432)#187
peterdrier wants to merge 2 commits intomainfrom
sprint/2026-04-08/batch-6

Conversation

@peterdrier
Copy link
Copy Markdown
Owner

Summary

  • Adds IsPromotedToDirectory property to Team entity (default false)
  • Adds IsInDirectory computed property encapsulating visibility logic
  • Filters /Teams directory to show only top-level teams and promoted subteams
  • Adds "Show on Teams page" checkbox in team edit (visible for subteams only)
  • Includes EF migration for new column

Closes nobodies-collective#432

Test plan

  • /Teams shows only top-level teams by default (subteams no longer clutter directory)
  • Edit a subteam, check "Show on Teams page", save — subteam now appears on /Teams
  • Uncheck the flag — subteam disappears from /Teams
  • Top-level teams are unaffected (always appear)
  • Checkbox only visible when editing a subteam (not shown for top-level teams)
  • Unauthenticated /Teams view also respects the flag
  • All existing tests pass

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@peterdrier peterdrier closed this Apr 8, 2026
@peterdrier peterdrier reopened this Apr 8, 2026
@peterdrier peterdrier closed this Apr 9, 2026
@peterdrier peterdrier reopened this Apr 9, 2026
@peterdrier peterdrier force-pushed the sprint/2026-04-08/batch-6 branch from 77ac2eb to 38a1656 Compare April 9, 2026 16:30
@peterdrier peterdrier closed this Apr 9, 2026
@coolify-nuc-humans
Copy link
Copy Markdown

The preview deployment for humans-qa failed. 🔴

Open Build Logs | Open Application Logs

Last updated at: 2026-04-09 16:30:41 CET

@peterdrier peterdrier reopened this Apr 9, 2026
@coolify-nuc-humans
Copy link
Copy Markdown

coolify-nuc-humans bot commented Apr 9, 2026

The preview deployment for humans-qa is ready. 🟢

Open Preview | Open Build Logs | Open Application Logs

Last updated at: 2026-04-13 16:18:27 CET

Copy link
Copy Markdown
Owner Author

Release Review — Issues Found

  1. Anonymous /Teams still will not show promoted subteams. In src/Humans.Infrastructure/Services/TeamService.cs:211-216 the unauthenticated path keeps filtering on t.IsPublicPage, but UpdateTeamAsync forces IsPublicPage = false whenever ParentTeamId is set (src/Humans.Infrastructure/Services/TeamService.cs:535-538). That means a promoted subteam can appear for signed-in users via the authenticated path, but never for logged-out visitors, which contradicts the new flag's intended behavior and the PR test plan.

I would not release this to production until that public-path mismatch is fixed.

@peterdrier peterdrier force-pushed the sprint/2026-04-08/batch-6 branch from 38a1656 to 01cc542 Compare April 13, 2026 15:31
@github-actions github-actions bot added the db PR includes EF Core migration label Apr 13, 2026
peterdrier added a commit that referenced this pull request Apr 13, 2026
Subteams cannot have IsPublicPage (forced false in UpdateTeamAsync), so the
anon filter that required IsPublicPage excluded promoted subteams entirely.
Treat IsPromotedToDirectory as the subteam-equivalent opt-in, and let anon
visitors reach a promoted subteam's detail page so the directory link works.

Addresses review on PR #187.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@peterdrier
Copy link
Copy Markdown
Owner Author

Fixed in c4650f0.

Root cause: the anonymous directory filter required IsPublicPage, but UpdateTeamAsync forces IsPublicPage = false whenever ParentTeamId is set — so a promoted subteam could never appear for logged-out visitors.

Fix:

  • Anon /Teams filter now treats IsPromotedToDirectory as the subteam-side opt-in (top-level teams still need IsPublicPage).
  • GetTeamDetailAsync also allows anon access to a promoted subteam so the directory link doesn't 404.

Build + TeamServiceTests green.

peterdrier and others added 2 commits April 13, 2026 18:16
…e#432)

- Add IsPromotedToDirectory property to Team entity (default false)
- Add IsInDirectory computed property encapsulating visibility logic
- Filter /Teams directory to show only top-level teams and promoted subteams
- Add "Show on Teams page" checkbox in team edit (visible for subteams only)
- Include EF migration for new column
- Update feature docs and section invariants

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Subteams cannot have IsPublicPage (forced false in UpdateTeamAsync), so the
anon filter that required IsPublicPage excluded promoted subteams entirely.
Treat IsPromotedToDirectory as the subteam-equivalent opt-in, and let anon
visitors reach a promoted subteam's detail page so the directory link works.

Addresses review on PR #187.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@peterdrier peterdrier force-pushed the sprint/2026-04-08/batch-6 branch from c4650f0 to 46cba8e Compare April 13, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

db PR includes EF Core migration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to promote subteams to the Teams directory page

1 participant