From b85c57b5caf5ecfe2cdc0f70c8030ca3edd4a1f3 Mon Sep 17 00:00:00 2001 From: Joshua Higgins Date: Sun, 15 Nov 2026 13:37:21 -0500 Subject: [PATCH] fix(mobile): show artist menu subtitles without a native rebuild --- .../player-artist-fallback-menu.ios.tsx | 56 +++++++++++++++++++ .../player-artist-fallback-menu.tsx | 35 ++++++++++++ apps/mobile/components/player-artist-menu.tsx | 20 +------ 3 files changed, 94 insertions(+), 17 deletions(-) create mode 100644 apps/mobile/components/player-artist-fallback-menu.ios.tsx create mode 100644 apps/mobile/components/player-artist-fallback-menu.tsx diff --git a/apps/mobile/components/player-artist-fallback-menu.ios.tsx b/apps/mobile/components/player-artist-fallback-menu.ios.tsx new file mode 100644 index 0000000..12993be --- /dev/null +++ b/apps/mobile/components/player-artist-fallback-menu.ios.tsx @@ -0,0 +1,56 @@ +import { + Button, + Host, + Label, + Menu, + RNHostView, + Text, + VStack, +} from "@expo/ui/swift-ui" +import { menuOrder } from "@expo/ui/swift-ui/modifiers" +import { StyleSheet, View } from "react-native" + +import type { PlayerArtistFallbackMenuProps } from "./player-artist-fallback-menu" + +// Use custom SwiftUI labels because the community menu adapter drops subtitles. +export function PlayerArtistFallbackMenu({ + song, + size, + onAction, +}: PlayerArtistFallbackMenuProps) { + return ( + + + + + } + > + + + + + ) +} diff --git a/apps/mobile/components/player-artist-fallback-menu.tsx b/apps/mobile/components/player-artist-fallback-menu.tsx new file mode 100644 index 0000000..c70a844 --- /dev/null +++ b/apps/mobile/components/player-artist-fallback-menu.tsx @@ -0,0 +1,35 @@ +import { StyleSheet, View } from "react-native" + +import { + MediaActionMenu, + type MediaAction, +} from "@/components/media-context-menu" +import type { BrowseSong } from "@otunes/convex/types" + +export type PlayerArtistFallbackMenuProps = { + song: BrowseSong + size: { width: number; height: number } + onAction: (action: MediaAction) => void +} + +export function PlayerArtistFallbackMenu({ + song, + size, + onAction, +}: PlayerArtistFallbackMenuProps) { + return ( + + + + ) +} diff --git a/apps/mobile/components/player-artist-menu.tsx b/apps/mobile/components/player-artist-menu.tsx index 1faf302..93518bf 100644 --- a/apps/mobile/components/player-artist-menu.tsx +++ b/apps/mobile/components/player-artist-menu.tsx @@ -2,10 +2,8 @@ import { requireNativeView, requireOptionalNativeModule } from "expo" import { useState, type ReactNode } from "react" import { Platform, StyleSheet, View, type ViewProps } from "react-native" -import { - MediaActionMenu, - type MediaAction, -} from "@/components/media-context-menu" +import type { MediaAction } from "@/components/media-context-menu" +import { PlayerArtistFallbackMenu } from "@/components/player-artist-fallback-menu" import type { BrowseSong } from "@otunes/convex/types" const NativeMenu = @@ -56,19 +54,7 @@ export function PlayerArtistMenu({ onAction={({ nativeEvent }) => onAction(nativeEvent.action)} /> ) : size.width > 0 ? ( - - - + ) : null} )