feat(v2): remove old dashboard, add vitae + resizable windows
- Removed old Recharts dashboard view entirely (no more viewMode toggle, DashboardView lazy import, Ctrl+D shortcut) - Recharts chunk eliminated from build — bundle size reduced - Player Dashboard window: added Vitae column (red when > 0%) - ALL windows now resizable: drag bottom-right corner handle (min 300×200px). Subtle diagonal line grip indicator. - Sidebar: removed 📊 Dashboard toggle link, removed broken /quest-status.html external link (replaced by 📜 Quests window) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
938421999a
commit
a5bd659876
37 changed files with 168 additions and 178 deletions
|
|
@ -1,45 +1,10 @@
|
|||
import { useState, lazy, Suspense, useEffect } from 'react';
|
||||
import { useEffect } from 'react';
|
||||
import { MapLayout } from './components/map/MapLayout';
|
||||
import { useLiveData } from './hooks/useLiveData';
|
||||
import './styles/global.css';
|
||||
import './styles/map-layout.css';
|
||||
|
||||
// Lazy-load dashboard view (contains Recharts ~400KB) — only loaded when user switches to dashboard
|
||||
const DashboardView = lazy(() => import('./DashboardView'));
|
||||
|
||||
type ViewMode = 'map' | 'dashboard';
|
||||
|
||||
export default function App() {
|
||||
const [viewMode, setViewMode] = useState<ViewMode>(
|
||||
() => (localStorage.getItem('v2-view') as ViewMode) || 'map'
|
||||
);
|
||||
const data = useLiveData();
|
||||
|
||||
// Ctrl+D toggles map/dashboard
|
||||
useEffect(() => {
|
||||
const handler = (e: KeyboardEvent) => {
|
||||
if (e.ctrlKey && e.key === 'd') {
|
||||
e.preventDefault();
|
||||
toggleView();
|
||||
}
|
||||
};
|
||||
window.addEventListener('keydown', handler);
|
||||
return () => window.removeEventListener('keydown', handler);
|
||||
});
|
||||
|
||||
const toggleView = () => {
|
||||
const next = viewMode === 'map' ? 'dashboard' : 'map';
|
||||
setViewMode(next);
|
||||
localStorage.setItem('v2-view', next);
|
||||
};
|
||||
|
||||
if (viewMode === 'map') {
|
||||
return <MapLayout data={data} onViewToggle={toggleView} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<Suspense fallback={<div style={{ background: '#0d0d0d', color: '#888', padding: 40, textAlign: 'center' }}>Loading dashboard...</div>}>
|
||||
<DashboardView data={data} onViewToggle={toggleView} />
|
||||
</Suspense>
|
||||
);
|
||||
return <MapLayout data={data} />;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue