mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-09 15:07:10 +02:00
refactor: remove unused commands
This commit is contained in:
@@ -361,18 +361,6 @@ function useDynamicTitle(window: WindowInstance): WindowTitleData {
|
||||
return getCommandDescription(props.cmd) || `${props.cmd} manual`;
|
||||
}, [appId, props]);
|
||||
|
||||
// Feed title
|
||||
const feedTitle = useMemo(() => {
|
||||
if (appId !== "feed") return null;
|
||||
return "Feed";
|
||||
}, [appId]);
|
||||
|
||||
// Win viewer title
|
||||
const winTitle = useMemo(() => {
|
||||
if (appId !== "win") return null;
|
||||
return "Windows";
|
||||
}, [appId]);
|
||||
|
||||
// Kinds viewer title
|
||||
const kindsTitle = useMemo(() => {
|
||||
if (appId !== "kinds") return null;
|
||||
@@ -448,14 +436,6 @@ function useDynamicTitle(window: WindowInstance): WindowTitleData {
|
||||
// Use the specific command's icon, not the generic "man" icon
|
||||
icon = getCommandIcon(props.cmd);
|
||||
tooltip = rawCommand;
|
||||
} else if (feedTitle) {
|
||||
title = feedTitle;
|
||||
icon = getCommandIcon("feed");
|
||||
tooltip = rawCommand;
|
||||
} else if (winTitle) {
|
||||
title = winTitle;
|
||||
icon = getCommandIcon("win");
|
||||
tooltip = rawCommand;
|
||||
} else if (kindsTitle) {
|
||||
title = kindsTitle;
|
||||
icon = getCommandIcon("kinds");
|
||||
@@ -487,8 +467,6 @@ function useDynamicTitle(window: WindowInstance): WindowTitleData {
|
||||
decodeTitle,
|
||||
nipTitle,
|
||||
manTitle,
|
||||
feedTitle,
|
||||
winTitle,
|
||||
kindsTitle,
|
||||
debugTitle,
|
||||
connTitle,
|
||||
|
||||
@@ -12,8 +12,6 @@ import DecodeViewer from "./DecodeViewer";
|
||||
import { RelayViewer } from "./RelayViewer";
|
||||
import KindRenderer from "./KindRenderer";
|
||||
import KindsViewer from "./KindsViewer";
|
||||
import Feed from "./nostr/Feed";
|
||||
import { WinViewer } from "./WinViewer";
|
||||
import { DebugViewer } from "./DebugViewer";
|
||||
import ConnViewer from "./ConnViewer";
|
||||
|
||||
@@ -94,12 +92,6 @@ export function WindowRenderer({ window, onClose }: WindowRendererProps) {
|
||||
case "nip":
|
||||
content = <NipRenderer nipId={window.props.number} />;
|
||||
break;
|
||||
case "feed":
|
||||
content = <Feed className="h-full w-full overflow-auto" />;
|
||||
break;
|
||||
case "win":
|
||||
content = <WinViewer />;
|
||||
break;
|
||||
case "kind":
|
||||
content = <KindRenderer kind={parseInt(window.props.number)} />;
|
||||
break;
|
||||
|
||||
@@ -20,9 +20,7 @@ export function reconstructCommand(window: WindowInstance): string {
|
||||
return "kinds";
|
||||
|
||||
case "man":
|
||||
return props.cmd && props.cmd !== "help"
|
||||
? `man ${props.cmd}`
|
||||
: "help";
|
||||
return props.cmd && props.cmd !== "help" ? `man ${props.cmd}` : "help";
|
||||
|
||||
case "profile": {
|
||||
// Try to encode pubkey as npub for readability
|
||||
@@ -73,15 +71,9 @@ export function reconstructCommand(window: WindowInstance): string {
|
||||
return reconstructReqCommand(props);
|
||||
}
|
||||
|
||||
case "feed":
|
||||
return reconstructFeedCommand(props);
|
||||
|
||||
case "debug":
|
||||
return "debug";
|
||||
|
||||
case "win":
|
||||
return "win";
|
||||
|
||||
default:
|
||||
return appId; // Fallback to just the command name
|
||||
}
|
||||
@@ -150,7 +142,11 @@ function reconstructReqCommand(props: any): string {
|
||||
|
||||
// Generic tags
|
||||
for (const [key, value] of Object.entries(filter)) {
|
||||
if (key.startsWith("#") && key.length === 2 && !["#e", "#p", "#t", "#d"].includes(key)) {
|
||||
if (
|
||||
key.startsWith("#") &&
|
||||
key.length === 2 &&
|
||||
!["#e", "#p", "#t", "#d"].includes(key)
|
||||
) {
|
||||
const letter = key[1];
|
||||
const values = value as string[];
|
||||
if (values.length > 0) {
|
||||
@@ -185,12 +181,3 @@ function reconstructReqCommand(props: any): string {
|
||||
|
||||
return parts.join(" ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Reconstructs a feed command from its props.
|
||||
*/
|
||||
function reconstructFeedCommand(props: any): string {
|
||||
// Feed command structure depends on implementation
|
||||
// This is a best-effort reconstruction
|
||||
return "feed";
|
||||
}
|
||||
|
||||
@@ -7,8 +7,6 @@ export type AppId =
|
||||
| "kind"
|
||||
| "kinds"
|
||||
| "man"
|
||||
| "feed"
|
||||
| "win"
|
||||
| "req"
|
||||
//| "event"
|
||||
| "open"
|
||||
|
||||
Reference in New Issue
Block a user