Skip to content

Commit 29720a4

Browse files
committed
More Domain Specific
1 parent 6ca57bb commit 29720a4

3 files changed

Lines changed: 332 additions & 19 deletions

File tree

UI/src/App.jsx

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useState } from 'react';
22
import {
33
Radar,
4+
Home as HomeIcon,
45
LayoutDashboard,
56
AlertOctagon,
67
Link as LinkIcon,
@@ -28,6 +29,7 @@ import { strings, format } from './lib/strings';
2829
import { Badge, ReportSelector } from './components';
2930
import ThemeToggle from './components/ThemeToggle.jsx';
3031
import Overview from './views/Overview';
32+
import Home from './views/Home';
3133
import Issues from './views/Issues';
3234
import Links from './views/Links';
3335
import Redirects from './views/Redirects';
@@ -44,6 +46,7 @@ import SqlPlayground from './views/SqlPlayground.jsx';
4446
import BrowserMlChat from './components/ml/BrowserMlChat.jsx';
4547

4648
const VIEW_CONFIG = [
49+
{ id: 'home', component: Home, icon: HomeIcon },
4750
{ id: 'overview', component: Overview, icon: LayoutDashboard },
4851
{ id: 'model-loader', component: ModelLoader, icon: Sparkles },
4952
{ id: 'sql-playground', component: SqlPlayground, icon: Database },
@@ -67,7 +70,7 @@ const VIEWS = VIEW_CONFIG.map((v) => ({
6770
}));
6871

6972
function AppContent() {
70-
const [view, setView] = useState('overview');
73+
const [view, setView] = useState('home');
7174
const [searchQuery, setSearchQuery] = useState('');
7275
const [sidebarOpen, setSidebarOpen] = useState(false);
7376
const { data, loading, error } = useReport();
@@ -78,8 +81,10 @@ function AppContent() {
7881
closeSidebar();
7982
};
8083

81-
const CurrentView = VIEWS.find((v) => v.id === view)?.component || Overview;
84+
const CurrentView = VIEWS.find((v) => v.id === view)?.component || Home;
8285
const isLabView = view === 'model-loader' || view === 'sql-playground';
86+
const isHomeView = view === 'home';
87+
const showSidebar = !isHomeView;
8388
const issueCount = data?.categories?.reduce((n, c) => n + (c.issues?.length || 0), 0) ?? 0;
8489
const securityCount = data?.security_findings?.length ?? 0;
8590

@@ -113,9 +118,9 @@ function AppContent() {
113118
const sections = [...new Set(VIEWS.map((v) => v.section))];
114119

115120
return (
116-
<div className="min-h-screen flex bg-brand-900 text-foreground overflow-hidden">
121+
<div className={`min-h-screen bg-brand-900 text-foreground overflow-hidden ${showSidebar ? 'flex' : 'block'}`}>
117122
{/* Overlay when sidebar open (full-screen lab views; mobile-only on other views) */}
118-
{sidebarOpen && (
123+
{showSidebar && sidebarOpen && (
119124
<button
120125
type="button"
121126
aria-label={strings.app.ariaCloseMenu}
@@ -126,7 +131,7 @@ function AppContent() {
126131
/>
127132
)}
128133

129-
<aside
134+
{showSidebar && <aside
130135
className={`inset-y-0 left-0 w-64 bg-brand-800 border-r border-muted flex flex-col h-screen shrink-0 z-40 shadow-xl print:hidden transition-transform duration-200 ease-out ${
131136
isLabView
132137
? `fixed ${sidebarOpen ? 'translate-x-0' : '-translate-x-full'}`
@@ -204,10 +209,10 @@ function AppContent() {
204209
<span>{strings.app.githubLinkLabel}</span>
205210
</a>
206211
</div>
207-
</aside>
212+
</aside>}
208213

209214
<main className="flex-1 flex flex-col h-screen overflow-hidden bg-brand-900 relative min-w-0">
210-
{isLabView ? (
215+
{showSidebar && isLabView ? (
211216
<button
212217
type="button"
213218
aria-label={strings.app.ariaOpenMenu}
@@ -219,18 +224,20 @@ function AppContent() {
219224
) : null}
220225
<header
221226
className={`h-16 border-b border-muted bg-brand-800/80 backdrop-blur-md flex items-center justify-between gap-3 px-4 sm:px-6 shrink-0 z-10 print:hidden ${
222-
isLabView ? 'hidden' : ''
227+
isLabView || isHomeView ? 'hidden' : ''
223228
}`}
224229
>
225-
<button
226-
type="button"
227-
aria-label={strings.app.ariaOpenMenu}
228-
className="md:hidden p-2 -ml-2 text-muted-foreground hover:text-bright rounded-lg shrink-0"
229-
onClick={() => setSidebarOpen(true)}
230-
>
231-
<Menu className="h-6 w-6" />
232-
</button>
233-
<div className="flex-1 min-w-0 max-w-xl relative">
230+
{showSidebar ? (
231+
<button
232+
type="button"
233+
aria-label={strings.app.ariaOpenMenu}
234+
className="md:hidden p-2 -ml-2 text-muted-foreground hover:text-bright rounded-lg shrink-0"
235+
onClick={() => setSidebarOpen(true)}
236+
>
237+
<Menu className="h-6 w-6" />
238+
</button>
239+
) : null}
240+
<div className={`min-w-0 relative ${showSidebar ? 'flex-1 max-w-xl' : 'flex-1 max-w-2xl mx-auto'}`}>
234241
<Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
235242
<input
236243
type="text"
@@ -251,10 +258,10 @@ function AppContent() {
251258
id="viewContainer"
252259
>
253260
<div className={`fade-in ${isLabView ? 'flex min-h-0 flex-1 flex-col' : ''}`}>
254-
<CurrentView searchQuery={searchQuery} />
261+
<CurrentView searchQuery={searchQuery} onNavigate={selectView} />
255262
</div>
256263
</div>
257-
{!isLabView ? <BrowserMlChat /> : null}
264+
{!isLabView && !isHomeView ? <BrowserMlChat /> : null}
258265
</main>
259266
</div>
260267
);

UI/src/strings.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
"themeGroupLabel": "Color theme"
1818
},
1919
"nav": {
20+
"home": {
21+
"label": "Home",
22+
"section": "Audit Overview"
23+
},
2024
"overview": {
2125
"label": "Dashboard",
2226
"section": "Audit Overview"
@@ -840,6 +844,25 @@
840844
"ariaSocialIntro": "Social preview coverage on HTML pages:",
841845
"statusAriaIntro": "Status:"
842846
},
847+
"home": {
848+
"title": "Home",
849+
"subtitle": "Choose a domain to open the full dashboard view.",
850+
"unknownBrand": "Unknown Domain",
851+
"searchPlaceholder": "Search Domain or crawl URLs...",
852+
"totalBrandsLabel": "Domain",
853+
"totalUrlsLabel": "Total URLs",
854+
"avgHealthLabel": "Average Health",
855+
"brandLabel": "Domain",
856+
"crawlUrlLabel": "Crawling URL",
857+
"urlCountLabel": "URLs",
858+
"healthScoreLabel": "Health Score",
859+
"lastCrawlLabel": "Last Crawl",
860+
"statusBreakdownLabel": "Status Breakdown",
861+
"otherStatusPill": "Other {count}",
862+
"openBrandCta": "Open",
863+
"noSearchResults": "No Domain match your search.",
864+
"empty": "No crawl URLs available to group by domain yet."
865+
},
843866
"contentAnalytics": {
844867
"title": "Content Insights",
845868
"subtitle": "Word count, readability, content-to-HTML ratio, top keywords, social meta coverage, crawl health, and on-page flags.",

0 commit comments

Comments
 (0)