Files
claudecodeui/src/components/main-content/view/subcomponents/MainContentHeader.tsx
Simos Mikelatos 19e4bf9d80 chore: remove computer use (re-applied after main merge)
The merge of main into this branch (0907d87) hit a modify/delete conflict
for the computer-use module — main removed it in 6761f31 while this branch
had extended it — and the conflict was resolved by keeping the branch's
copies, silently resurrecting the whole feature.

This re-applies 6761f31's removal on top of the browser-use work:
- deletes the computer-use server module, client panel, settings tab,
  desktop-agent websocket service, electron computerAgent, and the
  computer-semantics build scripts
- strips computer-use wiring from shared files (server/index.js, electron
  launcher/main, MainContent, settings, i18n) while preserving browser-use
- removes src/constants/featureFlags.ts (existed only for the CU menu flag)

browser-use (camoufox/noVNC) is untouched. typecheck passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 15:54:22 +00:00

74 lines
2.6 KiB
TypeScript

import { useCallback, useRef, useState, useEffect } from 'react';
import type { MainContentHeaderProps } from '../../types/types';
import MobileMenuButton from './MobileMenuButton';
import MainContentTabSwitcher from './MainContentTabSwitcher';
import MainContentTitle from './MainContentTitle';
export default function MainContentHeader({
activeTab,
setActiveTab,
selectedProject,
selectedSession,
shouldShowTasksTab,
shouldShowBrowserTab,
isMobile,
onMenuClick,
}: MainContentHeaderProps) {
const scrollRef = useRef<HTMLDivElement>(null);
const [canScrollLeft, setCanScrollLeft] = useState(false);
const [canScrollRight, setCanScrollRight] = useState(false);
const updateScrollState = useCallback(() => {
const el = scrollRef.current;
if (!el) return;
setCanScrollLeft(el.scrollLeft > 2);
setCanScrollRight(el.scrollLeft < el.scrollWidth - el.clientWidth - 2);
}, []);
useEffect(() => {
const el = scrollRef.current;
if (!el) return;
updateScrollState();
const observer = new ResizeObserver(updateScrollState);
observer.observe(el);
return () => observer.disconnect();
}, [updateScrollState]);
return (
<div className="pwa-header-safe flex-shrink-0 border-b border-border/60 bg-background px-3 py-1.5 sm:px-4 sm:py-2">
<div className="flex items-center justify-between gap-3">
<div className="flex min-w-0 flex-1 items-center gap-2">
{isMobile && <MobileMenuButton onMenuClick={onMenuClick} />}
<MainContentTitle
activeTab={activeTab}
selectedProject={selectedProject}
selectedSession={selectedSession}
shouldShowTasksTab={shouldShowTasksTab}
/>
</div>
<div className="relative min-w-0 flex-shrink overflow-hidden sm:flex-shrink-0">
{canScrollLeft && (
<div className="pointer-events-none absolute inset-y-0 left-0 z-10 w-6 bg-gradient-to-r from-background to-transparent" />
)}
<div
ref={scrollRef}
onScroll={updateScrollState}
className="scrollbar-hide overflow-x-auto"
>
<MainContentTabSwitcher
activeTab={activeTab}
setActiveTab={setActiveTab}
shouldShowTasksTab={shouldShowTasksTab}
shouldShowBrowserTab={shouldShowBrowserTab}
/>
</div>
{canScrollRight && (
<div className="pointer-events-none absolute inset-y-0 right-0 z-10 w-6 bg-gradient-to-l from-background to-transparent" />
)}
</div>
</div>
</div>
);
}