Skip to content

Dovy/fea/profiles with usernames#202

Merged
izza-mus merged 11 commits into
mainfrom
dovy/fea/profile-w-usernames
Mar 19, 2026
Merged

Dovy/fea/profiles with usernames#202
izza-mus merged 11 commits into
mainfrom
dovy/fea/profile-w-usernames

Conversation

@izza-mus
Copy link
Copy Markdown
Collaborator

@izza-mus izza-mus commented Mar 19, 2026

closes #200

Basically some changes to be able to retrieve user specific information using usernames now that they are generated.

This pull request updates the user profile and event routes, as well as all related frontend code, to use usernames instead of numeric user IDs in URLs and API endpoints. It introduces new backend service methods and controller endpoints for fetching public user data and events by username, and updates all frontend navigation, data fetching, and tests to use the username-based routes. This change improves URL readability and consistency across the application.

Backend API updates

  • Added userGetPublicByName and userGetPublicEventsByName methods to UserService to fetch user and event data by username, and updated the UserController to provide endpoints at /users/:username and /users/:username/events instead of ID-based routes.
  • Updated backend tests to mock and validate the new username-based controller methods.

Frontend Routing and Data Fetching

  • Changed all frontend navigation, links, and data fetching to use usernames in URLs (e.g., /users/alice instead of /users/1). This includes updates to chat components, event pages, friend pages, profile sidebar, and global search.

These changes collectively migrate the application to a more user-friendly and consistent username-based routing system for user profiles and related features.

Replace GET /users/:id and GET /users/:id/events with GET /users/:username
and GET /users/:username/events. Add userGetPublicByName and
userGetPublicEventsByName service methods that normalize the username and
delegate to the existing ID-based public methods.
Update userService with getUserByName/getUserEventsByName methods,
change the router param from :id to :username, and update the
publicProfileLoader to fetch by username instead of numeric ID.
Replace /users/:id with /users/:name across chat bubbles, chat headers,
conversation cards, global search, event page host link, friends page,
and profile sidebar.
Add controller unit tests for getUserByUsername and getUserEventsByUsername
including the 404 case. Update GlobalSearch test route and mock data to
reflect username-based navigation.
…gination

Add ReqUserPublicEventsDto (limit + cursor query params), update
userGetPublicEvents to accept limit/cursor and return a paginated envelope,
and wire the query params through the controller.
Update getUserEventsByName to accept limit/cursor params, pass the first
page and pagination from the loader into ProfileTabs, and replace the
static events grid with useInfiniteScroll + sentinel div.
Pass activeTab as a dependency to useInfiniteScroll so the
IntersectionObserver is recreated when the user switches to the events
tab. Without this the sentinel is hidden/unmounted at observer setup
time (Radix TabsContent) and the observer never fires.
@izza-mus
Copy link
Copy Markdown
Collaborator Author

Added pagination to public-profiles so events are not all fetched at same time

… routing

- Route mocks now use username slugs instead of numeric IDs
- User mock data includes displayName field alongside lowercase name
- Events mock response uses paginated envelope { data, pagination }
@izza-mus izza-mus marked this pull request as ready for review March 19, 2026 18:30
@alx-sch
Copy link
Copy Markdown
Owner

alx-sch commented Mar 19, 2026

Display names can't technically have whitespace but it's just mockup anyway :P

Screenshot 2026-03-19 at 20 11 29

Copy link
Copy Markdown
Owner

@alx-sch alx-sch left a comment

Choose a reason for hiding this comment

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

Good stuff! Good catch with that event-list on the public profile page -- totally forgot about this one ;)

@izza-mus izza-mus merged commit 4935c52 into main Mar 19, 2026
7 of 8 checks passed
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.

Change public profile to be accesible via slug/username

2 participants