Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

feat: UI improvements for mobile and layout

Bosch787a561158cc
diff --git a/dashboard/src/components/molecules/NavBar.tsx b/dashboard/src/components/molecules/NavBar.tsx
index 2f2b305d..83583eb6 100644
--- a/dashboard/src/components/molecules/NavBar.tsx
+++ b/dashboard/src/components/molecules/NavBar.tsx
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useRef, useState } from "react";
-import { NavLink } from "react-router-dom";
+import { NavLink, useLocation } from "react-router-dom";
import "./NavBar.css";
interface Tab {
@@ -21,7 +21,14 @@ interface NavBarProps {
export default function NavBar({ onRefresh }: NavBarProps) {
const [refreshing, setRefreshing] = useState(false);
+ const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
const tabsRef = useRef<HTMLElement>(null);
+ const location = useLocation();
+
+ // Close mobile menu on route change
+ useEffect(() => {
+ setMobileMenuOpen(false);
+ }, [location]);
const handleRefresh = useCallback(() => {
if (!onRefresh || refreshing) return;
@@ -49,41 +56,73 @@ export default function NavBar({ onRefresh }: NavBarProps) {
}, [onRefresh, handleRefresh]);
return (
- <header className="sticky top-0 z-50 flex h-[52px] items-center gap-0 border-b border-border-subtle bg-bg-app px-4">
- <span className="min-w-32 text-sm font-semibold tracking-wide text-text-primary">
- PinchTab
- </span>
+ <header className="sticky top-0 z-50 border-b border-border-subtle bg-bg-app">
+ <div className="flex h-[52px] items-center gap-0 px-4">
+ <span className="min-w-32 text-sm font-semibold tracking-wide text-text-primary">
+ PinchTab
+ </span>
- <nav className="ml-6 flex items-center gap-0.5" ref={tabsRef}>
- {tabs.map((tab, i) => (
- <NavLink
- key={tab.id}
- to={tab.path}
- className={({ isActive }) =>
- `navbar-tab relative cursor-pointer border-none bg-transparent px-3.5 py-3.5 text-sm font-medium leading-none whitespace-nowrap transition-colors duration-150 hover:text-text-primary focus-visible:rounded focus-visible:shadow-[0_0_0_2px_var(--primary)/25] focus-visible:outline-none ${
- isActive ? "active text-text-primary" : "text-text-secondary"
- }`
- }
- title={`${tab.label} (⌘${i + 1})`}
- >
- {tab.label}
- </NavLink>
- ))}
- </nav>
+ {/* Desktop nav */}
+ <nav className="ml-6 hidden items-center gap-0.5 sm:flex" ref={tabsRef}>
+ {tabs.map((tab, i) => (
+ <NavLink
+ key={tab.id}
+ to={tab.path}
+ className={({ isActive }) =>
+ `navbar-tab relative cursor-pointer border-none bg-transparent px-3.5 py-3.5 text-sm font-medium leading-none whitespace-nowrap transition-colors duration-150 hover:text-text-primary focus-visible:rounded focus-visible:shadow-[0_0_0_2px_var(--primary)/25] focus-visible:outline-none ${
+ isActive ? "active text-text-primary" : "text-text-secondary"
+ }`
+ }
+ title={`${tab.label} (⌘${i + 1})`}
+ >
+ {tab.label}
+ </NavLink>
+ ))}
+ </nav>
- <div className="ml-auto flex items-center gap-1.5">
- {onRefresh && (
+ <div className="ml-auto flex items-center gap-1.5">
+ {onRefresh && (
+ <button
+ className={`navbar-icon-btn flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-transparent bg-transparent text-base text-text-muted transition-all duration-150 hover:border-border-subtle hover:bg-bg-elevated hover:text-text-secondary focus-visible:shadow-[0_0_0_2px_var(--primary)/25] focus-visible:outline-none ${
+ refreshing ? "spinning" : ""
+ }`}
+ onClick={handleRefresh}
+ title="Refresh (⌘R)"
+ >
+ ↻
+ </button>
+ )}
+ {/* Mobile menu button */}
<button
- className={`navbar-icon-btn flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-transparent bg-transparent text-base text-text-muted transition-all duration-150 hover:border-border-subtle hover:bg-bg-elevated hover:text-text-secondary focus-visible:shadow-[0_0_0_2px_var(--primary)/25] focus-visible:outline-none ${
- refreshing ? "spinning" : ""
- }`}
- onClick={handleRefresh}
- title="Refresh (⌘R)"
+ className="flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-transparent bg-transparent text-lg text-text-muted transition-all duration-150 hover:border-border-subtle hover:bg-bg-elevated hover:text-text-secondary sm:hidden"
+ onClick={() => setMobileMenuOpen(!mobileMenuOpen)}
+ aria-label="Toggle menu"
>
- ↻
+ {mobileMenuOpen ? "✕" : "☰"}
</button>
- )}
+ </div>
</div>
+
+ {/* Mobile menu dropdown */}
+ {mobileMenuOpen && (
+ <nav className="flex flex-col border-t border-border-subtle bg-bg-surface sm:hidden">
+ {tabs.map((tab) => (
+ <NavLink
+ key={tab.id}
+ to={tab.path}
+ className={({ isActive }) =>
+ `px-4 py-3 text-sm font-medium transition-colors duration-150 ${
+ isActive
+ ? "bg-bg-elevated text-text-primary"
+ : "text-text-secondary hover:bg-bg-elevated hover:text-text-primary"
+ }`
+ }
+ >
+ {tab.label}
+ </NavLink>
+ ))}
+ </nav>
+ )}
</header>
);
}
diff --git a/dashboard/src/pages/AgentsPage.tsx b/dashboard/src/pages/AgentsPage.tsx
index 3b017ed4..64f9ed49 100644
--- a/dashboard/src/pages/AgentsPage.tsx
+++ b/dashboard/src/pages/AgentsPage.tsx
@@ -1,7 +1,7 @@
import { useEffect } from "react";
import { useAppStore } from "../stores/useAppStore";
import { EmptyState } from "../components/atoms";
-import { AgentItem, ActivityLine } from "../components/molecules";
+import { ActivityLine } from "../components/molecules";
import * as api from "../services/api";
const filters = [
@@ -48,49 +48,49 @@ export default function AgentsPage() {
});
return (
- <div className="flex flex-1">
- {/* Agents sidebar */}
- <div className="w-64 shrink-0 border-r border-border-subtle bg-bg-surface">
- <div className="border-b border-border-subtle p-3">
- <h2 className="text-sm font-semibold text-text-secondary">Agents</h2>
- </div>
- <div className="p-2">
+ <div className="flex flex-1 flex-col">
+ {/* Agents carousel */}
+ <div className="shrink-0 border-b border-border-subtle bg-bg-surface">
+ <div className="flex items-center gap-2 overflow-x-auto px-4 py-3">
+ <button
+ className={`shrink-0 rounded-full px-4 py-2 text-sm font-medium transition-all ${
+ !selectedAgentId
+ ? "bg-primary text-white"
+ : "bg-bg-elevated text-text-secondary hover:bg-bg-elevated/80"
+ }`}
+ onClick={() => setSelectedAgentId(null)}
+ >
+ All
+ </button>
{agents.length === 0 ? (
- <div className="py-8 text-center text-sm text-text-muted">
- <div className="mb-2 text-2xl">🦀</div>
- No agents connected yet
- <div className="mt-1 text-xs">
- Make an API call with{" "}
- <code className="text-primary">X-Agent-Id</code> header
- </div>
- </div>
+ <span className="shrink-0 text-sm text-text-muted">
+ 🦀 No agents yet — make an API call with{" "}
+ <code className="text-primary">X-Agent-Id</code>
+ </span>
) : (
- <div className="flex flex-col gap-1">
+ agents.map((agent) => (
<button
- className={`rounded-lg px-3 py-2 text-left text-sm transition-all ${
- !selectedAgentId
- ? "bg-primary/10 text-primary"
- : "text-text-muted hover:bg-bg-elevated"
+ key={agent.id}
+ className={`shrink-0 rounded-full px-4 py-2 text-sm font-medium transition-all ${
+ selectedAgentId === agent.id
+ ? "bg-primary text-white"
+ : "bg-bg-elevated text-text-secondary hover:bg-bg-elevated/80"
}`}
- onClick={() => setSelectedAgentId(null)}
+ onClick={() => setSelectedAgentId(agent.id)}
+ title={`${agent.requestCount} requests`}
>
- All Agents
+ {agent.name || agent.id}
+ <span className="ml-1.5 text-xs opacity-70">
+ ({agent.requestCount})
+ </span>
</button>
- {agents.map((agent) => (
- <AgentItem
- key={agent.id}
- agent={agent}
- selected={selectedAgentId === agent.id}
- onClick={() => setSelectedAgentId(agent.id)}
- />
- ))}
- </div>
+ ))
)}
</div>
</div>
{/* Activity feed */}
- <div className="flex flex-1 flex-col">
+ <div className="flex flex-1 flex-col overflow-hidden">
<div className="flex items-center justify-between border-b border-border-subtle bg-bg-surface px-4 py-2">
<h2 className="text-sm font-semibold text-text-secondary">
Activity Feed
diff --git a/dashboard/src/pages/ProfilesPage.tsx b/dashboard/src/pages/ProfilesPage.tsx
index fd0fdeb9..583730f5 100644
--- a/dashboard/src/pages/ProfilesPage.tsx
+++ b/dashboard/src/pages/ProfilesPage.tsx
@@ -145,34 +145,36 @@ export default function ProfilesPage() {
/>
<div className="flex-1 overflow-auto p-4">
- {profilesLoading && profiles.length === 0 ? (
- <div className="flex items-center justify-center py-16 text-text-muted">
- Loading profiles...
- </div>
- ) : profiles.length === 0 ? (
- <EmptyState
- title="No profiles yet"
- description="Click + New Profile to create one"
- action={
- <Button variant="primary" onClick={() => setShowCreate(true)}>
- + New Profile
- </Button>
- }
- />
- ) : (
- <div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
- {profiles.map((p) => (
- <ProfileCard
- key={p.name}
- profile={p}
- instance={instanceByProfile.get(p.name)}
- onLaunch={() => setShowLaunch(p.name)}
- onStop={() => handleStop(p.name)}
- onDetails={() => setShowDetails(p)}
- />
- ))}
- </div>
- )}
+ <div className="mx-auto max-w-2xl">
+ {profilesLoading && profiles.length === 0 ? (
+ <div className="flex items-center justify-center py-16 text-text-muted">
+ Loading profiles...
+ </div>
+ ) : profiles.length === 0 ? (
+ <EmptyState
+ title="No profiles yet"
+ description="Click + New Profile to create one"
+ action={
+ <Button variant="primary" onClick={() => setShowCreate(true)}>
+ + New Profile
+ </Button>
+ }
+ />
+ ) : (
+ <div className="grid gap-4 grid-cols-1 sm:grid-cols-2">
+ {profiles.map((p) => (
+ <ProfileCard
+ key={p.name}
+ profile={p}
+ instance={instanceByProfile.get(p.name)}
+ onLaunch={() => setShowLaunch(p.name)}
+ onStop={() => handleStop(p.name)}
+ onDetails={() => setShowDetails(p)}
+ />
+ ))}
+ </div>
+ )}
+ </div>
</div>
{/* Create Profile Modal */}
diff --git a/dashboard/src/pages/SettingsPage.tsx b/dashboard/src/pages/SettingsPage.tsx
index 1f09647e..3cdb3cc0 100644
--- a/dashboard/src/pages/SettingsPage.tsx
+++ b/dashboard/src/pages/SettingsPage.tsx
@@ -1,4 +1,4 @@
-import { useEffect, useState } from "react";
+import { useEffect, useState, useMemo } from "react";
import { useAppStore } from "../stores/useAppStore";
import { Button, Card } from "../components/atoms";
import * as api from "../services/api";
@@ -8,6 +8,12 @@ export default function SettingsPage() {
const { settings, serverInfo, setSettings, setServerInfo } = useAppStore();
const [local, setLocal] = useState<Settings>(settings);
+ // Check if settings have changed
+ const hasChanges = useMemo(
+ () => JSON.stringify(local) !== JSON.stringify(settings),
+ [local, settings],
+ );
+
// Load server info on mount (settings come from localStorage via store)
useEffect(() => {
const load = async () => {
@@ -31,13 +37,19 @@ export default function SettingsPage() {
return (
<div className="flex flex-1 flex-col overflow-auto">
- <div className="sticky top-0 z-10 flex items-center justify-end gap-2 border-b border-border-subtle bg-bg-surface px-4 py-2">
- <Button variant="secondary" onClick={handleReset}>
- Reset
- </Button>
- <Button variant="primary" onClick={handleSave}>
- Apply Settings
- </Button>
+ <div className="sticky top-0 z-10 border-b border-border-subtle bg-bg-surface px-4 py-2">
+ <div className="mx-auto flex w-full max-w-2xl items-center justify-end gap-2">
+ <Button
+ variant="secondary"
+ onClick={handleReset}
+ disabled={!hasChanges}
+ >
+ Reset
+ </Button>
+ <Button variant="primary" onClick={handleSave} disabled={!hasChanges}>
+ Apply Settings
+ </Button>
+ </div>
</div>
<div className="mx-auto w-full max-w-2xl space-y-6 p-6">