Get everything working

This commit is contained in:
Gregory Schier
2025-12-28 15:01:15 -08:00
parent 7446d62e39
commit 3c45464e34
11 changed files with 51 additions and 90 deletions

View File

@@ -38,7 +38,6 @@ import { getGrpcRequestActions } from '../hooks/useGrpcRequestActions';
import { useHotKey } from '../hooks/useHotKey';
import { getHttpRequestActions } from '../hooks/useHttpRequestActions';
import { getWebSocketRequestActions } from '../hooks/useWebSocketRequestActions';
import { getWorkspaceActions } from '../hooks/useWorkspaceActions';
import { getFolderActions } from '../hooks/useFolderActions';
import { useListenToTauriEvent } from '../hooks/useListenToTauriEvent';
import { getModelAncestors } from '../hooks/useModelAncestors';
@@ -388,24 +387,13 @@ function Sidebar({ className }: { className?: string }) {
if (request != null) await a.call(request);
},
})),
...(items.length === 1 && child.model === 'workspace'
? await getWorkspaceActions()
: []
).map((a) => ({
label: a.label,
leftSlot: <Icon icon={a.icon ?? 'empty'} />,
onSelect: async () => {
const model = getModel(child.model, child.id);
if (model != null) await a.call(model as any);
},
})),
...(items.length === 1 && child.model === 'folder' ? await getFolderActions() : []).map(
(a) => ({
label: a.label,
leftSlot: <Icon icon={a.icon ?? 'empty'} />,
onSelect: async () => {
const model = getModel(child.model, child.id);
if (model != null) await a.call(model as any);
const model = getModel('folder', child.id);
if (model != null) await a.call(model);
},
}),
),

View File

@@ -14,6 +14,7 @@ import {
} from '../hooks/useActiveWorkspace';
import { useCreateWorkspace } from '../hooks/useCreateWorkspace';
import { useDeleteSendHistory } from '../hooks/useDeleteSendHistory';
import { useWorkspaceActions } from '../hooks/useWorkspaceActions';
import { showDialog } from '../lib/dialog';
import { jotaiStore } from '../lib/jotai';
import { revealInFinderText } from '../lib/reveal';
@@ -36,6 +37,7 @@ export const WorkspaceActionsDropdown = memo(function WorkspaceActionsDropdown({
const createWorkspace = useCreateWorkspace();
const workspaceMeta = useAtomValue(activeWorkspaceMetaAtom);
const { mutate: deleteSendHistory } = useDeleteSendHistory();
const workspaceActions = useWorkspaceActions();
const { workspaceItems, itemsAfter } = useMemo<{
workspaceItems: RadioDropdownItem[];
@@ -49,6 +51,14 @@ export const WorkspaceActionsDropdown = memo(function WorkspaceActionsDropdown({
}));
const itemsAfter: DropdownItem[] = [
...workspaceActions.map((a) => ({
label: a.label,
leftSlot: <Icon icon={a.icon ?? 'empty'} />,
onSelect: async () => {
if (workspace != null) await a.call(workspace);
},
})),
...(workspaceActions.length > 0 ? [{ type: 'separator' as const }] : []),
{
label: 'Workspace Settings',
leftSlot: <Icon icon="settings" />,

View File

@@ -1,3 +1,5 @@
// biome-ignore-all lint/suspicious/noTemplateCurlyInString: We're testing this, specifically
import { describe, expect, test } from 'vitest';
import { parser } from './twig';