Enable direct Spotify embed playback on desktop#2266
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 96b893de3d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| let { link }: Props = $props(); | ||
|
|
||
| const supportsDirectInteraction = new MediaQuery('(hover: hover) and (pointer: fine)', false); |
There was a problem hiding this comment.
Keep the link overlay on hybrid touch devices
On hybrid devices such as touchscreen laptops or tablets with a connected trackpad, hover and pointer describe the primary pointer and can both match this query even when the user taps the screen. The overlay is therefore removed and the tap reaches the Spotify iframe instead of opening the required new tab, preserving the touch-input failure this change is intended to avoid. Account for touch capability (for example via the any-pointer media features) rather than classifying the whole device solely by its primary pointer.
Useful? React with 👍 / 👎.
Closes: #2258
Summary
タッチ環境では新しいタブで開き、ポインター環境ではそのままEmbedを利用できるように変更しました。基本的にはIssueの通りです。
現行のバージョンでは、ホバー時の演出(ブラー等)がありますが、タップ環境ではポインタが存在せずブラーの表示ができないため演出は全て削除しました。
また、Accessibilityについてタップ環境ではembedの操作ができないためtab-indexに-1を定義し、ポインター環境では0を定義しています。