Add search and RAG workspace flows
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import type { LucideIcon } from 'lucide-react';
|
||||
import { Activity, BookOpenText, ChartCandlestick, Eye, Landmark, LineChart, LogOut, Menu } from 'lucide-react';
|
||||
import { Activity, BookOpenText, ChartCandlestick, Eye, Landmark, LineChart, LogOut, Menu, Search } from 'lucide-react';
|
||||
import Link from 'next/link';
|
||||
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
@@ -76,6 +76,16 @@ const NAV_ITEMS: NavConfigItem[] = [
|
||||
preserveTicker: true,
|
||||
mobilePrimary: true
|
||||
},
|
||||
{
|
||||
id: 'search',
|
||||
href: '/search',
|
||||
label: 'Search',
|
||||
icon: Search,
|
||||
group: 'research',
|
||||
matchMode: 'exact',
|
||||
preserveTicker: true,
|
||||
mobilePrimary: false
|
||||
},
|
||||
{
|
||||
id: 'portfolio',
|
||||
href: '/portfolio',
|
||||
@@ -167,6 +177,13 @@ function buildDefaultBreadcrumbs(pathname: string, activeTicker: string | null)
|
||||
];
|
||||
}
|
||||
|
||||
if (pathname.startsWith('/search')) {
|
||||
return [
|
||||
{ label: 'Analysis', href: analysisHref },
|
||||
{ label: 'Search' }
|
||||
];
|
||||
}
|
||||
|
||||
if (pathname.startsWith('/portfolio')) {
|
||||
return [{ label: 'Portfolio' }];
|
||||
}
|
||||
@@ -289,6 +306,13 @@ export function AppShell({ title, subtitle, actions, activeTicker, breadcrumbs,
|
||||
return;
|
||||
}
|
||||
|
||||
if (href.startsWith('/search')) {
|
||||
if (context.activeTicker) {
|
||||
void queryClient.prefetchQuery(companyAnalysisQueryOptions(context.activeTicker));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (href.startsWith('/portfolio')) {
|
||||
void queryClient.prefetchQuery(holdingsQueryOptions());
|
||||
void queryClient.prefetchQuery(portfolioSummaryQueryOptions());
|
||||
@@ -366,7 +390,7 @@ export function AppShell({ title, subtitle, actions, activeTicker, breadcrumbs,
|
||||
<div className="ambient-grid" aria-hidden="true" />
|
||||
<div className="noise-layer" aria-hidden="true" />
|
||||
|
||||
<div className="relative z-10 mx-auto flex min-h-screen w-full max-w-[1300px] gap-6 px-4 pb-12 pt-6 md:px-8">
|
||||
<div className="relative z-10 mx-auto flex min-h-screen w-full max-w-[1300px] gap-4 px-3 pb-10 pt-4 sm:px-4 sm:pb-12 sm:pt-6 md:px-8 lg:gap-6">
|
||||
<aside className="hidden w-72 shrink-0 flex-col gap-6 rounded-2xl border border-[color:var(--line-weak)] bg-[color:var(--panel)] p-5 shadow-[0_0_0_1px_rgba(0,255,180,0.06),0_20px_60px_rgba(1,4,10,0.55)] lg:flex">
|
||||
<div>
|
||||
<p className="terminal-caption text-xs uppercase tracking-[0.25em] text-[color:var(--terminal-muted)]">Fiscal Clone</p>
|
||||
@@ -421,8 +445,8 @@ export function AppShell({ title, subtitle, actions, activeTicker, breadcrumbs,
|
||||
</aside>
|
||||
|
||||
<div className="min-w-0 flex-1 pb-24 lg:pb-0">
|
||||
<header className="relative mb-4 rounded-2xl border border-[color:var(--line-weak)] bg-[color:var(--panel)] px-6 py-5 pr-20 shadow-[0_0_0_1px_rgba(0,255,180,0.05),0_14px_40px_rgba(1,4,10,0.5)]">
|
||||
<div className="absolute right-5 top-5 z-10">
|
||||
<header className="relative mb-4 rounded-2xl border border-[color:var(--line-weak)] bg-[color:var(--panel)] px-4 py-4 pr-16 shadow-[0_0_0_1px_rgba(0,255,180,0.05),0_14px_40px_rgba(1,4,10,0.5)] sm:px-6 sm:py-5 sm:pr-20">
|
||||
<div className="absolute right-4 top-4 z-10 sm:right-5 sm:top-5">
|
||||
<TaskNotificationsTrigger
|
||||
unreadCount={notifications.unreadCount}
|
||||
isPopoverOpen={notifications.isPopoverOpen}
|
||||
@@ -438,17 +462,17 @@ export function AppShell({ title, subtitle, actions, activeTicker, breadcrumbs,
|
||||
markTaskRead={notifications.markTaskRead}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-start justify-between gap-4">
|
||||
<div>
|
||||
<div className="flex flex-col gap-4 sm:flex-row sm:flex-wrap sm:items-start sm:justify-between">
|
||||
<div className="min-w-0 pr-6 sm:pr-0">
|
||||
<p className="terminal-caption text-xs uppercase tracking-[0.3em] text-[color:var(--terminal-muted)]">Live System</p>
|
||||
<h2 className="mt-2 text-2xl font-semibold text-[color:var(--terminal-bright)] md:text-3xl">{title}</h2>
|
||||
<h2 className="mt-2 text-xl font-semibold text-[color:var(--terminal-bright)] sm:text-2xl md:text-3xl">{title}</h2>
|
||||
{subtitle ? (
|
||||
<p className="mt-1 text-sm text-[color:var(--terminal-muted)]">{subtitle}</p>
|
||||
) : null}
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<div className="flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:flex-wrap sm:items-center sm:justify-end">
|
||||
{actions}
|
||||
<Button variant="ghost" onClick={() => void signOut()} disabled={isSigningOut}>
|
||||
<Button variant="ghost" className="max-sm:hidden sm:inline-flex lg:hidden" onClick={() => void signOut()} disabled={isSigningOut}>
|
||||
<LogOut className="size-4" />
|
||||
{isSigningOut ? 'Signing out...' : 'Sign out'}
|
||||
</Button>
|
||||
@@ -458,9 +482,9 @@ export function AppShell({ title, subtitle, actions, activeTicker, breadcrumbs,
|
||||
|
||||
<nav
|
||||
aria-label="Breadcrumb"
|
||||
className="mb-6 rounded-xl border border-[color:var(--line-weak)] bg-[color:var(--panel)] px-3 py-2"
|
||||
className="mb-6 overflow-x-auto rounded-xl border border-[color:var(--line-weak)] bg-[color:var(--panel)] px-3 py-2"
|
||||
>
|
||||
<ol className="flex flex-wrap items-center gap-2 text-xs text-[color:var(--terminal-muted)]">
|
||||
<ol className="flex min-w-max items-center gap-2 text-xs text-[color:var(--terminal-muted)] sm:min-w-0 sm:flex-wrap">
|
||||
{breadcrumbItems.map((item, index) => {
|
||||
const isLast = index === breadcrumbItems.length - 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user