Skip to content

⭐️⭐️⭐️ Open-source, self-hosted alternative to Linear and Plane. Project management and issue tracking where teams and AI agents work side by side to plan and ship products.

fix(web): fit the header, initiatives and inbox on a mobile screen (#90)

Crofffecce5ff1af7
diff --git a/apps/web/src/components/layout/AppHeader.tsx b/apps/web/src/components/layout/AppHeader.tsx
index 6f4c9e04..891fdf7d 100644
--- a/apps/web/src/components/layout/AppHeader.tsx
+++ b/apps/web/src/components/layout/AppHeader.tsx
@@ -40,7 +40,7 @@ export default function AppHeader({
type="button"
onClick={onOpenCommand}
title={`Search or run a command (${paletteKey})`}
- className="ml-auto flex h-8 max-w-xs min-w-0 flex-1 items-center gap-2 rounded-md border px-3 text-sm text-muted-foreground transition-colors hover:bg-accent"
+ className="ml-auto flex size-8 shrink-0 items-center justify-center rounded-md border text-sm text-muted-foreground transition-colors hover:bg-accent sm:w-auto sm:max-w-xs sm:min-w-0 sm:flex-1 sm:shrink sm:justify-start sm:gap-2 sm:px-3"
>
<Search className="size-4 shrink-0" />
<span className="hidden truncate sm:inline">Search or run a command…</span>
diff --git a/apps/web/src/features/inbox/InboxPage.tsx b/apps/web/src/features/inbox/InboxPage.tsx
index 086e03ca..94221cc9 100644
--- a/apps/web/src/features/inbox/InboxPage.tsx
+++ b/apps/web/src/features/inbox/InboxPage.tsx
@@ -4,7 +4,8 @@ import { useShell } from '@/context/shellContext';
import InboxView from './components/InboxView';
// The per-project inbox (/project/:projectKey/inbox): a list of the session user's
-// notifications for this project on the left, the selected issue on the right.
+// notifications for this project on the left, the selected issue on the right. On a
+// narrow screen only one of the two is on screen at a time.
export default function InboxPage() {
const { project } = useShell();
if (!project) return null;
diff --git a/apps/web/src/features/inbox/components/InboxDetail.tsx b/apps/web/src/features/inbox/components/InboxDetail.tsx
new file mode 100644
index 00000000..5678af17
--- /dev/null
+++ b/apps/web/src/features/inbox/components/InboxDetail.tsx
@@ -0,0 +1,42 @@
+import { ChevronLeft } from 'lucide-react';
+import type { ProjectDetail } from '@/lib/api';
+import { Button } from '@/components/ui/button';
+import IssueDetailContent from '@/features/issue/components/detail/IssueDetailContent';
+
+// The issue of the selected notification. On a narrow screen it takes the whole
+// inbox and returns to the list through the back button; on a wide one it is the
+// right pane next to the list.
+export default function InboxDetail({
+ project,
+ issueId,
+ isMobile,
+ onBack,
+ onDeleted,
+}: {
+ project: ProjectDetail;
+ issueId: number;
+ isMobile: boolean;
+ onBack: () => void;
+ onDeleted: () => void;
+}) {
+ return (
+ <div className="flex min-h-0 flex-1 flex-col">
+ {isMobile && (
+ <div className="flex h-11 shrink-0 items-center border-b px-2">
+ <Button variant="ghost" size="sm" className="gap-1.5" onClick={onBack}>
+ <ChevronLeft className="size-4" />
+ Inbox
+ </Button>
+ </div>
+ )}
+ <div className="min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-6 sm:py-6 xl:px-10">
+ <IssueDetailContent
+ project={project}
+ issueId={issueId}
+ layout={isMobile ? 'panel' : 'split'}
+ onDeleted={onDeleted}
+ />
+ </div>
+ </div>
+ );
+}
diff --git a/apps/web/src/features/inbox/components/InboxView.tsx b/apps/web/src/features/inbox/components/InboxView.tsx
index 826a090f..98e57c8d 100644
--- a/apps/web/src/features/inbox/components/InboxView.tsx
+++ b/apps/web/src/features/inbox/components/InboxView.tsx
@@ -2,12 +2,14 @@
import { useMemo, useState } from 'react';
import { api, type Notification, type ProjectDetail } from '@/lib/api';
+import { cn } from '@/lib/utils';
import { qk } from '@/services/queryKeys';
import { useLiveRefresh } from '@/hooks/useLiveRefresh';
import { useInboxUnread } from '@/hooks/useInboxUnread';
-import IssueDetailContent from '@/features/issue/components/detail/IssueDetailContent';
+import { useIsMobile } from '@/hooks/use-mobile';
import InboxToolbar from './InboxToolbar';
import InboxList from './InboxList';
+import InboxDetail from './InboxDetail';
import { useInboxFilters } from '../hooks/useInboxFilters';
import {
useNotificationsQuery,
@@ -24,6 +26,7 @@ export default function InboxView({ project }: { project: ProjectDetail }) {
const { filters, changeFilters } = useInboxFilters(projectKey);
const [selected, setSelected] = useState<Notification | null>(null);
+ const isMobile = useIsMobile();
const query = useNotificationsQuery(projectKey, projectId, filters);
const unreadQuery = useInboxUnread(projectKey, projectId);
@@ -54,7 +57,12 @@ export default function InboxView({ project }: { project: ProjectDetail }) {
return (
<div className="flex h-full min-h-0">
- <div className="flex w-full max-w-sm min-w-0 flex-col border-r">
+ <div
+ className={cn(
+ 'flex w-full min-w-0 flex-col md:max-w-sm md:border-r',
+ selected && 'hidden md:flex',
+ )}
+ >
<InboxToolbar
unread={unreadQuery.data ?? 0}
filters={filters}
@@ -77,23 +85,20 @@ export default function InboxView({ project }: { project: ProjectDetail }) {
/>
</div>
- <div className="min-h-0 flex-1 overflow-y-auto">
- {selected ? (
- <div className="px-6 py-6 xl:px-10">
- <IssueDetailContent
- key={selected.issueId}
- project={project}
- issueId={selected.issueId}
- layout="split"
- onDeleted={() => setSelected(null)}
- />
- </div>
- ) : (
- <div className="flex h-full items-center justify-center text-sm text-muted-foreground">
- Select a notification
- </div>
- )}
- </div>
+ {selected ? (
+ <InboxDetail
+ key={selected.issueId}
+ project={project}
+ issueId={selected.issueId}
+ isMobile={isMobile}
+ onBack={() => setSelected(null)}
+ onDeleted={() => setSelected(null)}
+ />
+ ) : (
+ <div className="hidden flex-1 items-center justify-center text-sm text-muted-foreground md:flex">
+ Select a notification
+ </div>
+ )}
</div>
);
}
diff --git a/apps/web/src/features/initiatives/InitiativesPage.tsx b/apps/web/src/features/initiatives/InitiativesPage.tsx
index a3dfafed..272e54d9 100644
--- a/apps/web/src/features/initiatives/InitiativesPage.tsx
+++ b/apps/web/src/features/initiatives/InitiativesPage.tsx
@@ -110,12 +110,12 @@ export default function InitiativesPage({ tab }: { tab: InitiativesTab }) {
)}
</div>
- <div className="px-4 pb-2">
+ <div className="min-w-0 px-4 pb-2">
{/* The open tab comes from the route, and each trigger navigates on click
(see InitiativeTabTrigger), so Radix drives no selection of its own:
manual activation keeps focus from switching tabs mid-drag. */}
<Tabs value={tab} activationMode="manual">
- <TabsList variant="line">
+ <TabsList variant="line" className="overflow-x-auto">
<DndContext
sensors={sensors}
collisionDetection={closestCenter}
diff --git a/apps/web/src/features/initiatives/components/list/InitiativeTabTrigger.tsx b/apps/web/src/features/initiatives/components/list/InitiativeTabTrigger.tsx
index 0aee2ed4..94f0b9f9 100644
--- a/apps/web/src/features/initiatives/components/list/InitiativeTabTrigger.tsx
+++ b/apps/web/src/features/initiatives/components/list/InitiativeTabTrigger.tsx
@@ -31,7 +31,7 @@ export default function InitiativeTabTrigger({
ref={setNodeRef}
value={value}
style={{ transform: CSS.Transform.toString(transform), transition }}
- className="cursor-grab"
+ className="shrink-0 cursor-grab"
{...pointerListeners}
onClick={onSelect}
>
diff --git a/apps/web/src/features/initiatives/components/list/InitiativesList.tsx b/apps/web/src/features/initiatives/components/list/InitiativesList.tsx
index 9438fefb..3d2f624f 100644
--- a/apps/web/src/features/initiatives/components/list/InitiativesList.tsx
+++ b/apps/web/src/features/initiatives/components/list/InitiativesList.tsx
@@ -67,7 +67,7 @@ export default function InitiativesList({
}
return (
- <div className="px-4 pb-2">
+ <div className="min-w-0 px-4 pb-2">
<Table className="min-w-[880px] table-fixed">
<colgroup>
<col className="w-[34%]" />