mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-11 22:40:26 +01:00
Get everything working
This commit is contained in:
@@ -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);
|
||||
},
|
||||
}),
|
||||
),
|
||||
|
||||
@@ -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" />,
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user