fix(views): improve mobile responsiveness for agents and settings (#2036)

* feat(agents): make agent detail page mobile responsive (#1)

Stack the inspector + overview pane vertically below md, switch the
shell to page-level scroll so the inspector flows naturally, give the
overview pane a min-h-[60vh] floor so tabs stay usable, and let the
5-tab nav scroll horizontally on narrow viewports.

* fix(settings): make Repositories tab and Settings shell mobile-responsive (#2)

The Settings shell used a fixed w-52 sidebar with no responsive behavior,
leaving almost no room for tab content on phone-width viewports. Stack the
nav above the content on mobile, scale inner padding, and let the
Repositories tab's input/button rows wrap rather than overflow.
This commit is contained in:
Dingyj3178
2026-05-04 22:24:07 +09:00
committed by GitHub
parent c24191a884
commit a57dd76faf
5 changed files with 20 additions and 16 deletions

View File

@@ -93,7 +93,7 @@ export function AgentDetailInspector({
const isOnline = runtime?.status === "online";
return (
<aside className="flex h-full min-h-0 w-full flex-col overflow-y-auto rounded-lg border bg-background">
<aside className="flex w-full flex-col rounded-lg border bg-background md:h-full md:min-h-0 md:overflow-y-auto">
{/* Identity */}
<div className="flex flex-col gap-3 border-b px-5 pb-5 pt-5">
<AvatarEditor agent={agent} canEdit={canEdit} onUpdate={update} />

View File

@@ -204,7 +204,7 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {
</div>
)}
<div className="grid flex-1 min-h-0 grid-cols-[320px_minmax(0,1fr)] gap-4 p-6">
<div className="flex flex-1 min-h-0 flex-col gap-3 overflow-y-auto p-3 md:grid md:grid-cols-[320px_minmax(0,1fr)] md:gap-4 md:overflow-hidden md:p-6">
<AgentDetailInspector
agent={agent}
runtime={runtime}
@@ -358,7 +358,7 @@ function DetailLoadingSkeleton() {
<PageHeader className="px-5">
<Skeleton className="h-5 w-48" />
</PageHeader>
<div className="grid flex-1 min-h-0 grid-cols-[320px_minmax(0,1fr)] gap-4 p-6">
<div className="flex flex-1 min-h-0 flex-col gap-3 overflow-y-auto p-3 md:grid md:grid-cols-[320px_minmax(0,1fr)] md:gap-4 md:overflow-hidden md:p-6">
<div className="flex flex-col gap-4 rounded-lg border p-5">
<Skeleton className="h-14 w-14 rounded-lg" />
<Skeleton className="h-5 w-40" />

View File

@@ -108,14 +108,14 @@ export function AgentOverviewPane({
};
return (
<div className="flex h-full min-h-0 flex-col overflow-hidden rounded-lg border bg-background">
<div className="flex shrink-0 items-center gap-0 border-b px-4">
<div className="flex min-h-[60vh] flex-col overflow-hidden rounded-lg border bg-background md:h-full md:min-h-0">
<div className="flex shrink-0 items-center gap-0 overflow-x-auto border-b px-2 md:px-4">
{detailTabs.map((tab) => (
<button
key={tab.id}
type="button"
onClick={() => requestTabChange(tab.id)}
className={`flex items-center gap-1.5 border-b-2 px-3 py-2.5 text-xs font-medium transition-colors ${
className={`flex shrink-0 items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2.5 text-xs font-medium transition-colors ${
activeTab === tab.id
? "border-foreground text-foreground"
: "border-transparent text-muted-foreground hover:text-foreground"
@@ -204,6 +204,6 @@ export function AgentOverviewPane({
// list) still scrolls via the parent's overflow-y-auto.
function TabContent({ children }: { children: React.ReactNode }) {
return (
<div className="mx-auto flex h-full max-w-2xl flex-col p-6">{children}</div>
<div className="mx-auto flex h-full max-w-2xl flex-col p-4 md:p-6">{children}</div>
);
}

View File

@@ -73,14 +73,14 @@ export function RepositoriesTab() {
</p>
{repos.map((repo, index) => (
<div key={index} className="flex gap-2">
<div key={index} className="flex items-start gap-2">
<Input
type="url"
value={repo.url}
onChange={(e) => handleRepoChange(index, e.target.value)}
disabled={!canManageWorkspace}
placeholder="https://git.example.com/org/repo.git"
className="flex-1 text-sm"
className="flex-1 min-w-0 text-sm"
/>
{canManageWorkspace && (
<Button
@@ -96,7 +96,7 @@ export function RepositoriesTab() {
))}
{canManageWorkspace && (
<div className="flex items-center justify-between pt-1">
<div className="flex flex-wrap items-center justify-between gap-2 pt-1">
<Button variant="outline" size="sm" onClick={handleAddRepo}>
<Plus className="h-3 w-3" />
Add repository

View File

@@ -43,11 +43,15 @@ export function SettingsPage({ extraAccountTabs }: SettingsPageProps = {}) {
const workspaceName = useCurrentWorkspace()?.name;
return (
<Tabs defaultValue="profile" orientation="vertical" className="flex-1 min-h-0 gap-0">
{/* Left nav */}
<div className="w-52 shrink-0 border-r overflow-y-auto p-4">
<Tabs
defaultValue="profile"
orientation="vertical"
className="flex-1 min-h-0 gap-0 flex flex-col md:flex-row md:overflow-hidden overflow-y-auto"
>
{/* Left nav (stacks on top on mobile, sidebar on md+) */}
<div className="shrink-0 md:w-52 border-b md:border-b-0 md:border-r md:overflow-y-auto p-3 md:p-4">
<h1 className="text-sm font-semibold mb-4 px-2">Settings</h1>
<TabsList variant="line" className="flex-col items-stretch">
<TabsList variant="line" className="flex-col items-stretch w-full">
{/* My Account group */}
<span className="px-2 pb-1 pt-2 text-xs font-medium text-muted-foreground">
My Account
@@ -79,8 +83,8 @@ export function SettingsPage({ extraAccountTabs }: SettingsPageProps = {}) {
</div>
{/* Right content */}
<div className="flex-1 min-w-0 overflow-y-auto">
<div className="w-full max-w-3xl mx-auto p-6">
<div className="flex-1 min-w-0 md:overflow-y-auto">
<div className="w-full max-w-3xl mx-auto p-4 md:p-6">
<TabsContent value="profile"><AccountTab /></TabsContent>
<TabsContent value="appearance"><AppearanceTab /></TabsContent>
<TabsContent value="notifications"><NotificationsTab /></TabsContent>