From 64a2ba2751dd5398feaf25f94482604f5b1021ba Mon Sep 17 00:00:00 2001 From: Michael Freno Date: Sat, 7 Feb 2026 22:30:51 -0500 Subject: [PATCH] simple --- src/App.tsx | 44 ++++++++------------------------ src/context/ThemeContext.test.ts | 8 ------ src/hooks/useAppKeyboard.ts | 32 ----------------------- src/utils/navigation.ts | 13 +++++----- 4 files changed, 17 insertions(+), 80 deletions(-) delete mode 100644 src/context/ThemeContext.test.ts delete mode 100644 src/hooks/useAppKeyboard.ts diff --git a/src/App.tsx b/src/App.tsx index 6494ea0..08b59f3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,15 +1,12 @@ import { createSignal, createMemo, ErrorBoundary, Accessor } from "solid-js"; -import { useSelectionHandler } from "@opentui/solid"; +import { useKeyboard, useSelectionHandler } from "@opentui/solid"; import { TabNavigation } from "./components/TabNavigation"; - import { CodeValidation } from "@/components/CodeValidation"; - import { useAuthStore } from "@/stores/auth"; import { useFeedStore } from "@/stores/feed"; import { useAudio } from "@/hooks/useAudio"; import { useMultimediaKeys } from "@/hooks/useMultimediaKeys"; import { FeedVisibility } from "@/types/feed"; -import { useAppKeyboard } from "@/hooks/useAppKeyboard"; import { Clipboard } from "@/utils/clipboard"; import { useToast } from "@/ui/toast"; import { useRenderer } from "@opentui/solid"; @@ -34,6 +31,7 @@ export function App() { const audio = useAudio(); const toast = useToast(); const renderer = useRenderer(); + const { theme } = useTheme(); useMultimediaKeys({ playerFocused: () => activeTab() === TABS.PLAYER && layerDepth() > 0, @@ -47,35 +45,6 @@ export function App() { setLayerDepth(1); }; - useAppKeyboard({ - layerDepth, - onAction: (action, direction) => { - if (action == "cycle") { - if (direction == DIRECTION.Increment) { - //if() - } - if (direction == DIRECTION.Decrement) { - } - } - if (action == "depth") { - if (direction == DIRECTION.Increment) { - } - if (direction == DIRECTION.Decrement) { - } - } - - if (action === "escape") { - if (layerDepth() > 0) { - setLayerDepth(0); - setInputFocused(false); - } else { - setShowAuthPanel(false); - setInputFocused(false); - } - } - }, - }); - useSelectionHandler((selection: any) => { if (!selection) return; const text = selection.getSelectedText?.(); @@ -91,7 +60,14 @@ export function App() { }); }); - const { theme } = useTheme(); + //useKeyboard( + //(keyEvent) => { + ////handle intra layer navigation + //if(keyEvent.name == "up" || keyEvent.name) + //}, + //{ release: false }, // Not strictly necessary + //); + return ( ( diff --git a/src/context/ThemeContext.test.ts b/src/context/ThemeContext.test.ts deleted file mode 100644 index b87f850..0000000 --- a/src/context/ThemeContext.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { describe, expect, it } from "bun:test" -import { ThemeProvider } from "./ThemeContext" - -describe("ThemeContext", () => { - it("exports provider", () => { - expect(typeof ThemeProvider).toBe("function") - }) -}) diff --git a/src/hooks/useAppKeyboard.ts b/src/hooks/useAppKeyboard.ts deleted file mode 100644 index 917779f..0000000 --- a/src/hooks/useAppKeyboard.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Centralized keyboard shortcuts hook for PodTUI - * Single handler to prevent conflicts - */ - -import { TabId } from "@/components/TabNavigation"; -import { useKeyboard, useRenderer } from "@opentui/solid"; -import type { Accessor } from "solid-js"; - -type ShortcutOptions = { - onAction?: (action: string, direction: Direction) => void; - layerDepth: Accessor; -}; - -export function useAppKeyboard(props: ShortcutOptions) { - const renderer = useRenderer(); - - // layer depth 0 is tabs, they are oriented - // vertically, all others are vertically - useKeyboard((key) => { - // handle cycle current layer - if (props.layerDepth() == 0) { - let reverse = false; - if (key.shift) { - reverse = true; - } - if (key.name == "tab" || key.name == "down" || key.name == "j") { - } - } - // handle cycle depth - }); -} diff --git a/src/utils/navigation.ts b/src/utils/navigation.ts index 36b06cd..e152777 100644 --- a/src/utils/navigation.ts +++ b/src/utils/navigation.ts @@ -11,13 +11,14 @@ export enum DIRECTION { } export enum TABS { - FEED, - MYSHOWS, - DISCOVER, - SEARCH, - PLAYER, - SETTINGS, + FEED = 1, + MYSHOWS = 2, + DISCOVER = 3, + SEARCH = 4, + PLAYER = 5, + SETTINGS = 6, } +export const TabsCount = 6; export const LayerGraph = { [TABS.FEED]: FeedPage,