File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Popover } from '@base-ui/react/popover' ;
22import { useLingui } from '@lingui/react/macro' ;
33import * as stylex from '@stylexjs/stylex' ;
4+ import { useRef } from 'react' ;
45
56import ButtonIcon from '../elements/ButtonIcon' ;
67import { usePlayerState } from '../hooks/usePlayer' ;
@@ -16,6 +17,7 @@ export default function Header() {
1617 const trackPlaying = usePlayingTrack ( ) ;
1718 const { t } = useLingui ( ) ;
1819 const platform = window . __MUSEEKS_PLATFORM ;
20+ const queueAnchorRef = useRef < HTMLDivElement > ( null ) ;
1921
2022 return (
2123 < header
@@ -41,7 +43,7 @@ export default function Header() {
4143 < >
4244 < PlayingBar trackPlaying = { trackPlaying } />
4345 < Popover . Root >
44- < div { ...stylex . props ( styles . queue ) } >
46+ < div ref = { queueAnchorRef } { ...stylex . props ( styles . queue ) } >
4547 < Popover . Trigger
4648 render = { ( triggerProps ) => (
4749 < ButtonIcon
@@ -55,7 +57,12 @@ export default function Header() {
5557 />
5658 </ div >
5759 < Popover . Portal >
58- < Popover . Positioner side = "bottom" align = "end" >
60+ < Popover . Positioner
61+ side = "bottom"
62+ alignOffset = { - 16 }
63+ align = "end"
64+ anchor = { queueAnchorRef }
65+ >
5966 < Popover . Popup { ...stylex . props ( styles . queueContainer ) } >
6067 < Queue queue = { queue } queueCursor = { queueCursor } />
6168 </ Popover . Popup >
Original file line number Diff line number Diff line change @@ -106,14 +106,12 @@ function Status() {
106106 { isScanning ? (
107107 t `scanning tracks...`
108108 ) : (
109- < ProgressBar progress = { progress } />
109+ < ProgressBar
110+ progress = { progress }
111+ label = { total > 0 ? `${ current } / ${ total } ` : '' }
112+ />
110113 ) }
111114 </ div >
112- { total > 0 && (
113- < div { ...stylex . props ( styles . statusLibraryRefreshCount ) } >
114- { current } / { total }
115- </ div >
116- ) }
117115 </ div >
118116 ) ;
119117 }
@@ -199,9 +197,5 @@ const styles = stylex.create({
199197 } ,
200198 statusLibraryRefreshProgress : {
201199 flex : '1' ,
202- marginRight : '10px' ,
203- } ,
204- statusLibraryRefreshCount : {
205- fontVariantNumeric : 'tabular-nums' ,
206200 } ,
207201} ) ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import * as stylex from '@stylexjs/stylex';
33
44type Props = {
55 progress ?: number ;
6+ label : string ;
67} ;
78
89export default function ProgressBar ( props : Props ) {
@@ -17,16 +18,22 @@ export default function ProgressBar(props: Props) {
1718 style = { { width : `${ props . progress ?? 0 } %` } }
1819 />
1920 </ Progress . Track >
21+ < Progress . Label { ...stylex . props ( styles . progressLabel ) } >
22+ { props . label }
23+ </ Progress . Label >
2024 </ Progress . Root >
2125 ) ;
2226}
2327
2428const styles = stylex . create ( {
2529 progress : {
2630 flex : '1' ,
27- display : 'block' ,
31+ display : 'flex' ,
32+ gap : '12px' ,
33+ alignItems : 'center' ,
2834 } ,
2935 progressTrack : {
36+ flexGrow : 1 ,
3037 height : '6px' ,
3138 backgroundColor : 'var(--progress-bg)' ,
3239 } ,
@@ -35,4 +42,10 @@ const styles = stylex.create({
3542 backgroundColor : 'var(--main-color)' ,
3643 transition : 'width 0.2s ease-in-out' ,
3744 } ,
45+ progressLabel : {
46+ flexShrink : 0 ,
47+ fontSize : '12px' ,
48+ color : 'var(--text-color)' ,
49+ fontVariantNumeric : 'tabular-nums' ,
50+ } ,
3851} ) ;
Original file line number Diff line number Diff line change @@ -63,11 +63,11 @@ msgstr "Try <0>reloading the app</0>,"
6363msgid "or if it happens again, please <0>report an issue</0>."
6464msgstr "or if it happens again, please <0>report an issue</0>."
6565
66- #: src/components/Header.tsx:22
66+ #: src/components/Header.tsx:24
6767msgid "Header"
6868msgstr "Header"
6969
70- #: src/components/Header.tsx:51
70+ #: src/components/Header.tsx:53
7171msgid "Queue"
7272msgstr "Queue"
7373
Original file line number Diff line number Diff line change @@ -63,11 +63,11 @@ msgstr "Intenta <0>recargar la aplicación</0>,"
6363msgid "or if it happens again, please <0>report an issue</0>."
6464msgstr "o si vuelve a ocurrir, por favor <0>reporta un problema</0>."
6565
66- #: src/components/Header.tsx:22
66+ #: src/components/Header.tsx:24
6767msgid "Header"
6868msgstr ""
6969
70- #: src/components/Header.tsx:51
70+ #: src/components/Header.tsx:53
7171msgid "Queue"
7272msgstr "Cola"
7373
Original file line number Diff line number Diff line change @@ -63,11 +63,11 @@ msgstr "Essayez de <0>recharger l'application</0>,"
6363msgid "or if it happens again, please <0>report an issue</0>."
6464msgstr "ou si cela se reproduit, veuillez <0>signaler un problème</0>."
6565
66- #: src/components/Header.tsx:22
66+ #: src/components/Header.tsx:24
6767msgid "Header"
6868msgstr ""
6969
70- #: src/components/Header.tsx:51
70+ #: src/components/Header.tsx:53
7171msgid "Queue"
7272msgstr "File d'attente"
7373
Original file line number Diff line number Diff line change @@ -63,11 +63,11 @@ msgstr "<0>アプリを再読み込み</0>してみてください、"
6363msgid "or if it happens again, please <0>report an issue</0>."
6464msgstr "また同じことが起こった場合は、<0>問題を報告してください</0>。"
6565
66- #: src/components/Header.tsx:22
66+ #: src/components/Header.tsx:24
6767msgid "Header"
6868msgstr ""
6969
70- #: src/components/Header.tsx:51
70+ #: src/components/Header.tsx:53
7171msgid "Queue"
7272msgstr "キュー"
7373
Original file line number Diff line number Diff line change @@ -63,11 +63,11 @@ msgstr "Попробуйте <0>перезагрузить приложение<
6363msgid "or if it happens again, please <0>report an issue</0>."
6464msgstr "Если это случится снова, пожалуйста, <0>заявите об ошибке</0>."
6565
66- #: src/components/Header.tsx:22
66+ #: src/components/Header.tsx:24
6767msgid "Header"
6868msgstr ""
6969
70- #: src/components/Header.tsx:51
70+ #: src/components/Header.tsx:53
7171msgid "Queue"
7272msgstr "Очередь"
7373
Original file line number Diff line number Diff line change @@ -63,11 +63,11 @@ msgstr "尝试 <0>重新加载应用程序</0>,"
6363msgid "or if it happens again, please <0>report an issue</0>."
6464msgstr "如果再次发生,请<0>报告问题</0>。"
6565
66- #: src/components/Header.tsx:22
66+ #: src/components/Header.tsx:24
6767msgid "Header"
6868msgstr ""
6969
70- #: src/components/Header.tsx:51
70+ #: src/components/Header.tsx:53
7171msgid "Queue"
7272msgstr "播放队列"
7373
Original file line number Diff line number Diff line change @@ -63,11 +63,11 @@ msgstr "嘗試 <0>重新載入應用程式</0>,"
6363msgid "or if it happens again, please <0>report an issue</0>."
6464msgstr "如果再次發生,請<0>回報問題</0>。"
6565
66- #: src/components/Header.tsx:22
66+ #: src/components/Header.tsx:24
6767msgid "Header"
6868msgstr ""
6969
70- #: src/components/Header.tsx:51
70+ #: src/components/Header.tsx:53
7171msgid "Queue"
7272msgstr "播放佇列"
7373
You can’t perform that action at this time.
0 commit comments