MCPcopy Create free account
hub / github.com/esengine/esengine / StatusBar

Function StatusBar

packages/editor-app/src/components/StatusBar.tsx:25–346  ·  view source on GitHub ↗
({
    pluginCount = 0,
    entityCount = 0,
    messageHub,
    logService,
    locale = 'en',
    projectPath,
    onOpenScene,
    onDockContentBrowser,
    onResetLayout
}: StatusBarProps)

Source from the content-addressed store, hash-verified

23type ActiveTab = 'output' | 'cmd';
24
25export function StatusBar({
26 pluginCount = 0,
27 entityCount = 0,
28 messageHub,
29 logService,
30 locale = 'en',
31 projectPath,
32 onOpenScene,
33 onDockContentBrowser,
34 onResetLayout
35}: StatusBarProps) {
36 const { t } = useLocale();
37 const [consoleInput, setConsoleInput] = useState('');
38 const [activeTab, setActiveTab] = useState<ActiveTab>('output');
39 const [contentDrawerOpen, setContentDrawerOpen] = useState(false);
40 const [outputLogDrawerOpen, setOutputLogDrawerOpen] = useState(false);
41 const [contentDrawerHeight, setContentDrawerHeight] = useState(300);
42 const [outputLogDrawerHeight, setOutputLogDrawerHeight] = useState(300);
43 const [isResizingContent, setIsResizingContent] = useState(false);
44 const [isResizingOutputLog, setIsResizingOutputLog] = useState(false);
45 const [revealPath, setRevealPath] = useState<string | null>(null);
46 const inputRef = useRef<HTMLInputElement>(null);
47 const startY = useRef(0);
48 const startHeight = useRef(0);
49
50 // Subscribe to asset:reveal event
51 useEffect(() => {
52 if (!messageHub) return;
53
54 const unsubscribe = messageHub.subscribe('asset:reveal', (payload: { path: string }) => {
55 if (payload.path) {
56 // Generate unique key to force re-trigger even with same path
57 setRevealPath(`${payload.path}?t=${Date.now()}`);
58 setContentDrawerOpen(true);
59 setOutputLogDrawerOpen(false);
60 }
61 });
62
63 return unsubscribe;
64 }, [messageHub]);
65
66 // Clear revealPath when drawer closes
67 useEffect(() => {
68 if (!contentDrawerOpen) {
69 setRevealPath(null);
70 }
71 }, [contentDrawerOpen]);
72
73 const handleSelectPanel = useCallback((panelId: string) => {
74 if (messageHub) {
75 messageHub.publish('panel:select', { panelId });
76 }
77 }, [messageHub]);
78
79 const handleContentDrawerClick = useCallback(() => {
80 setContentDrawerOpen(!contentDrawerOpen);
81 if (!contentDrawerOpen) {
82 setOutputLogDrawerOpen(false);

Callers

nothing calls this directly

Calls 11

useLocaleFunction · 0.90
nowMethod · 0.80
subscribeMethod · 0.65
publishMethod · 0.65
clearMethod · 0.65
focusMethod · 0.45
infoMethod · 0.45
warnMethod · 0.45
errorMethod · 0.45
addEventListenerMethod · 0.45
removeEventListenerMethod · 0.45

Tested by

no test coverage detected