Skip to content

Clear search term after adding chat member - #10831

Merged
mozzius merged 1 commit into
mainfrom
d/chat-clear-name-input
Jun 10, 2026
Merged

mozzius merged 1 commit into
mainfrom
d/chat-clear-name-input

Conversation

@ds-boyce

@ds-boyce ds-boyce commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Better than having to manually delete the search term every time after adding a new member.

search.mov

@ds-boyce
ds-boyce requested a review from mozzius June 9, 2026 22:19
@arcalinea
arcalinea temporarily deployed to d/chat-clear-name-input - social-app PR #10831 June 9, 2026 22:19 — with Render Destroyed
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
Old size New size Diff
7.73 MB 7.73 MB 453 B (0.01%)

@mozzius mozzius left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. @claude thoughts?

@linear-code

linear-code Bot commented Jun 10, 2026

Copy link
Copy Markdown

APP-2364

@claude

claude Bot commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @mozzius's task in 1m 5s —— View job


Review

  • Read changed files
  • Analyze the changes
  • Post review feedback

LGTM, this is a nice cleanup alongside the UX fix. A few observations:

What's good:

  • Consolidating searchText into the reducer alongside the related chat/member state is the right move — these pieces of state are coupled (adding a member should reset the search), and the reducer now owns the rule explicitly rather than relying on call sites to remember setSearchText('').
  • In InitiateChatFlow.tsx, the two manual setSearchText('') calls in handleGoBack and handlePressNext were correctly dropped since the new actions (goBackFromNewGroupChat, startNameGroup) handle the reset in the reducer. Less to miss next time someone adds a state transition.
  • The clearing behavior is appropriately scoped: setDids, startNameGroup, and goBackFromNewGroupChat clear searchText, while removeDids correctly does not (removing a member while you're mid-search shouldn't nuke your query).
  • Both files apply the same pattern — consistency between the two flows makes this easier to reason about.

Minor nits (non-blocking):

  • The useReducer had to be moved above useActorAutocompleteQuery in both files since the query now depends on searchText from reducer state. That's correct, just worth noting for anyone reading the diff cold — the apparent reordering is load-bearing, not stylistic.
  • 'setSearchText' is the one action that gets dispatched on every keystroke. Worth a quick mental check that re-rendering through the reducer here isn't worse than the old useState path — should be equivalent since React batches and the reducer return is a fresh object either way, but flagging in case anything downstream of the reducer was previously skipping work that it can't now.

Nothing actionable from me. Ship it.
• Branch: d/chat-clear-name-input

@mozzius
mozzius merged commit 8720d05 into main Jun 10, 2026
20 checks passed
@ds-boyce
ds-boyce deleted the d/chat-clear-name-input branch June 10, 2026 16:10
estrattonbailey added a commit that referenced this pull request Jun 10, 2026
…uttons

* origin/main: (149 commits)
  Tweak spacing in invite link dialog (#10829)
  [Chat] Fix source of truth for group size limit (#10845)
  [Chat] Sync convo agent with shadow cache (#10827)
  [Chat] Some tweaks (#10840)
  [Chat] Fix optimistic updates by using partial keys (#10838)
  Remove leave-convo suppression, use real optimistic update (#10834)
  use opus 4.8 in github claude (#10837)
  [Chat] revalidate join links on leave (#10833)
  Clear search term after adding chat member (#10831)
  Support dim theme on join request landing page (#10832)
  Nightly source-language update
  bskyweb: meta noindex tag for non-indexable pages (#10803)
  Hide domain if matches handle, new Standard Site icon treatment (#10767)
  Fix image collapse in FF (#10826)
  Change Ignore to Reject for chat invites (#10825)
  [Chat] add lil gap between chats on web (#10821)
  Add list of mutual chats to block dialog (#10727)
  Address chat design nits (#10823)
  Fix link to profile from chat invite embed (#10822)
  [Chat] Show invite link label in chat list preview (#10811)
  ...

This branch was successfully deployed

No deployments
d/chat-clear-name-input - social-app PR #10831 — 7d64f8d7 Deployed Jun 9, 2026 by arcalinea
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.

3 participants