Playlist block can't open the native media library
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 74/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, kotlin, swift, typescript
- 领域
- mobile-dev
调研方向
从 useNativeMediaLibrary 开始,openMediaLibrary 桥接消息在这里构建,并追踪 Playlist 块的 multiple 值如何从 edit.jsx(multiple="add" 在 MediaPlaceholder 和 MediaReplaceFlow 上)到达那里。与 issue 中提到的原生解码器进行比较——iOS 上的 OpenMediaLibraryAction 和 Android 上的 parseMediaLibraryConfig——它们都期望一个 Boolean,并注意 onSelect 回调已经把 multiple 当作 truthy。在发送前将 multiple 规范化为 Boolean;完成意味着点击“Media Library”和“Add track”会打开选择器,并且所选音频会在两个平台上添加。
由索引模型根据 Issue 内容生成。
描述
Description
Choosing "Media Library" in a Playlist block should open the native media picker and add the selected audio to the playlist. Nothing happens instead, on both iOS and Android.
The Playlist block passes multiple="add" to MediaUpload. Upstream types this as boolean | 'add'. GutenbergKit forwards the string unchanged in the openMediaLibrary bridge message, but both native decoders expect a Boolean:
- iOS:
OpenMediaLibraryActionfails to decode. Before #917 this hit afatalErrorand crashed the app. Since #917 the message is logged and dropped. - Android:
parseMediaLibraryConfigthrows onrequireBoolean("multiple"), and the message is logged and dropped.
A likely fix is to normalize multiple to a Boolean in useNativeMediaLibrary before sending it, which covers both platforms. The onSelect callback already passes an array when multiple is truthy.
Step-by-step reproduction instructions
- Open the editor in a host app or the demo app.
- Insert a Playlist block.
- Tap "Media Library" in the placeholder, or "Add track" in the toolbar on an existing playlist.
- The media picker doesn't open. The native logs show a dropped
openMediaLibrarymessage.
Screenshots, screen recording, code snippet
// @wordpress/block-library/src/playlist/edit.jsx
<MediaPlaceholder multiple="add" … />
<MediaReplaceFlow multiple="add" … />
Environment info
GutenbergKit trunk (@wordpress/block-library 12.2.0). The crash was reported on the iOS app's 27.5 beta, before #917.
Please confirm that you have searched existing issues in the repo.
- Yes
- 主要语言
- JavaScript
- 星标
- 29
- 派生
- 6
- 平均合并
- 2 天 1 小时
- 30 天内合并 PR
- 76
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
wordpress-mobile/GutenbergKit 的其他 Issue
-
[Type] Bug
难度 2/5 1-3 小时 新手友好度 75/100
wordpress-mobile/GutenbergKit#884 ·
维护者通常 1 天内回复
-
[Type] Bug Android
难度 2/5 1-3 小时 新手友好度 79/100
wordpress-mobile/GutenbergKit#847 ·
维护者通常 1 天内回复
-
[Type] Bug iOS
难度 2/5 1-3 小时 新手友好度 77/100
wordpress-mobile/GutenbergKit#846 ·
维护者通常 1 天内回复
-
[Type] Bug [Type] Code Quality iOS
难度 2/5 1-3 小时 新手友好度 88/100
wordpress-mobile/GutenbergKit#668 ·
维护者通常 1 天内回复
-
[Type] Bug [Type] Performance iOS
难度 2/5 1-3 小时 新手友好度 88/100
wordpress-mobile/GutenbergKit#666 ·
维护者通常 1 天内回复
查看 wordpress-mobile/GutenbergKit 的全部 Issue
相似的 Issue
-
check:passed logos:remove
难度 1/5 1 小时以内 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
intuitem/ciso-assistant-community#5380 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
TarteelAI/quranic-universal-library#1111 ·
维护者通常 1 天内回复
-
area:ryoku type:bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
feedback simulation workshop
难度 2/5 1-3 小时 新手友好度 64/100
githubnext/gh-aw-workshop#6094 ·
维护者通常 1 天内回复