Revert "fix: sidebar selection highlight and scoped command palette search"
This reverts commit 4168a6d45b.
This commit is contained in:
@@ -98,17 +98,11 @@ function LayoutContent() {
|
|||||||
const { open: paletteOpen, setOpen: setPaletteOpen } = useCommandPalette();
|
const { open: paletteOpen, setOpen: setPaletteOpen } = useCommandPalette();
|
||||||
const { scope, setTab } = useScope();
|
const { scope, setTab } = useScope();
|
||||||
|
|
||||||
// Exchange full-text search via command palette (scoped to current sidebar selection)
|
// Exchange full-text search via command palette
|
||||||
const [paletteQuery, setPaletteQuery] = useState('');
|
const [paletteQuery, setPaletteQuery] = useState('');
|
||||||
const debouncedQuery = useDebouncedValue(paletteQuery, 300);
|
const debouncedQuery = useDebouncedValue(paletteQuery, 300);
|
||||||
const { data: exchangeResults } = useSearchExecutions(
|
const { data: exchangeResults } = useSearchExecutions(
|
||||||
{
|
{ text: debouncedQuery || undefined, offset: 0, limit: 10 },
|
||||||
text: debouncedQuery || undefined,
|
|
||||||
application: scope.appId || undefined,
|
|
||||||
routeId: scope.routeId || undefined,
|
|
||||||
offset: 0,
|
|
||||||
limit: 10,
|
|
||||||
},
|
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -249,17 +243,13 @@ function LayoutContent() {
|
|||||||
navigate(`${baseParts.join('/')}?text=${encodeURIComponent(query)}`);
|
navigate(`${baseParts.join('/')}?text=${encodeURIComponent(query)}`);
|
||||||
}, [navigate, scope.appId, scope.routeId]);
|
}, [navigate, scope.appId, scope.routeId]);
|
||||||
|
|
||||||
// Translate Sidebar's internal paths to our URL structure.
|
// Translate Sidebar's internal paths to our URL structure
|
||||||
// Pass `sidebarReveal` state so the Sidebar can highlight the selected entry
|
|
||||||
// (it compares its internal /apps/... paths against this state value).
|
|
||||||
const handleSidebarNavigate = useCallback((path: string) => {
|
const handleSidebarNavigate = useCallback((path: string) => {
|
||||||
const state = { sidebarReveal: path };
|
|
||||||
|
|
||||||
// /apps/:appId and /apps/:appId/:routeId → current tab
|
// /apps/:appId and /apps/:appId/:routeId → current tab
|
||||||
const appMatch = path.match(/^\/apps\/([^/]+)(?:\/(.+))?$/);
|
const appMatch = path.match(/^\/apps\/([^/]+)(?:\/(.+))?$/);
|
||||||
if (appMatch) {
|
if (appMatch) {
|
||||||
const [, sAppId, sRouteId] = appMatch;
|
const [, sAppId, sRouteId] = appMatch;
|
||||||
navigate(sRouteId ? `/${scope.tab}/${sAppId}/${sRouteId}` : `/${scope.tab}/${sAppId}`, { state });
|
navigate(sRouteId ? `/${scope.tab}/${sAppId}/${sRouteId}` : `/${scope.tab}/${sAppId}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,11 +257,11 @@ function LayoutContent() {
|
|||||||
const agentMatch = path.match(/^\/agents\/([^/]+)(?:\/(.+))?$/);
|
const agentMatch = path.match(/^\/agents\/([^/]+)(?:\/(.+))?$/);
|
||||||
if (agentMatch) {
|
if (agentMatch) {
|
||||||
const [, sAppId, sInstanceId] = agentMatch;
|
const [, sAppId, sInstanceId] = agentMatch;
|
||||||
navigate(sInstanceId ? `/runtime/${sAppId}/${sInstanceId}` : `/runtime/${sAppId}`, { state });
|
navigate(sInstanceId ? `/runtime/${sAppId}/${sInstanceId}` : `/runtime/${sAppId}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
navigate(path, { state });
|
navigate(path);
|
||||||
}, [navigate, scope.tab]);
|
}, [navigate, scope.tab]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user