Sidebar filtering

This commit is contained in:
Gregory Schier
2026-03-11 15:55:25 -07:00
parent 0c52fd03e2
commit d4a6735881
2 changed files with 63 additions and 10 deletions

View File

@@ -15,13 +15,13 @@ import { createStore, Provider, useAtomValue } from 'jotai';
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { ActionButton } from './ActionButton';
import { Sidebar } from './Sidebar';
import { filteredExchangesAtom, Sidebar } from './Sidebar';
import './main.css';
import type { ProxyHeader } from '@yaakapp-internal/proxy-lib';
import { initHotkeys } from './hotkeys';
import { listen, rpc } from './rpc';
import { useRpcQueryWithEvent } from './rpc-hooks';
import type { ProxyHeader } from '@yaakapp-internal/proxy-lib';
import { applyChange, dataAtom, httpExchangesAtom, replaceAll } from './store';
import { applyChange, dataAtom, replaceAll } from './store';
const queryClient = new QueryClient();
const jotaiStore = createStore();
@@ -43,7 +43,7 @@ listen('model_write', (payload) => {
function App() {
const osType = type();
const exchanges = useAtomValue(httpExchangesAtom);
const exchanges = useAtomValue(filteredExchangesAtom);
const { data: proxyState } = useRpcQueryWithEvent('get_proxy_state', {}, 'proxy_state_changed');
const isRunning = proxyState?.state === 'running';
@@ -136,7 +136,13 @@ function StatusBadge({ status, error }: { status: number | null; error: string |
if (status == null) return <span className="text-xs text-text-subtlest"></span>;
const color =
status >= 500 ? 'text-danger' : status >= 400 ? 'text-warning' : status >= 300 ? 'text-notice' : 'text-success';
status >= 500
? 'text-danger'
: status >= 400
? 'text-warning'
: status >= 300
? 'text-notice'
: 'text-success';
return <span className={classNames('text-xs font-mono', color)}>{status}</span>;
}