Skip to content

Feat: イベント主催者・参加者のブラインド機能#305

Merged
sugiwe merged 7 commits intomainfrom
feature/blind-organizer-and-participants
Mar 20, 2026
Merged

Feat: イベント主催者・参加者のブラインド機能#305
sugiwe merged 7 commits intomainfrom
feature/blind-organizer-and-participants

Conversation

@sugiwe
Copy link
Contributor

@sugiwe sugiwe commented Mar 19, 2026

Summary

  • イベントの主催者名と参加者リストを非表示にできる「ブラインド機能」を実装
  • イベント参加判断を「誰が主催/参加するか」ではなく「イベント内容」で決められるようにする
  • チーム全体のデフォルト設定 + イベントごとの個別設定(3択:チーム設定に従う/表示/非表示)

主な変更内容

データベース

  • teamsテーブルにhide_organizer_by_default, hide_participants_by_defaultカラム追加
  • eventsテーブルにhide_organizer, hide_participantsカラム追加(nil = チーム設定に従う)

モデル

  • Event#organizer_visible_to?(membership) - 主催者表示判定メソッド
  • Event#participants_visible_to?(membership) - 参加者表示判定メソッド
  • 3値論理実装(nil → チーム設定、true → 非表示、false → 表示)

ビュー

  • チーム設定画面:デフォルトのブラインド設定追加
  • イベントフォーム:個別設定(3択ラジオボタン)追加
  • イベント詳細:権限に応じた表示制御
  • イベント一覧:ブラインド適用
  • マイページ:主催イベント・参加イベントで異なる表示ロジック

権限設定

  • 管理者:常に全情報表示 + 「(管理者権限で表示中)」注釈
  • 主催者:自分の名前 + 「(あなた)」表示、参加者はブラインド設定に従う
  • 一般メンバー:ブラインド設定に従う
  • 非表示時の表示:主催者「(非表示)」、参加者「非表示」または「参加者リストは非表示です」

テスト

  • モデルテスト:92件(全ての可視性パターンを網羅)
  • システムテスト:8件(E2E動作確認)
  • 全テスト通過、Rubocop警告なし

動作確認項目

  • チーム設定でデフォルトブラインド設定を変更できる
  • イベント作成時に個別設定を選択できる
  • 管理者には全情報 + 管理者権限表示が見える
  • 主催者には自分の名前 + 「あなた」が見える
  • 一般メンバーには非表示が適用される
  • マイページの主催イベント・参加イベントで適切に表示される
  • イベント一覧でもブラインドが適用される

🤖 Generated with Claude Code

sugiwe and others added 5 commits March 19, 2026 17:00
マイグレーション、モデル、フォームまで実装完了。
表示ロジックとテストは次のコミットで追加予定。

- マイグレーション: Team/Eventにブラインド設定カラム追加
- Event#organizer_visible_to?, #participants_visible_to? メソッド追加
- チーム設定画面にデフォルト設定を追加
- イベントフォームに個別設定(ラジオボタン)を追加
- コントローラーでパラメータ許可

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- 主催者表示: 非表示時は「(非表示)」、主催者本人には「(あなた)」表示
- 参加者数: 非表示時は定員のみ表示、満席時は「(満席)」表示
- 参加者リスト: 非表示時は「参加者リストは非表示です」メッセージ表示
- 管理者には常にすべて表示、主催者本人には自分の主催者ステータス表示

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- イベント一覧・マイページでのブラインド表示対応
- 管理者権限での表示時に注釈を追加
- Event#organizer_visible_to?のnil安全性を修正
- 包括的なモデルテストを追加(92テスト全てパス)

変更内容:
- イベント詳細:主催者・参加者に「(管理者権限で表示中)」注釈
- イベント一覧:ブラインド設定時は「非表示」と表示
- マイページ:主催イベントは「(あなた)」表示、参加イベントはブラインド設定に従う
- モデルテスト:チーム設定/イベント設定/権限による全パターンをカバー

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- イベント詳細ページでのブラインド表示テスト(8テスト)
- 管理者・主催者・一般メンバーの各視点での表示確認
- チーム設定のデフォルト設定変更テスト
- デフォルト設定が新規イベントに反映されることの確認

全テストパス(モデル92 + システム8 = 100テスト)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Capybara/NegationMatcherの自動修正
- RSpec/NestedGroupsの上限を5に設定

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

このプルリクエストは、イベントの主催者名と参加者リストの表示を柔軟に制御できる「ブラインド機能」を導入します。これにより、参加者が「誰が主催・参加するか」ではなく「イベント内容」に基づいて参加を判断できるようになります。チーム全体でデフォルト設定を管理しつつ、各イベントで個別に表示設定を上書きできるため、運用の柔軟性が向上します。管理者や主催者には特別な表示ルールが適用され、情報へのアクセス権限が適切に管理されます。

Highlights

  • ブラインド機能の実装: イベントの主催者名と参加者リストの表示を制御する「ブラインド機能」を実装しました。
  • 柔軟な設定オプション: チーム全体でのデフォルト設定と、イベントごとの個別設定(チーム設定に従う/表示/非表示)を導入し、柔軟な運用を可能にしました。
  • 権限に応じた表示制御: 管理者には常に全情報が表示され、主催者本人には自分の名前と「あなた」が表示されるなど、ユーザーの役割に応じた表示ロジックを適用しました。
  • データベーススキーマの更新: teamsテーブルにデフォルトのブラインド設定カラムを、eventsテーブルにイベントごとのブラインド設定カラムを追加しました。
  • モデルロジックの追加: Eventモデルにorganizer_visible_to?participants_visible_to?メソッドを追加し、表示判定ロジックをカプセル化しました。
  • UIの更新: チーム設定画面、イベントフォーム、イベント詳細、イベント一覧、マイページなど、関連するビューを更新し、ブラインド設定に応じた表示制御を行いました。
  • テストカバレッジの強化: モデルテスト92件、システムテスト8件を含む広範なテストを追加し、機能の正確性を検証しました。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new "blind" feature for events, allowing teams to control the visibility of event organizers and participant lists. The changes include adding new boolean columns to the teams and events tables for default team settings and per-event overrides, updating controllers to permit these new parameters, and modifying various view files to conditionally display organizer names and participant counts/lists based on these settings and the viewing user's role (admins and event organizers always see full details). Comprehensive model and system tests were added to validate the new visibility logic, alongside a minor Rubocop configuration update. A review comment suggests that when the participant list is hidden, the event capacity (currently still displayed) should also be concealed to fully align with the feature's stated goal of hiding all participant-related information.

Comment on lines +71 to +75
<% if event.full? %>
<%= capacity_text(event) %>(満席)
<% else %>
<%= capacity_text(event) %>
<% end %>

Choose a reason for hiding this comment

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

medium

参加者リストが非表示の場合、現在の実装では定員(capacity_text)が表示されます。PRの概要には「参加者リストと参加人数を非表示にします」と記載されているため、定員も「参加人数」の一部と見なされる可能性があります。もし定員も非表示にしたい場合は、この部分を「非表示」などのテキストに統一することを検討してください。

        非表示

- 参加者リストが非表示の場合、定員も非表示に
- 満席の場合のみ「満席」と表示(参加不可を明示)
- システムテストを追加して動作確認

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@sugiwe sugiwe self-assigned this Mar 20, 2026
イベント作成時に参加者ブラインド設定を明示的に「表示する」
に設定することで、定員が表示されることをテスト

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@sugiwe sugiwe merged commit 353a9d4 into main Mar 20, 2026
5 checks passed
@sugiwe sugiwe deleted the feature/blind-organizer-and-participants branch March 20, 2026 06:40
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.

1 participant