Skip to content

Use session name for chat alignment and send connect request - #3

Open
noahfraiture wants to merge 2 commits into
mainfrom
codex/update-chat-bubble-alignment
Open

Use session name for chat alignment and send connect request#3
noahfraiture wants to merge 2 commits into
mainfrom
codex/update-chat-bubble-alignment

Conversation

@noahfraiture

Copy link
Copy Markdown
Owner

Motivation

  • Chat bubble alignment previously relied on a hardcoded local label ("You") so ownership detection was incorrect when the session name is random.
  • The app needs to register the per-session name with the server so remote messages and local messages can be correlated by actual user identity.

Description

  • Update App.tsx to generate a per-session guest name with createGuestName() and a session token using crypto.randomUUID() and send a connect request over WebSocket ({ type: "connect", token, name }).
  • Change message creation to use the session userName when appending outgoing chat entries and when sending chat requests.
  • Update ChatPanel.tsx to accept a new currentUserName prop and compute ownership with message.user.name === currentUserName, choosing alignment classes and bubble tone accordingly while still rendering the local sender label as You for clarity.
  • Add a small UX polish showing different footer text (Sent / Delivered) and a brief timestamp placeholder per message.

Testing

  • Started the frontend dev server with pnpm --dir frontend dev --host 0.0.0.0 --port 4173, which launched successfully.
  • Captured a headless browser screenshot via Playwright against http://127.0.0.1:4173, which completed successfully and produced an artifact image.
  • No unit tests were run for these UI changes.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant