Skip to content

Conversation

@rsmithlal
Copy link
Member

This pull request introduces significant improvements to the event invitation workflow, debugging guidelines, and UI enhancements for person selection. The main changes include a new searchable person selector in the frontend, expanded controller logic for inviting existing users, improved debugging documentation, and more robust handling of invitation notifications and authorization.

Event Invitation Workflow Improvements

  • Added an available_people endpoint to Events::InvitationsController to provide a filtered, searchable list of people eligible for invitation, excluding those already invited and those without email addresses. This endpoint supports search queries and returns results formatted for frontend consumption.
  • Updated invitation creation logic to support inviting existing users by ID, automatically populating email and locale from the selected person.
  • Improved invitation destruction and creation responses to support Turbo Streams, updating the UI dynamically and displaying flash messages. [1] [2]
  • Enhanced notification logic to distinguish between invitations for existing users (using in-app notifications) and invitations by email (using mailers).

Frontend Enhancements

  • Added a new Stimulus controller person_search_controller.js that replaces a standard select box with a live-search input for person selection, calling the new backend endpoint and updating the select based on user choice.
  • Added new invitation-related styles in invitations.scss and imported them in the main stylesheet. [1] [2]

Debugging and Development Guidelines

  • Updated documentation in .github/copilot-instructions.md and AGENTS.md to clarify that Rails console and runner should not be used for debugging. Instead, debugging should be performed through comprehensive tests and log analysis, with specific tips for using RSpec and temporary debug output. [1] [2] [3] [4]

Authorization and Notification Handling

  • Improved authorization logic in EventsController and ApplicationController, ensuring proper handling for unauthenticated users and integrating invitation token authorization and notification reading. [1] [2] [3]

- Implemented a new Stimulus controller for person search, allowing users to search and select people from a dropdown.
- Updated the invitations controller to handle person invitations by ID and added a new action to fetch available people.
- Created a new invitations.scss file for styling invitation-related components.
- Enhanced the event invitations mailer to include the inviter's name in the invitation email.
- Refactored event and event invitation models to support new invitation types and ensure uniqueness for event invitations.
- Updated views to include tabs for inviting members and inviting by email, along with a new table for displaying invitations.
- Improved localization for invitation-related texts in English, Spanish, and French.
- Added routes for fetching available people for invitations.
… handling

- Introduced InvitationTokenAuthorization concern for context-aware authorization.
- Updated EventsController to handle invitation tokens and mark notifications as read.
- Enhanced RegistrationsController to pre-fill user email from event invitations.
- Modified EventInvitationsMailer to read invitations from parameters.
- Added event invitation handling in policies for access control.
- Created views for invitation review and notifications.
- Updated Person model to associate with event invitations.
- Implement invitation type helpers to distinguish between person and email invitations.
- Create enhanced scopes for filtering existing user invitations and email invitations.
- Add URL generation for event invitations with locale and token handling.
- Enhance acceptance flow for event invitations, including attendance creation and community membership checks.
- Introduce validations to prevent duplicate invitations and ensure invitee presence.
- Update navigation item specs for consistency.
- Develop comprehensive request specs for the event invitation system, covering various scenarios including token processing, privacy handling, and invitation status display.
- Implement session management for invitation tokens, ensuring expired tokens are cleared.
- Seed test users for consistent test environment setup.
Copy link

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

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 suggestions.

Reply with @codex fix comments to fix any unresolved comments.

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, or 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 fix this CI failure" or "@codex address that feedback".

…solved correctly and marking scope authorization
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces significant improvements to the event invitation workflow, debugging guidelines, and UI enhancements for person selection. The main changes include a new searchable person selector in the frontend, expanded controller logic for inviting existing users, improved debugging documentation, and more robust handling of invitation notifications and authorization.

Key changes:

  • Enhanced event invitation system with dual pathways for existing users and external email recipients
  • Added searchable person selector using SlimSelect for improved UX
  • Updated debugging guidelines to discourage Rails console usage and promote comprehensive testing
  • Improved invitation token authorization and session management

Reviewed Changes

Copilot reviewed 158 out of 159 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
spec/ (multiple test files) Removed redundant RuboCop disable comments for ExampleLength across test files
spec/support/test_seed_helpers.rb Added helper to create test users for request specs
spec/support/automatic_test_configuration.rb Fixed membership model reference and improved session cleanup
app/controllers/better_together/events/invitations_controller.rb Added available_people endpoint and enhanced invitation creation logic
app/views/better_together/events/_invitations_panel.html.erb Enhanced invitation UI with tabs for person vs email invitations
app/javascript/controllers/better_together/slim_select_controller.js Fixed search parameter name from 'q' to 'search'
config/locales/ Added comprehensive translations for invitation features

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Robert Smith <[email protected]>
- Created sequence diagram for event access via invitation token.
- Added flowchart for event invitations process, detailing organizer and invitee interactions.
- Developed entity-relationship diagram for event invitations schema.
- Introduced end-user documentation on event invitations and RSVP processes.
- Updated documentation assessment with the latest date.
- Enhanced platform organizers' README with links to privacy and invitation tokens section.
- Expanded host management guide to include details on privacy settings and invitation tokens.
- Updated table of contents to include new sections on event invitations and RSVP management.
…olutions/community-engine-rails into enchance/event-invites
@rsmithlal rsmithlal merged commit bfbb04c into main Sep 8, 2025
12 checks passed
@rsmithlal rsmithlal deleted the enchance/event-invites branch September 8, 2025 17:27
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.

2 participants