Skip to content

Commit e8d80bd

Browse files
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 rename
1 parent 607120f commit e8d80bd

File tree

5 files changed

+1
-170
lines changed

5 files changed

+1
-170
lines changed

package/src/components/MessageMenu/MessageMenu.tsx

Lines changed: 0 additions & 107 deletions
This file was deleted.

package/src/components/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ export * from './MessageList/hooks/useMessageGroupStyles';
163163

164164
export * from './MessageMenu/MessageActionList';
165165
export * from './MessageMenu/MessageActionListItem';
166-
export * from './MessageMenu/MessageMenu';
167166
export * from './MessageMenu/MessageUserReactions';
168167
export * from './MessageMenu/MessageUserReactionsAvatar';
169168
export * from './MessageMenu/MessageReactionPicker';

package/src/contexts/componentsContext/defaultComponents.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ import { TypingIndicatorContainer } from '../../components/MessageList/TypingInd
123123
import { UnreadMessagesNotification } from '../../components/MessageList/UnreadMessagesNotification';
124124
import { MessageActionList } from '../../components/MessageMenu/MessageActionList';
125125
import { MessageActionListItem } from '../../components/MessageMenu/MessageActionListItem';
126-
import { MessageMenu } from '../../components/MessageMenu/MessageMenu';
127126
import { MessageReactionPicker } from '../../components/MessageMenu/MessageReactionPicker';
128127
import { MessageUserReactions } from '../../components/MessageMenu/MessageUserReactions';
129128
import { MessageUserReactionsAvatar } from '../../components/MessageMenu/MessageUserReactionsAvatar';
@@ -226,7 +225,6 @@ const components = {
226225
MessageInputTrailingView,
227226
MessageItemView,
228227
MessageList,
229-
MessageMenu,
230228
MessagePinnedHeader,
231229
MessageReactionPicker,
232230
MessageReminderHeader,

package/src/hooks/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export * from './useClientNotifications';
1212
export * from './useInAppNotificationsState';
1313
export * from './usePortalSettledCallback';
1414
export * from './useRAFCoalescedValue';
15-
export * from './useAudioPlayerControl';
15+
export * from './useAudioPlayer';
1616
export * from './useAttachmentPickerState';
1717
export * from './messagePreview/useMessageDeliveryStatus';
1818
export * from './messagePreview/useGroupedAttachments';

package/src/hooks/useAudioPlayerControl.ts

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)