Skip to content

refactor: remove dead MessageMenu and finish useAudioPlayer rename#3556

Merged
isekovanic merged 1 commit intodevelopfrom
refactor/v9-finish-message-menu-and-audio-hook
Apr 17, 2026
Merged

refactor: remove dead MessageMenu and finish useAudioPlayer rename#3556
isekovanic merged 1 commit intodevelopfrom
refactor/v9-finish-message-menu-and-audio-hook

Conversation

@oliverlaz
Copy link
Copy Markdown
Member

Summary

Two small V9 cleanups that finish incomplete refactors.

1. Remove dead MessageMenu component

MessageMenu was left in the v9 public surface but the overlay path no longer renders it. The source file carried an explicit // TODO: V9: Either remove this or refactor it, as its logic is offloaded to other components now note from the original author. Customers who customized MessageMenu in v8 had an override that silently no-op'd in v9 — a type error is more helpful.

  • Deletes package/src/components/MessageMenu/MessageMenu.tsx
  • Drops the MessageMenu import + DEFAULT_COMPONENTS entry in defaultComponents.ts
  • Drops the ./MessageMenu/MessageMenu re-export from the components barrel
  • The surrounding MessageMenu/ folder stays — MessageActionList, MessageActionListItem, MessageReactionPicker, and MessageUserReactions are the live replacements and remain overridable via WithComponents.

2. Finish useAudioPlayerControluseAudioPlayer rename

The v9 docs already document useAudioPlayerControl → useAudioPlayer, and src/hooks/useAudioPlayer.ts was added. But the barrel still exported useAudioPlayerControl from the byte-identical older file, so the rename never actually shipped. Internal callers (AudioAttachment, AudioRecordingPreview) were already importing the new name directly — only the barrel was stale.

  • src/hooks/index.ts barrel now exports ./useAudioPlayer
  • src/hooks/useAudioPlayerControl.ts deleted (byte-identical duplicate)
  • No internal call sites needed updating — they already used the new name

Test plan

  • yarn tsc --noEmit — passes
  • TZ=UTC yarn jest src/components/MessageMenu/__tests__/ — 30/30 tests pass
  • Smoke test: mount sample app, long-press a message to open the overlay, confirm reactions + actions render (unchanged behavior; MessageMenu wasn't rendering anyway)
  • Smoke test: play back an audio attachment (exercises useAudioPlayer)

Related docs updates

The v8→v9 human migration guide needs follow-up edits in docs-content (separate PR) to reflect:

  • MessageMenu removed (not "still exported but inert")
  • useAudioPlayerControl → useAudioPlayer is now a real rename

… rename

MessageMenu was left in the v9 public surface even though the overlay path
no longer renders it; the source file carried a `// TODO: V9: Either remove
this or refactor it` note. Delete the component, its DEFAULT_COMPONENTS
entry, and its barrel re-export. The surrounding MessageMenu folder stays —
MessageActionList, MessageActionListItem, MessageReactionPicker, and
MessageUserReactions are the live replacements and remain overridable via
WithComponents.

Also finish the useAudioPlayerControl -> useAudioPlayer rename. The
byte-identical `useAudioPlayer.ts` was already being imported directly by
the internal callers (AudioAttachment, AudioRecordingPreview); only the
barrel still pointed at the old name. Flip the barrel and delete the dead
duplicate file.
@Stream-SDK-Bot
Copy link
Copy Markdown
Contributor

SDK Size

title develop branch diff status
js_bundle_size 354 KB 352 KB -1165 B 🚀

@oliverlaz oliverlaz requested a review from isekovanic April 17, 2026 09:42
@isekovanic isekovanic merged commit e8d80bd into develop Apr 17, 2026
5 checks passed
@isekovanic isekovanic deleted the refactor/v9-finish-message-menu-and-audio-hook branch April 17, 2026 11:23
isekovanic pushed a commit that referenced this pull request Apr 17, 2026
## Summary

Adds `ai-docs/ai-migration.md` — a compact, machine-friendly v8 → v9
migration reference built for AI coding agents (Claude Code, Cursor,
Copilot, etc.).

The human-oriented v8 → v9 guide at
https://getstream.io/chat/docs/sdk/react-native/basics/upgrading-from-v8/
is ~40k tokens. Loading it wholesale eats most of an agent's context
window before any code work begins. This sibling doc is ~4k tokens (5×
smaller) — prose rationale stripped, rename tables/decision rules/source
pointers kept.

Customers point their agent at the raw GitHub URL. It is **not** shipped
in the npm package.

### Key agent-oriented features

- **§0 primer** tells agents not to trust training data for v9 symbols
(their cutoff predates v9) and names the correct `node_modules` path —
the installed package is `stream-chat-react-native-core`, not
`stream-chat-react-native` (which is the bare-RN wrapper).
- **§1 detection greps** let agents scope the work with a single `rg`
pass and skip sections whose patterns don't match the customer codebase.
- **§3 big-3 structural migrations** enforce ordering: `WithComponents`,
5 component renames, inverted audio semantics — done first because many
leaf renames evaporate after the big moves.
- **§6 behavior changes** captures runtime-semantic shifts that aren't
pure renames (`messageContentOrder` default swap,
`deletedMessagesVisibilityType` removal, swipe-to-reply boundary,
`MessageActionType.type` field, etc.).
- **§7 JSON rename block** is the full v8 → v9 symbol map in a single
parseable block for programmatic find/replace.
- **§9 verification workflow** gives agents a hard gate: `rg` + `tsc`
commands that must come back clean before the agent declares done.

### Stacked on #3556

This PR targets `refactor/v9-finish-message-menu-and-audio-hook` so the
guide can accurately claim `useAudioPlayer` is the v9 hook name and
`MessageMenu` is removed. GitHub will auto-retarget to `develop` when
#3556 merges.

## Test plan

- [x] Verified every v9 symbol in the guide resolves in `package/src/`
- [x] Verified every `node_modules/` path referenced exists under
`package/src/`
- [x] Verified every `rg` pattern is syntactically valid (no exit-2 from
ripgrep)
- [x] Confirmed all "removed" claims in the JSON block are genuinely
absent from v9 source (only i18n translation keys and stale JSDoc
comments mention them)
- [ ] Dogfood check: paste the raw URL into Claude Code on a fresh v8
example app and have it migrate

## Related docs updates

Human migration guide edits (correcting the MessageMenu and
AudioAttachment claims that this agent guide is also correcting) are a
separate PR in the `docs-content` repo.
@github-actions github-actions bot mentioned this pull request Apr 17, 2026
6 tasks
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