Commit e8d80bd
authored
refactor: remove dead MessageMenu and finish useAudioPlayer rename (#3556)
## 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 `useAudioPlayerControl` → `useAudioPlayer` 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
- [x] `yarn tsc --noEmit` — passes
- [x] `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 rename1 parent 607120f commit e8d80bd
File tree
5 files changed
+1
-170
lines changed- package/src
- components
- MessageMenu
- contexts/componentsContext
- hooks
5 files changed
+1
-170
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
167 | 166 | | |
168 | 167 | | |
169 | 168 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | 126 | | |
128 | 127 | | |
129 | 128 | | |
| |||
226 | 225 | | |
227 | 226 | | |
228 | 227 | | |
229 | | - | |
230 | 228 | | |
231 | 229 | | |
232 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
This file was deleted.
0 commit comments