Skip to content

Conversation

@piyush5050
Copy link

@piyush5050 piyush5050 commented Aug 27, 2025

Description

This PR implements an attendees index page with infinite scroll functionality, addressing issue #227. The implementation allows users to browse all public profiles of conference attendees with a smooth infinite loading experience.

Please let me know if there are any changes needed or if I've missed any guidelines or conventions. I'm happy to make adjustments based on your feedback!

Key features implemented:

  • Attendees index page accessible via bottom navigation "Attendees" replaces "Profile".
  • Infinite scroll using Turbo Streams and Kaminari pagination
  • Special "Your Profile" card for signed-in users displayed at the top
  • Exclusion of signed-in user from the attendees list to avoid duplication
  • Mobile-responsive grid layout with sticky header
  • Comprehensive test coverage including system and controller tests

How has this been tested?

Please mark the tests that you ran to verify your changes. If difficult to test, consider providing instructions so reviewers can test.

  • Manual testing
  • System tests
  • Unit tests
  • None

Test Coverage Added:

  • System tests (spec/system/profiles_index_spec.rb): Tests for infinite scroll, pagination, profile visibility, and user exclusion logic
  • Navigation tests (spec/system/profile_navigation_spec.rb): Tests for bottom navbar updates and navigation flow
  • Controller tests (spec/controllers/profiles_controller_spec.rb): Tests for pagination, Turbo Stream responses, and current user exclusion

Checklist

  • CI pipeline is passing
  • My code follows the conventions of this project
  • I have performed a self-review of my code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • I have added seed data to the database (if applicable)

Screenshots/Loom

image image

piyush5050 and others added 17 commits August 27, 2025 19:25
Add Kaminari gem to handle pagination for the profiles index page.
This provides clean pagination helpers and ActiveRecord integration.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Enable profiles#index action in routes to support listing all public
profiles. This allows for browsing attendees at Rails World conference.

Addresses: TelosLabs#227

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

Co-Authored-By: Claude <noreply@anthropic.com>
Implement profiles#index action to display public profiles with:
- Filter for public profiles only
- Pagination using Kaminari (10 per page)
- Support for both HTML and Turbo Stream formats
- Smart format detection for Turbo Frame requests to enable infinite scroll

The controller forces turbo_stream format for pagination requests coming
from Turbo Frames, enabling seamless infinite scrolling without DOM nesting.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Create views for browsing public profiles with infinite scrolling:
- index.html.erb: Main profiles listing page with Turbo Frame container
- index.turbo_stream.erb: Handles pagination by appending profiles
- _profile.html.erb: Reusable partial for individual profile cards

Features:
- Clean card-based design matching Rails World app style
- Profile images with fallback avatars
- Name and job title display
- Infinite scroll using Turbo Frames with lazy loading
- Flat DOM structure avoiding nested frames

The implementation uses Turbo Frames for lazy loading combined with
Turbo Streams for appending content, providing smooth infinite scroll
without complex JavaScript.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Update Rails World 2025 seed task to set all speaker profiles as public.
This provides test data for the profiles index page and enables testing
of pagination and infinite scroll functionality in development.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Replace non-functional div with border animation with proper SVG spinner.
The SVG uses Tailwind's animate-spin class with a circular path that
provides visual feedback during pagination loading.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Matches the design pattern used in Agenda and Schedule pages with:
- Sticky positioning that stays at top when scrolling
- Consistent typography (text-3xl italic font-black text-gray-800)
- Proper layout structure separating header from content
- d-hotwire-native-none class for native app compatibility

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Changed from entire card being a link to only the name being clickable
- Added permanent underline to name link for better UX clarity
- Added hover effect that changes text color opacity
- Removed data-test-id attribute as tests are not implemented
- Maintains all existing styling and card layout

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

Co-Authored-By: Claude <noreply@anthropic.com>
Added grid-cols-1 to explicitly define single column layout which:
- Fixes width change issue when loading additional pages via infinite scroll
- Prevents grid recalculation that was causing layout shifts
- Ensures proper mobile responsiveness by keeping cards within viewport
- Maintains consistent card width across all screen sizes

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Add controller specs for profiles#index action testing pagination, public/private filtering, and turbo stream support
- Add system specs for profiles index page covering user interactions, infinite scroll, and profile navigation
- Add data-test-id attributes to profile cards and loader for reliable test element selection
- Ensure tests follow existing patterns with FactoryBot traits and authentication helpers

Tests verify that only public profiles are displayed, pagination works correctly, and the feature is accessible to both authenticated and unauthenticated users.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Change bottom navbar to show "Attendees" instead of "Profile" and link
to the profiles index page for both signed-in and non-signed-in users.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Add a profile card header that shows the current user's profile when
signed in, or prompts to set up profile when not signed in. This provides
easy access to the user's own profile from the attendees list.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Update the profiles index controller to exclude the current user's
profile from the attendees list when they're signed in, since it's
now displayed separately in the my profile card.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Add comprehensive tests for the new profile navigation behavior including:
- Bottom navbar showing "Attendees" instead of "Profile"
- My profile card display for signed-in and non-signed-in users
- Navigation to profile and sign-in pages from the my profile card

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

Co-Authored-By: Claude <noreply@anthropic.com>
Add tests to verify that:
- Current user's profile is excluded from the list when signed in
- All public profiles are included when not signed in
- Current user's profile needs to be public to be excluded

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix trailing whitespace in ERB templates
- Replace deprecated Capybara matchers with modern equivalents
- Standardize file endings with newlines

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

Co-Authored-By: Claude <noreply@anthropic.com>
…oller

Clarifies that the lazy_loading turbo frame defaults to HTML format
but needs turbo_stream format for proper infinite scrolling pagination.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@piyush5050 piyush5050 force-pushed the profiles-index-page branch from f7f7a9c to 2792b1f Compare August 27, 2025 14:03
@LuigiR0jas LuigiR0jas self-requested a review August 29, 2025 20:19
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