Skip to content

feat: Hook up UI components to websocket for chat#2081

Merged
dankim214 merged 13 commits intomainfrom
dkim/hook-up-web-socket-trollbox
Feb 19, 2026
Merged

feat: Hook up UI components to websocket for chat#2081
dankim214 merged 13 commits intomainfrom
dkim/hook-up-web-socket-trollbox

Conversation

@dankim214
Copy link
Copy Markdown
Collaborator

@dankim214 dankim214 commented Feb 18, 2026

  • Hook up UI components to chat websocket URL
  • Poll endpoint to get chat room participant count
  • Handle error types coming from websocket
Screen.Recording.2026-02-18.at.4.55.58.PM.mov

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v4-staging Ready Ready Preview, Comment Feb 19, 2026 6:31pm
v4-testnet Ready Ready Preview, Comment Feb 19, 2026 6:31pm

Request Review

@dankim214 dankim214 changed the title get initial connection and basic messages hooked up feat: Hook up UI components to websocket for chat Feb 18, 2026
queryKey: ['trollboxConnectedAddresses'],
queryFn: async (): Promise<number> => {
const response = await fetch(CONNECTED_ADDRESSES_URL);
if (!response.ok) throw new Error('Failed to fetch connected addresses');
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

react-query will by default return the last stale response on Error which is probably what we want here (rather than defaulting to 0 or something)

@qardpeet
Copy link
Copy Markdown
Contributor

image

long text with no whitespace doesn't wrap

shape={ButtonShape.Square}
action={ButtonAction.Base}
state={{ isDisabled: isEmpty(inputValue.trim()) }}
state={{ isDisabled: isEmpty(inputValue.trim()) || isOverLimit }}
Copy link
Copy Markdown
Contributor

@qardpeet qardpeet Feb 19, 2026

Choose a reason for hiding this comment

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

we should either keep this or the toast, if we disable the button the max char limit toast never shows

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

possibly have validation + disabled state instead of waiting for handleSend?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

hmmm i think having both is still good imo

  • the toast is to give an obvious response in the event the user hits enter to submit the message since they might not be looking at the send button
  • the disabled button is to be able to quickly tell whether the message is still a valid size per keystroke (without having to try to hit enter to check)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cool, I assumed the enter key wasn't working as well when the btn was disabled

Comment thread src/components/GlobalChatBodyContent.tsx Outdated
Comment thread src/hooks/useTrollboxOnlineCount.ts
Comment thread src/lib/trollboxUtils.ts
@dankim214 dankim214 merged commit 4780288 into main Feb 19, 2026
14 checks passed
@dankim214 dankim214 deleted the dkim/hook-up-web-socket-trollbox branch February 19, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants