+
+
Next songs on the queue
({count()})
@@ -99,10 +97,9 @@ const SongQueue: Component = () => {
song={s}
group={group}
selectable={true}
- draggable={true}
onSelect={() => window.api.request("queue::play", s.path)}
onDrop={onDrop(s)}
- contextMenu={}
+ contextMenu={}
/>
)}
/>
@@ -111,13 +108,21 @@ const SongQueue: Component = () => {
);
};
-const QueueContextMenuContent: Component = () => {
+type QueueContextMenuContentProps = { song: Song };
+const QueueContextMenuContent: Component = (props) => {
return (
-
- Add to Playlist
- Remove from queue
- {/*
- */}
+
+
+ Add to Playlist
+
+
+ window.api.request("queue::removeSong", props.song.path)}
+ class="text-red"
+ >
+ Remove from queue
+
+
);
};
diff --git a/src/renderer/src/lib/roving-focus-group/rovingFocusGroup.ts b/src/renderer/src/lib/roving-focus-group/rovingFocusGroup.ts
index f6367af7..3c631e8c 100644
--- a/src/renderer/src/lib/roving-focus-group/rovingFocusGroup.ts
+++ b/src/renderer/src/lib/roving-focus-group/rovingFocusGroup.ts
@@ -1,5 +1,5 @@
import useControllableState from "../controllable-state";
-import { Accessor, createMemo, createSignal } from "solid-js";
+import { Accessor, createMemo, createSignal, onMount } from "solid-js";
const ITEM_DATA_ATTR = "data-item";
const DEFAULT_SELECTED_VALUE = "";
@@ -34,10 +34,26 @@ export function useRovingFocusGroup(props: Params) {
setHasMounted(true);
};
+ const findOrderedNodes = () => {
+ return Array.from(container.querySelectorAll(`[${ITEM_DATA_ATTR}]:not([disabled])`));
+ };
+
+ onMount(() => {
+ if (currentStopId()) {
+ return;
+ }
+
+ const [firstNode] = findOrderedNodes();
+ if (!canFocus(firstNode)) {
+ return;
+ }
+
+ firstNode.focus();
+ setCurrentStopId(firstNode.getAttribute(ITEM_DATA_ATTR)!);
+ });
+
const handleKeyUp = (event: KeyboardEvent) => {
- const orderedNodes = Array.from(
- container.querySelectorAll(`[${ITEM_DATA_ATTR}]:not([disabled])`),
- );
+ const orderedNodes = findOrderedNodes();
const currentlySelectedNodeIndex = orderedNodes.findIndex(
(node) => node.getAttribute(ITEM_DATA_ATTR) === currentStopId(),
);
diff --git a/src/renderer/src/scenes/main-scene/MainScene.tsx b/src/renderer/src/scenes/main-scene/MainScene.tsx
index c6fef583..686e7756 100644
--- a/src/renderer/src/scenes/main-scene/MainScene.tsx
+++ b/src/renderer/src/scenes/main-scene/MainScene.tsx
@@ -6,8 +6,10 @@ import { song } from "@renderer/components/song/song.utils";
import { WindowsControls } from "@renderer/components/windows-control/WindowsControl";
import { os } from "@renderer/lib/os";
import { Layers3Icon } from "lucide-solid";
-import { Component, JSX, Match, Switch } from "solid-js";
+import { Component, createSignal, Match, Switch } from "solid-js";
import { Sidebar } from "./Sidebar";
+import Popover from "@renderer/components/popover/Popover";
+import SongQueue from "@renderer/components/song/song-queue/SongQueue";
const MainScene: Component = () => {
return (
@@ -39,7 +41,7 @@ const MainScene: Component = () => {
class="absolute inset-0 bg-cover bg-fixed bg-left-top opacity-30 blur-lg filter"
/>
-
+
@@ -56,8 +58,36 @@ const MainScene: Component = () => {
);
};
+const Queue: Component = () => {
+ const [isOpen, setIsOpen] = createSignal(false);
+
+ return (
+
+ setIsOpen(true)} class="no-drag absolute right-2 top-2">
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
const MacNav: Component = () => {
- return
;
+ return
;
};
const WindownsNav: Component = () => {
@@ -68,12 +98,4 @@ const WindownsNav: Component = () => {
);
};
-const QueueIcon: Component
= (props) => {
- return (
-
- );
-};
-
export default MainScene;