From 9046df1733f053d38419b4c6abb85430ca580347 Mon Sep 17 00:00:00 2001 From: Joshua Higgins Date: Sun, 15 Nov 2026 10:40:39 -0500 Subject: [PATCH 1/4] feat(mobile): open album and artist menu from player artist --- apps/mobile/app/(app)/player.tsx | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/apps/mobile/app/(app)/player.tsx b/apps/mobile/app/(app)/player.tsx index ad6d740..99bb042 100644 --- a/apps/mobile/app/(app)/player.tsx +++ b/apps/mobile/app/(app)/player.tsx @@ -544,13 +544,28 @@ function SongMeta({ { color: colors.foreground }, ]} /> - + + + + + void toggleSongFavorite(song.id)} -- 2.54.1 From 60aa5da47fc012e627d1f0c132ccaa1abe5e8acd Mon Sep 17 00:00:00 2001 From: Joshua Higgins Date: Sun, 15 Nov 2026 10:55:51 -0500 Subject: [PATCH 2/4] fix(mobile): preserve artist marquee and anchor navigation menu --- apps/mobile/app/(app)/player.tsx | 32 +++----- apps/mobile/components/player-artist-menu.tsx | 79 +++++++++++++++++++ .../expo-module.config.json | 4 + .../ios/PlayerNavigationMenu.podspec | 17 ++++ .../ios/PlayerNavigationMenuModule.swift | 56 +++++++++++++ 5 files changed, 166 insertions(+), 22 deletions(-) create mode 100644 apps/mobile/components/player-artist-menu.tsx create mode 100644 apps/mobile/modules/player-navigation-menu/expo-module.config.json create mode 100644 apps/mobile/modules/player-navigation-menu/ios/PlayerNavigationMenu.podspec create mode 100644 apps/mobile/modules/player-navigation-menu/ios/PlayerNavigationMenuModule.swift diff --git a/apps/mobile/app/(app)/player.tsx b/apps/mobile/app/(app)/player.tsx index 99bb042..a06b216 100644 --- a/apps/mobile/app/(app)/player.tsx +++ b/apps/mobile/app/(app)/player.tsx @@ -44,6 +44,7 @@ import { NowPlayingQueue, QUEUE_HORIZONTAL_INSET, } from "@/components/now-playing-queue" +import { PlayerArtistMenu } from "@/components/player-artist-menu" import { PlayerSlider } from "@/components/player-slider" import { PlayerSymbol } from "@/components/player-symbol" import { useFavorites } from "@/contexts/favorites" @@ -544,28 +545,15 @@ function SongMeta({ { color: colors.foreground }, ]} /> - - - - - + + + void toggleSongFavorite(song.id)} diff --git a/apps/mobile/components/player-artist-menu.tsx b/apps/mobile/components/player-artist-menu.tsx new file mode 100644 index 0000000..1faf302 --- /dev/null +++ b/apps/mobile/components/player-artist-menu.tsx @@ -0,0 +1,79 @@ +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 { BrowseSong } from "@otunes/convex/types" + +const NativeMenu = + Platform.OS === "ios" && requireOptionalNativeModule("PlayerNavigationMenu") + ? requireNativeView< + ViewProps & { + artist: string + album: string + fontSize: number + onAction: (event: { nativeEvent: { action: MediaAction } }) => void + } + >("PlayerNavigationMenu") + : null + +export function PlayerArtistMenu({ + song, + compact, + onAction, + children, +}: { + song: BrowseSong + compact: boolean + onAction: (action: MediaAction) => void + children: ReactNode +}) { + const [size, setSize] = useState({ width: 0, height: 0 }) + + return ( + + setSize({ width: layout.width, height: layout.height }) + } + > + + {children} + + {NativeMenu ? ( + onAction(nativeEvent.action)} + /> + ) : size.width > 0 ? ( + + + + ) : null} + + ) +} + +const styles = StyleSheet.create({ + container: { overflow: "hidden" }, +}) diff --git a/apps/mobile/modules/player-navigation-menu/expo-module.config.json b/apps/mobile/modules/player-navigation-menu/expo-module.config.json new file mode 100644 index 0000000..c46913b --- /dev/null +++ b/apps/mobile/modules/player-navigation-menu/expo-module.config.json @@ -0,0 +1,4 @@ +{ + "platforms": ["apple"], + "apple": { "modules": ["PlayerNavigationMenuModule"] } +} diff --git a/apps/mobile/modules/player-navigation-menu/ios/PlayerNavigationMenu.podspec b/apps/mobile/modules/player-navigation-menu/ios/PlayerNavigationMenu.podspec new file mode 100644 index 0000000..7587309 --- /dev/null +++ b/apps/mobile/modules/player-navigation-menu/ios/PlayerNavigationMenu.podspec @@ -0,0 +1,17 @@ +Pod::Spec.new do |s| + s.name = 'PlayerNavigationMenu' + s.version = '1.0.0' + s.summary = 'Native player navigation menu for oTunes' + s.description = s.summary + s.license = { :type => 'MIT' } + s.author = 'oTunes' + s.homepage = 'https://otunes.abunchofknowitalls.com' + s.platforms = { :ios => '16.4' } + s.swift_version = '5.9' + s.source = { :git => '' } + s.static_framework = true + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } + s.dependency 'ExpoModulesCore' + s.frameworks = 'UIKit' + s.source_files = '**/*.swift' +end diff --git a/apps/mobile/modules/player-navigation-menu/ios/PlayerNavigationMenuModule.swift b/apps/mobile/modules/player-navigation-menu/ios/PlayerNavigationMenuModule.swift new file mode 100644 index 0000000..58675d3 --- /dev/null +++ b/apps/mobile/modules/player-navigation-menu/ios/PlayerNavigationMenuModule.swift @@ -0,0 +1,56 @@ +import ExpoModulesCore +import UIKit + +public class PlayerNavigationMenuModule: Module { + public func definition() -> ModuleDefinition { + Name("PlayerNavigationMenu") + + View(PlayerNavigationMenuView.self) { + Events("onAction") + Prop("artist") { (view: PlayerNavigationMenuView, value: String) in + view.artist = value + } + Prop("album") { (view: PlayerNavigationMenuView, value: String) in + view.album = value + } + Prop("fontSize") { (view: PlayerNavigationMenuView, value: Double) in + view.fontSize = CGFloat(value) + } + } + } +} + +final class PlayerNavigationMenuView: ExpoView { + let onAction = EventDispatcher() + var artist = "" { didSet { updateMenu(); setNeedsLayout() } } + var album = "" { didSet { updateMenu() } } + var fontSize: CGFloat = 20 { didSet { setNeedsLayout() } } + private let button = UIButton(type: .custom) + + required init(appContext: AppContext? = nil) { + super.init(appContext: appContext) + button.showsMenuAsPrimaryAction = true + button.preferredMenuElementOrder = .fixed + button.accessibilityHint = "Opens album and artist options" + addSubview(button) + } + + private func updateMenu() { + button.accessibilityLabel = artist + button.menu = UIMenu(children: [ + UIAction(title: "Go to Album", subtitle: album, image: UIImage(systemName: "square.stack")) { [weak self] _ in + self?.onAction(["action": "go-album"]) + }, + UIAction(title: "Go to Artist", subtitle: artist, image: UIImage(systemName: "music.mic")) { [weak self] _ in + self?.onAction(["action": "go-artist"]) + }, + ]) + } + + override func layoutSubviews() { + super.layoutSubviews() + // Anchor to the visible artist text, not the marquee's offscreen track. + let textWidth = (artist as NSString).size(withAttributes: [.font: UIFont.systemFont(ofSize: fontSize)]).width + button.frame = CGRect(x: 0, y: 0, width: min(ceil(textWidth), bounds.width), height: bounds.height) + } +} -- 2.54.1 From b85c57b5caf5ecfe2cdc0f70c8030ca3edd4a1f3 Mon Sep 17 00:00:00 2001 From: Joshua Higgins Date: Sun, 15 Nov 2026 13:37:21 -0500 Subject: [PATCH 3/4] 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} ) -- 2.54.1 From 2ab3920d5e0bf46f98e79cb192130432cf4c2fba Mon Sep 17 00:00:00 2001 From: Joshua Higgins Date: Sun, 15 Nov 2026 13:42:11 -0500 Subject: [PATCH 4/4] fix: simplify player menu and match navigation icons --- apps/mobile/app/(app)/player.tsx | 2 +- apps/mobile/components/media-context-menu.tsx | 4 +- .../player-artist-fallback-menu.ios.tsx | 56 ------------------- .../player-artist-fallback-menu.tsx | 35 ------------ apps/mobile/components/player-artist-menu.tsx | 45 ++++++--------- .../expo-module.config.json | 4 -- .../ios/PlayerNavigationMenu.podspec | 17 ------ .../ios/PlayerNavigationMenuModule.swift | 56 ------------------- apps/web/components/media-context-menu.tsx | 13 ++--- 9 files changed, 26 insertions(+), 206 deletions(-) delete mode 100644 apps/mobile/components/player-artist-fallback-menu.ios.tsx delete mode 100644 apps/mobile/components/player-artist-fallback-menu.tsx delete mode 100644 apps/mobile/modules/player-navigation-menu/expo-module.config.json delete mode 100644 apps/mobile/modules/player-navigation-menu/ios/PlayerNavigationMenu.podspec delete mode 100644 apps/mobile/modules/player-navigation-menu/ios/PlayerNavigationMenuModule.swift diff --git a/apps/mobile/app/(app)/player.tsx b/apps/mobile/app/(app)/player.tsx index a06b216..74da7bc 100644 --- a/apps/mobile/app/(app)/player.tsx +++ b/apps/mobile/app/(app)/player.tsx @@ -545,7 +545,7 @@ function SongMeta({ { color: colors.foreground }, ]} /> - + "Go to Artist", - image: "person", + image: "music.mic", }, { action: "go-album", label: () => "Go to Album", - image: "opticaldisc", + image: "square.stack", }, { action: "favorite", diff --git a/apps/mobile/components/player-artist-fallback-menu.ios.tsx b/apps/mobile/components/player-artist-fallback-menu.ios.tsx deleted file mode 100644 index 12993be..0000000 --- a/apps/mobile/components/player-artist-fallback-menu.ios.tsx +++ /dev/null @@ -1,56 +0,0 @@ -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 deleted file mode 100644 index c70a844..0000000 --- a/apps/mobile/components/player-artist-fallback-menu.tsx +++ /dev/null @@ -1,35 +0,0 @@ -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 93518bf..f94fa85 100644 --- a/apps/mobile/components/player-artist-menu.tsx +++ b/apps/mobile/components/player-artist-menu.tsx @@ -1,31 +1,18 @@ -import { requireNativeView, requireOptionalNativeModule } from "expo" import { useState, type ReactNode } from "react" -import { Platform, StyleSheet, View, type ViewProps } from "react-native" +import { StyleSheet, View } from "react-native" -import type { MediaAction } from "@/components/media-context-menu" -import { PlayerArtistFallbackMenu } from "@/components/player-artist-fallback-menu" +import { + MediaActionMenu, + type MediaAction, +} from "@/components/media-context-menu" import type { BrowseSong } from "@otunes/convex/types" -const NativeMenu = - Platform.OS === "ios" && requireOptionalNativeModule("PlayerNavigationMenu") - ? requireNativeView< - ViewProps & { - artist: string - album: string - fontSize: number - onAction: (event: { nativeEvent: { action: MediaAction } }) => void - } - >("PlayerNavigationMenu") - : null - export function PlayerArtistMenu({ song, - compact, onAction, children, }: { song: BrowseSong - compact: boolean onAction: (action: MediaAction) => void children: ReactNode }) { @@ -45,16 +32,20 @@ export function PlayerArtistMenu({ > {children} - {NativeMenu ? ( - 0 ? ( + onAction(nativeEvent.action)} - /> - ) : size.width > 0 ? ( - + includeActions={["go-album", "go-artist"]} + onAction={onAction} + > + + ) : null} ) diff --git a/apps/mobile/modules/player-navigation-menu/expo-module.config.json b/apps/mobile/modules/player-navigation-menu/expo-module.config.json deleted file mode 100644 index c46913b..0000000 --- a/apps/mobile/modules/player-navigation-menu/expo-module.config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "platforms": ["apple"], - "apple": { "modules": ["PlayerNavigationMenuModule"] } -} diff --git a/apps/mobile/modules/player-navigation-menu/ios/PlayerNavigationMenu.podspec b/apps/mobile/modules/player-navigation-menu/ios/PlayerNavigationMenu.podspec deleted file mode 100644 index 7587309..0000000 --- a/apps/mobile/modules/player-navigation-menu/ios/PlayerNavigationMenu.podspec +++ /dev/null @@ -1,17 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'PlayerNavigationMenu' - s.version = '1.0.0' - s.summary = 'Native player navigation menu for oTunes' - s.description = s.summary - s.license = { :type => 'MIT' } - s.author = 'oTunes' - s.homepage = 'https://otunes.abunchofknowitalls.com' - s.platforms = { :ios => '16.4' } - s.swift_version = '5.9' - s.source = { :git => '' } - s.static_framework = true - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } - s.dependency 'ExpoModulesCore' - s.frameworks = 'UIKit' - s.source_files = '**/*.swift' -end diff --git a/apps/mobile/modules/player-navigation-menu/ios/PlayerNavigationMenuModule.swift b/apps/mobile/modules/player-navigation-menu/ios/PlayerNavigationMenuModule.swift deleted file mode 100644 index 58675d3..0000000 --- a/apps/mobile/modules/player-navigation-menu/ios/PlayerNavigationMenuModule.swift +++ /dev/null @@ -1,56 +0,0 @@ -import ExpoModulesCore -import UIKit - -public class PlayerNavigationMenuModule: Module { - public func definition() -> ModuleDefinition { - Name("PlayerNavigationMenu") - - View(PlayerNavigationMenuView.self) { - Events("onAction") - Prop("artist") { (view: PlayerNavigationMenuView, value: String) in - view.artist = value - } - Prop("album") { (view: PlayerNavigationMenuView, value: String) in - view.album = value - } - Prop("fontSize") { (view: PlayerNavigationMenuView, value: Double) in - view.fontSize = CGFloat(value) - } - } - } -} - -final class PlayerNavigationMenuView: ExpoView { - let onAction = EventDispatcher() - var artist = "" { didSet { updateMenu(); setNeedsLayout() } } - var album = "" { didSet { updateMenu() } } - var fontSize: CGFloat = 20 { didSet { setNeedsLayout() } } - private let button = UIButton(type: .custom) - - required init(appContext: AppContext? = nil) { - super.init(appContext: appContext) - button.showsMenuAsPrimaryAction = true - button.preferredMenuElementOrder = .fixed - button.accessibilityHint = "Opens album and artist options" - addSubview(button) - } - - private func updateMenu() { - button.accessibilityLabel = artist - button.menu = UIMenu(children: [ - UIAction(title: "Go to Album", subtitle: album, image: UIImage(systemName: "square.stack")) { [weak self] _ in - self?.onAction(["action": "go-album"]) - }, - UIAction(title: "Go to Artist", subtitle: artist, image: UIImage(systemName: "music.mic")) { [weak self] _ in - self?.onAction(["action": "go-artist"]) - }, - ]) - } - - override func layoutSubviews() { - super.layoutSubviews() - // Anchor to the visible artist text, not the marquee's offscreen track. - let textWidth = (artist as NSString).size(withAttributes: [.font: UIFont.systemFont(ofSize: fontSize)]).width - button.frame = CGRect(x: 0, y: 0, width: min(ceil(textWidth), bounds.width), height: bounds.height) - } -} diff --git a/apps/web/components/media-context-menu.tsx b/apps/web/components/media-context-menu.tsx index 9621781..d216401 100644 --- a/apps/web/components/media-context-menu.tsx +++ b/apps/web/components/media-context-menu.tsx @@ -3,15 +3,15 @@ import * as React from "react" import Link from "next/link" import { - Disc3, + GalleryVerticalEnd, ListEnd, ListPlus, ListStart, + MicVocal, MoreHorizontal, Share2, Shuffle, Star, - User, } from "lucide-react" import { Button } from "@/components/ui/button" @@ -22,10 +22,7 @@ import { DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" -import { - copyMediaShareLink, - type MediaShareContext, -} from "@/lib/media-links" +import { copyMediaShareLink, type MediaShareContext } from "@/lib/media-links" import { cn } from "@/lib/utils" export type MediaContextAction = @@ -141,7 +138,7 @@ export function MediaContextMenuItems({ Go to Artist - + ) : null} @@ -149,7 +146,7 @@ export function MediaContextMenuItems({ Go to Album - + ) : null} -- 2.54.1