Multi-Agent Collaboration for Team and Friends
TypeScript agent-automationagent-orchestrationagent-workflowai-agentsai-collaborationai-memoryai-workforceautonomous-agentsclaude-codeclaude-code-skillscodexcoding-agentmulti-agentmultiple-agentone-person-businessone-person-companyone-person-teamopencodesolopreneur
feat(web): unify community message headers (#690)
Gener5ac704af6b08
diff --git a/src/web/readme-capture/captures/one-identity-capture.tsx b/src/web/readme-capture/captures/one-identity-capture.tsxindex 5ebc28ee4..678a5bbf1 100644--- a/src/web/readme-capture/captures/one-identity-capture.tsx+++ b/src/web/readme-capture/captures/one-identity-capture.tsx@@ -83,8 +83,8 @@ function IdentityFrame({ frame }: { frame: IdentityFrameData }) {return (<div className="flex size-full flex-col bg-background"><ChannelHeader- channel={frame.serverName}- breadcrumb={{ label: frame.activeChannel }}+ channel={frame.activeChannel}+ kind="text"rightPanel={null}onToggle={() => undefined}tools={{ members: false, threads: false, pinned: false }}diff --git a/src/web/src/components/community/channels/channel-header.navigation.test.ts b/src/web/src/components/community/channels/channel-header.navigation.test.tsindex 7aba5cb40..ef3bdbd63 100644--- a/src/web/src/components/community/channels/channel-header.navigation.test.ts+++ b/src/web/src/components/community/channels/channel-header.navigation.test.ts@@ -1,7 +1,7 @@import { createElement } from "react"import TestRenderer, { act } from "react-test-renderer"import { describe, expect, it, vi } from "vitest"-import { tid } from "@/lib/community/testids"+import { EntityIcon } from "../entity-icon"import { ChannelHeader } from "./channel-header"function render(overrides: Record<string, unknown> = {}) {@@ -19,99 +19,52 @@ function render(overrides: Record<string, unknown> = {}) {}describe("ChannelHeader hierarchy navigation", () => {- it("uses one mobile-only 44px server control and suppresses legacy Back", () => {+ it("uses one mobile-only 44px Back control for a top-level channel", () => {const onNavigate = vi.fn()- const onBack = vi.fn()const renderer = render({- mobileServer: { id: "s1", name: "Studio", icon: null, onNavigate },- onBack,+ mobileBack: onNavigate,})- const server = renderer.root.findByProps({ "data-testid": tid.channelHeaderServer("s1") })- expect(server.props).toMatchObject({- type: "button",- "aria-label": "Go to server Studio",- })- expect(server.props.className).toContain("size-11")- expect(server.props.className).toContain("sm:hidden")- expect(server.findByType("span").props.className).toContain("size-6")- act(() => server.props.onClick())+ const back = renderer.root.findByProps({ "aria-label": "Back" })+ expect(back.props.className).toContain("size-11")+ expect(back.props.className).toContain("sm:hidden")+ act(() => back.props.onClick())expect(onNavigate).toHaveBeenCalledOnce()- expect(onBack).not.toHaveBeenCalled()- expect(renderer.root.findAllByProps({ "aria-label": "Back" })).toHaveLength(0)})- it("replaces the mobile child server control with one narrow direct-parent Back", () => {- const onNavigateServer = vi.fn()+ it("uses the same mobile Back control for a direct child parent", () => {const onNavigateParent = vi.fn()const renderer = render({- mobileServer: { id: "s1", name: "Studio", icon: null, onNavigate: onNavigateServer },- onBack: onNavigateParent,- breadcrumb: {- id: "c1",- label: "Thread title",- onNavigate: onNavigateParent,- onRename: vi.fn(),- },+ mobileBack: onNavigateParent,+ channel: "Thread title",+ kind: "thread",+ onRename: vi.fn(),})- expect(renderer.root.findAllByProps({- "data-testid": tid.channelHeaderServer("s1"),- })).toHaveLength(0)const back = renderer.root.findByProps({ "aria-label": "Back" })- expect(back.props.className).toContain("h-11")- expect(back.props.className).toContain("w-8")+ expect(back.props.className).toContain("size-11")expect(back.props.className).toContain("sm:hidden")const rename = renderer.root.findByProps({ "aria-label": "Rename" })expect(rename.props.className).toContain("hidden")expect(rename.props.className).toContain("sm:inline-flex")act(() => back.props.onClick())expect(onNavigateParent).toHaveBeenCalledOnce()- expect(onNavigateServer).not.toHaveBeenCalled()})- it("preserves an uploaded server image inside the 24px mobile visual", () => {- const renderer = render({- mobileServer: {- id: "s1",- name: "Studio",- icon: "https://example.test/server.png",- onNavigate: vi.fn(),- },- })-- const server = renderer.root.findByProps({ "data-testid": tid.channelHeaderServer("s1") })- const image = server.findByType("img")- expect(image.props).toMatchObject({- src: "https://example.test/server.png",- alt: "",- className: "size-full object-cover",- })- expect(server.findByType("span").props.className).toContain("size-6")- })-- it("navigates a verified parent directly while the current child stays inert", () => {+ it("shows only the current child identity and keeps parent navigation in Back", () => {const onNavigateParent = vi.fn()const renderer = render({- channel: "general",- mobileServer: { id: "s1", name: "Studio", icon: null, onNavigate: vi.fn() },- breadcrumb: {- id: "c1",- label: "Thread title",- onNavigate: onNavigateParent,- },+ mobileBack: onNavigateParent,+ kind: "thread",+ channel: "Thread title",})- const parent = renderer.root.findByProps({ "data-testid": tid.channelHeaderParent("c1") })- expect(parent.props.className).toContain("min-w-0")- expect(parent.props.className).toContain("max-w-24")- expect(parent.props.className).toContain("sm:max-w-none")- act(() => parent.props.onClick())- expect(onNavigateParent).toHaveBeenCalledOnce()const current = renderer.root.findByProps({ title: "Thread title" })expect(current.type).toBe("span")- expect(current.props.className).toContain("min-w-8")- expect(current.props.className).toContain("sm:min-w-0")+ expect(current.props.className).toContain("min-w-0")+ expect(renderer.root.findByType(EntityIcon).props.kind).toBe("thread")+ act(() => renderer.root.findByProps({ "aria-label": "Back" }).props.onClick())+ expect(onNavigateParent).toHaveBeenCalledOnce()})it("renders only supplied panel actions in compact split mode", () => {diff --git a/src/web/src/components/community/channels/channel-header.skeleton.test.ts b/src/web/src/components/community/channels/channel-header.skeleton.test.tsindex 355322136..3a35fd73c 100644--- a/src/web/src/components/community/channels/channel-header.skeleton.test.ts+++ b/src/web/src/components/community/channels/channel-header.skeleton.test.ts@@ -5,16 +5,17 @@ import { tid } from "@/lib/community/testids"import { ChannelHeaderSkeleton } from "./channel-header"describe("ChannelHeaderSkeleton", () => {- it("renders inert mobile server-leading geometry without Back interaction", () => {+ it("renders inert mobile Back geometry without interaction", () => {const html = renderToStaticMarkup(createElement(ChannelHeaderSkeleton))- expect(html).toContain(`data-testid="${tid.channelHeaderServerLoading}"`)- expect(html).toContain('data-slot="loading-server-leading"')+ expect(html).toContain(`data-testid="${tid.messageHeaderLeadingLoading}"`)+ expect(html).toContain('data-slot="loading-mobile-leading"')+ expect(html).toContain('data-slot="message-header-identity"')+ expect(html).toContain('data-slot="message-header-actions"')expect(html).toMatch(/class="[^"]*size-11[^"]*sm:hidden[^"]*"/)expect(html).toMatch(/class="[^"]*size-6[^"]*rounded-md[^"]*"/)expect(html).toMatch(/class="[^"]*ml-1 size-7 rounded-md"/)expect(html).not.toContain("<button")expect(html).not.toContain('aria-label="Back"')- expect(html).not.toContain("loading-back-placeholder")})})diff --git a/src/web/src/components/community/channels/channel-header.title-dialog.test.ts b/src/web/src/components/community/channels/channel-header.title-dialog.test.tsindex 30e4a75df..055c28e16 100644--- a/src/web/src/components/community/channels/channel-header.title-dialog.test.ts+++ b/src/web/src/components/community/channels/channel-header.title-dialog.test.ts@@ -20,12 +20,13 @@ import { ChannelHeader } from "./channel-header"function renderHeader(onRename?: (name: string) => void | Promise<void>, titleRename = true) {return TestRenderer.create(React.createElement(ChannelHeader, {- channel: "forum",- forum: true,+ channel: "Original title",+ kind: "thread",rightPanel: null,onToggle: () => {},tools: { threads: false, pinned: false, members: false },- breadcrumb: { label: "Original title", onRename, titleRename },+ onRename,+ titleRename,}),)}diff --git a/src/web/src/components/community/channels/channel-header.tsx b/src/web/src/components/community/channels/channel-header.tsxindex 6f28a2e29..e1f7b3d79 100644--- a/src/web/src/components/community/channels/channel-header.tsx+++ b/src/web/src/components/community/channels/channel-header.tsx@@ -11,38 +11,47 @@ import { onEnterSubmit } from "@/lib/ime"import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from "@/components/ui/dialog"import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator } from "@/components/ui/dropdown-menu"import { Skeleton } from "@/components/ui/skeleton"-import { ChannelIcon } from "./channel-icon"import { EntityIcon } from "../entity-icon"import { SlugHint } from "../settings/slug-hint"import { previewSlug } from "@/lib/community/slug-preview"import { SeededBackdrop } from "@/components/avatar"import type { RightPanel } from "@/components/community/shell/panel-types"+import type { EntityKind } from "@/lib/community/models/navigation"import { CreateDialogShell } from "../settings/create-dialog-shell"import { tid } from "@/lib/community/testids"+import { MessageHeader, MessageHeaderMobileBack } from "./message-header"// Skeleton header for the loading frame between route change and channel// metadata arriving. Same h-12 footprint as <ChannelHeader> so the body below// doesn't shift when the real header lands.export function ChannelHeaderSkeleton() {return (- <header role="banner" className="flex h-12 shrink-0 items-center gap-1 border-b border-border/40 px-3">- <div- data-testid={tid.channelHeaderServerLoading}- data-slot="loading-server-leading"- aria-hidden- className="grid size-11 shrink-0 place-items-center sm:hidden"- >- <Skeleton className="size-6 rounded-md" />- </div>- <Skeleton className="size-6 rounded-md sm:ml-1" />- <Skeleton className="h-4 w-32 rounded" />- <div className="ml-auto flex items-center text-muted-foreground">- <Skeleton className="size-7 rounded-md" />- <span className="mx-1 h-5 w-px bg-border/60" aria-hidden />- <Skeleton className="size-7 rounded-md" />- <Skeleton className="ml-1 size-7 rounded-md" />- </div>- </header>+ <MessageHeader+ leading={(+ <div+ data-testid={tid.messageHeaderLeadingLoading}+ data-slot="loading-mobile-leading"+ aria-hidden+ className="grid size-11 shrink-0 place-items-center sm:hidden"+ >+ <Skeleton className="size-6 rounded-md" />+ </div>+ )}+ identity={(+ <>+ <Skeleton className="size-6 rounded-md sm:ml-1" />+ <Skeleton className="h-4 w-32 rounded" />+ </>+ )}+ actions={(+ <>+ <Skeleton className="size-7 rounded-md" />+ <span className="mx-1 h-5 w-px bg-border/60" aria-hidden />+ <Skeleton className="size-7 rounded-md" />+ <Skeleton className="ml-1 size-7 rounded-md" />+ </>+ )}+ />)}@@ -53,35 +62,25 @@ export type ChannelNotifLevel = typeof USE_SERVER_DEFAULT | NotifLevelexport function ChannelHeader({channel, rightPanel, onToggle, notifLevel, onSetNotifLevel,- breadcrumb, forum, server, mobileServer, onBack, tools,- endActions, compactActions,+ kind = "text", server, mobileBack, onBack, tools,+ onRename, titleRename, endActions, compactActions,}: {channel: string+ kind?: EntityKindrightPanel: RightPanelonToggle: (k: Exclude<RightPanel, null>) => voidnotifLevel?: ChannelNotifLevelonSetNotifLevel?: (l: ChannelNotifLevel) => void- forum?: boolean- breadcrumb?: {- id?: string- label: string- onRename?: (name: string) => void | Promise<void>- titleRename?: boolean- onNavigate?: () => void- }+ onRename?: (name: string) => void | Promise<void>+ titleRename?: booleanserver?: { id: string; name: string; icon: string | null }- mobileServer?: { id: string; name: string; icon: string | null; onNavigate: () => void }+ mobileBack?: () => voidonBack?: () => voidtools?: { threads?: boolean; pinned?: boolean; members?: boolean }endActions?: ReactNodecompactActions?: boolean}) {- // The parent-channel entity glyph (breadcrumb crumb + non-breadcrumb badge)- // is `<EntityIcon kind={...}>`. The `<ChannelIcon>` breadcrumb SEPARATOR- // below is a different glyph — leave it.- const entityKind = forum ? "forum" : "text"- const usesMobileParentBack = Boolean(onBack && mobileServer && breadcrumb)const tool = (k: Exclude<RightPanel, null>, Icon: LucideIcon, label: string) => (<Buttonvariant="ghost"@@ -93,75 +92,57 @@ export function ChannelHeader({<Icon className="size-4" /></Button>)- return (- <header role="banner" className="flex h-12 shrink-0 items-center gap-1 border-b border-border/40 px-3">- {onBack && !mobileServer && (+ const leading = (+ <>+ {onBack && (<Button variant="ghost" size="icon-sm" onClick={onBack} className="text-muted-foreground hover:text-foreground" aria-label="Back"><ChevronLeft className="size-5" /></Button>)}- {usesMobileParentBack && (- <Button- variant="ghost"- size="icon"- onClick={onBack}- className="h-11 w-8 shrink-0 text-muted-foreground hover:text-foreground sm:hidden"- aria-label="Back"- >- <ChevronLeft className="size-5" />- </Button>- )}- {mobileServer && !usesMobileParentBack && <MobileServerCrumb id={mobileServer.id} name={mobileServer.name} icon={mobileServer.icon} onNavigate={mobileServer.onNavigate} />}+ {mobileBack && <MessageHeaderMobileBack onNavigate={mobileBack} />}+ </>+ )+ const identity = (+ <>{server && <ServerCrumb id={server.id} name={server.name} icon={server.icon} size={6} className="ml-1" />}- {breadcrumb ? (+ <div className={`grid size-6 shrink-0 place-items-center rounded-md bg-muted text-muted-foreground ${mobileBack ? "sm:ml-1" : server ? "" : "ml-1"}`}>+ <EntityIcon kind={kind} className="size-4" />+ </div>+ <span className="min-w-0 truncate text-base font-semibold" title={channel}>{channel}</span>+ {onRename && (+ <HeaderRename+ label={channel}+ onRename={onRename}+ titleMode={titleRename}+ className={mobileBack ? "hidden sm:inline-flex" : undefined}+ />+ )}+ </>+ )+ const actions = (+ <>+ {!compactActions && (<>- <button- type="button"- data-testid={breadcrumb.id ? tid.channelHeaderParent(breadcrumb.id) : undefined}- onClick={breadcrumb.onNavigate}- className={`flex min-w-0 max-w-24 items-center gap-1 text-muted-foreground transition-colors hover:text-foreground sm:max-w-none ${mobileServer ? "sm:ml-1" : server ? "" : "ml-1"}`}- >- <EntityIcon kind={entityKind} className="size-4 shrink-0" />- <span className="truncate text-base font-medium">{channel}</span>- </button>- <ChannelIcon className="shrink-0 text-base text-muted-foreground/60" />- <span className="min-w-8 truncate text-base font-medium sm:min-w-0" title={breadcrumb.label}>- {breadcrumb.label}- </span>- {breadcrumb.onRename && (- <BreadcrumbRename- label={breadcrumb.label}- onRename={breadcrumb.onRename}- titleMode={breadcrumb.titleRename}- className={usesMobileParentBack ? "hidden sm:inline-flex" : undefined}+ {tools?.members !== false && tool("members", Users, "Member list")}+ <span className="mx-1 h-5 w-px bg-border/60" aria-hidden />+ <ChannelNotifDropdown level={notifLevel ?? USE_SERVER_DEFAULT} onSetLevel={onSetNotifLevel} />+ {(tools?.threads !== false || tools?.pinned !== false) && (+ <ChannelOverflowMenu+ rightPanel={rightPanel}+ onToggle={onToggle}+ showThreads={tools?.threads !== false}+ showPinned={tools?.pinned !== false}/>)}</>- ) : (- <>- <div className={`grid size-6 shrink-0 place-items-center rounded-md bg-muted text-muted-foreground ${mobileServer ? "sm:ml-1" : server ? "" : "ml-1"}`}>- <EntityIcon kind={entityKind} className="size-4" />- </div>- <span className="truncate text-base font-semibold">{channel}</span>- </>)}- <div className="ml-auto flex items-center text-muted-foreground">- {!compactActions && (- <>- {tools?.members !== false && tool("members", Users, "Member list")}- <span className="mx-1 h-5 w-px bg-border/60" aria-hidden />- <ChannelNotifDropdown level={notifLevel ?? USE_SERVER_DEFAULT} onSetLevel={onSetNotifLevel} />- {(tools?.threads !== false || tools?.pinned !== false) && (- <ChannelOverflowMenu- rightPanel={rightPanel}- onToggle={onToggle}- showThreads={tools?.threads !== false}- showPinned={tools?.pinned !== false}- />- )}- </>- )}- {endActions}- </div>- </header>+ {endActions}+ </>+ )+ return (+ <MessageHeader+ leading={leading}+ identity={identity}+ actions={actions}+ />)}@@ -209,34 +190,8 @@ function ChannelOverflowMenu({}// Server identity chip — icon (or initial-letter fallback) in a rounded-// square. The mobile breadcrumb's leading segment (the channel segment that-// follows leads with its own "/" or forum icon, which serves as the-// separator). Tailwind only picks up complete literal class names at build-// time, so `size` can't be interpolated — it's an explicit ternary.-function MobileServerCrumb({ id, name, icon, onNavigate }: {- id: string- name: string- icon: string | null- onNavigate: () => void-}) {- return (- <button- type="button"- data-testid={tid.channelHeaderServer(id)}- onClick={onNavigate}- className="grid size-11 shrink-0 place-items-center rounded-md focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none sm:hidden"- aria-label={`Go to server ${name}`}- title={name}- >- <span- className={`relative grid size-6 shrink-0 place-items-center overflow-hidden rounded-md ${icon ? "bg-secondary text-[0.6875rem] font-semibold text-foreground" : "font-brand text-sm font-bold text-white [text-shadow:0_1px_2px_rgb(0_0_0/0.35)]"}`}- >- {icon ? <img src={icon} alt="" className="size-full object-cover" /> : <><SeededBackdrop seed={id} /><span className="relative -translate-x-px [-webkit-text-stroke:0.5px_currentColor]">{avatarInitial(name)}</span></>}- </span>- </button>- )-}-+// square. Tailwind only picks up complete literal class names at build time,+// so `size` can't be interpolated — it's an explicit ternary.function ServerCrumb({ id, name, icon, size = 5, className = "" }: { id: string; name: string; icon: string | null; size?: 5 | 6 | 7; className?: string }) {const sizeCls = size === 7 ? "size-7" : size === 6 ? "size-6" : "size-5"const iconTextCls = size === 7 ? "text-xs" : size === 6 ? "text-[0.6875rem]" : "text-[0.625rem]"@@ -292,7 +247,7 @@ function ChannelNotifDropdown({ level, onSetLevel }: {)}-function BreadcrumbRename({ label, onRename, titleMode = false, className = "" }: {+function HeaderRename({ label, onRename, titleMode = false, className = "" }: {label: stringonRename: (name: string) => void | Promise<void>titleMode?: booleandiff --git a/src/web/src/components/community/channels/channel-loading-frame.test.ts b/src/web/src/components/community/channels/channel-loading-frame.test.tsindex ff0a85d91..b125607b3 100644--- a/src/web/src/components/community/channels/channel-loading-frame.test.ts+++ b/src/web/src/components/community/channels/channel-loading-frame.test.ts@@ -16,7 +16,7 @@ vi.mock("@/components/community/messages/composer", () => ({import { ChannelLoadingFrame } from "./channel-loading-frame"describe("ChannelLoadingFrame", () => {- it("composes canonical detail zones with server-leading loading geometry", () => {+ it("composes canonical detail zones with mobile Back loading geometry", () => {let renderer!: TestRenderer.ReactTestRendereract(() => {renderer = TestRenderer.create(createElement(ChannelLoadingFrame))diff --git a/src/web/src/components/community/channels/channel-route.text-scroll-target.test.ts b/src/web/src/components/community/channels/channel-route.text-scroll-target.test.tsindex 44982d33e..777239b4e 100644--- a/src/web/src/components/community/channels/channel-route.text-scroll-target.test.ts+++ b/src/web/src/components/community/channels/channel-route.text-scroll-target.test.ts@@ -77,16 +77,16 @@ vi.mock("@/hooks/community/thread-opener-read-handoff", () => ({}))vi.mock("@/components/community/channels/channel-header", () => ({ChannelHeader: ({- mobileServer,- breadcrumb,+ mobileBack,+ kind,endActions,}: {- mobileServer?: { onNavigate: () => void }- breadcrumb?: { onNavigate?: () => void }+ mobileBack?: () => void+ kind?: stringendActions?: React.ReactNode}) => {- mockHeaderServerNavigate.current = mobileServer?.onNavigate- mockHeaderParentNavigate.current = breadcrumb?.onNavigate+ mockHeaderServerNavigate.current = kind === "thread" ? undefined : mobileBack+ mockHeaderParentNavigate.current = kind === "thread" ? mobileBack : undefinedreturn React.createElement(React.Fragment, null, endActions)},ChannelHeaderSkeleton: () => null,@@ -490,7 +490,7 @@ describe("ChannelRoute message surface ownership", () => {)})- it("replaces directly to the verified parent from the child crumb", () => {+ it("replaces directly to the verified parent from the child Back control", () => {configureThreadRoute()mockBreakpoint.value = "mobile"mockedUseChannelMessageFeed.mockImplementation(() => feed({ anchorInCache: true }))diff --git a/src/web/src/components/community/channels/channel-route.tsx b/src/web/src/components/community/channels/channel-route.tsxindex d8b142ec5..1f223991b 100644--- a/src/web/src/components/community/channels/channel-route.tsx+++ b/src/web/src/components/community/channels/channel-route.tsx@@ -42,7 +42,7 @@ const THREAD_VIEW_PARAM = "threadView"** - Forum channel: ForumView* - Text channel: MessageList + Composer + right panels- * - Child thread opened via URL: child-channel view (breadcrumb + list)+ * - Child thread opened via URL: child-channel view (current identity + list)*/export function ChannelRoute({ serverParam, channelId }: {serverParam: string@@ -229,12 +229,7 @@ export function ChannelRoute({ serverParam, channelId }: {server={currentServer}channel={parentChannelInServer}viewer={currentUser}- headerServer={{- id: currentServer.id,- name: currentServer.name,- icon: currentServer.icon,- onNavigate: navigateServerRoot,- }}+ onNavigateParent={navigateServerRoot}channelRefCandidates={channelRefCandidates}uiHandlers={uiHandlers}onOpenChild={enterThread}@@ -251,14 +246,10 @@ export function ChannelRoute({ serverParam, channelId }: {anchorMessageId={jumpTargetId}parentChannelId={currentChannelMeta?.parentChannelId ?? null}parentMessageId={currentChannelMeta?.parentMessageId ?? null}- parentChannelName={parentChannelInServer?.name ?? "channel"}parentIsForum={isForumPostChild}threadOpenerHandoff={threadOpenerHandoff}childCreatorId={currentChannelMeta?.creatorId}canRenameThread={canManageServer(myRole)}- headerServer={currentServer- ? { id: currentServer.id, name: currentServer.name, icon: currentServer.icon, onNavigate: navigateServerRoot }- : undefined}onNavigateParent={navigateParent}notificationLevel={(channelNotif[channelId] as ChannelNotifLevel) ?? USE_SERVER_DEFAULT}onSetNotificationLevel={setNotificationLevel}@@ -291,9 +282,7 @@ export function ChannelRoute({ serverParam, channelId }: {channelName={channelName}viewer={currentUser}viewerRole={myRole}- headerServer={currentServer- ? { id: currentServer.id, name: currentServer.name, icon: currentServer.icon, onNavigate: navigateServerRoot }- : undefined}+ onNavigateParent={navigateServerRoot}notificationLevel={(channelNotif[channelId] as ChannelNotifLevel) ?? USE_SERVER_DEFAULT}onSetNotificationLevel={setNotificationLevel}composerMembers={composerMembers}@@ -315,9 +304,7 @@ export function ChannelRoute({ serverParam, channelId }: {channelName={channelName}viewer={currentUser}anchorMessageId={jumpTargetId}- headerServer={currentServer- ? { id: currentServer.id, name: currentServer.name, icon: currentServer.icon, onNavigate: navigateServerRoot }- : undefined}+ onNavigateParent={navigateServerRoot}notificationLevel={(channelNotif[channelId] as ChannelNotifLevel) ?? USE_SERVER_DEFAULT}onSetNotificationLevel={setNotificationLevel}composerMembers={composerMembers}diff --git a/src/web/src/components/community/channels/dm-header.test.ts b/src/web/src/components/community/channels/dm-header.test.tsindex e0ff6eb38..04f7647cf 100644--- a/src/web/src/components/community/channels/dm-header.test.ts+++ b/src/web/src/components/community/channels/dm-header.test.ts@@ -24,6 +24,15 @@ describe("DmHeader", () => {expect(markup).toContain("Bob")expect(markup).toContain("#0042")})++ it("uses one mobile-only parent control without changing DM identity", () => {+ const onBack = vi.fn()+ const markup = renderToStaticMarkup(createElement(DmHeader, { dm, onBack }))++ expect(markup).toContain('aria-label="Back"')+ expect(markup).toMatch(/class="[^"]*size-11[^"]*sm:hidden[^"]*"/)+ expect(markup).toContain(`data-testid="${tid.dmHeaderTitle}"`)+ })})describe("DmHeaderSkeleton", () => {@@ -31,13 +40,17 @@ describe("DmHeaderSkeleton", () => {const desktop = renderToStaticMarkup(createElement(DmHeaderSkeleton))expect(desktop).toContain("size-6 rounded-full")expect(desktop).toContain("h-4 w-32 rounded")- expect(desktop).toContain("ml-auto size-7 rounded-md")+ expect(desktop).toContain('data-slot="message-header-actions"')+ expect(desktop).toContain("size-7 rounded-md")expect(desktop).not.toContain('aria-label="Back"')const mobile = renderToStaticMarkup(createElement(DmHeaderSkeleton, { onBack: vi.fn() }),)- expect(mobile).toContain('data-slot="loading-back-placeholder"')+ expect(mobile).toContain('data-slot="loading-mobile-leading"')+ expect(mobile).toMatch(/class="[^"]*size-11[^"]*sm:hidden[^"]*"/)+ expect(mobile).toContain('data-slot="message-header-identity"')+ expect(mobile).toContain('data-slot="message-header-actions"')expect(mobile).not.toContain("<button")expect(mobile).not.toContain('aria-label="Back"')})diff --git a/src/web/src/components/community/channels/dm-header.tsx b/src/web/src/components/community/channels/dm-header.tsxindex fefe93d5c..fe2264eb5 100644--- a/src/web/src/components/community/channels/dm-header.tsx+++ b/src/web/src/components/community/channels/dm-header.tsx@@ -1,4 +1,4 @@-import { Bell, BellOff, Check, ChevronLeft } from "lucide-react"+import { Bell, BellOff, Check } from "lucide-react"import { NOTIF_LEVELS, type NotifLevel } from "@alook/shared"import { Button } from "@/components/ui/button"import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"@@ -6,6 +6,7 @@ import { Skeleton } from "@/components/ui/skeleton"import { Avatar } from "../avatar"import type { DM } from "@/lib/community/models/people"import { tid } from "@/lib/community/testids"+import { MessageHeader, MessageHeaderMobileBack } from "./message-header"export function DmHeader({ dm, onBack, titleAs: Title = "h1", notifLevel, onSetNotifLevel }: {dm: DM@@ -15,21 +16,25 @@ export function DmHeader({ dm, onBack, titleAs: Title = "h1", notifLevel, onSetNonSetNotifLevel?: (level: NotifLevel) => void}) {return (- <header data-testid={tid.dmHeader} className="flex h-12 shrink-0 items-center gap-2 border-b border-border/40 px-3">- {onBack && (- <Button variant="ghost" size="icon-sm" onClick={onBack} className="text-muted-foreground hover:text-foreground" aria-label="Back"><ChevronLeft className="size-5" /></Button>+ <MessageHeader+ testId={tid.dmHeader}+ leading={onBack ? <MessageHeaderMobileBack onNavigate={onBack} /> : undefined}+ identityClassName="gap-2"+ identity={(+ <>+ <Avatar label={dm.avatar} seed={dm.userId} size={24} presence={dm.status} />+ <Title data-testid={tid.dmHeaderTitle} className="min-w-0 truncate font-heading text-base font-medium leading-[1.15] tracking-[-0.015em]">+ {dm.name}+ {dm.discriminator && (+ <span className="ml-1 text-xs font-normal tracking-wide text-muted-foreground">+ #{dm.discriminator}+ </span>+ )}+ </Title>+ </>)}- <Avatar label={dm.avatar} seed={dm.userId} size={24} presence={dm.status} />- <Title data-testid={tid.dmHeaderTitle} className="min-w-0 truncate font-heading text-base font-medium leading-[1.15] tracking-[-0.015em]">- {dm.name}- {dm.discriminator && (- <span className="ml-1 text-xs font-normal tracking-wide text-muted-foreground">- #{dm.discriminator}- </span>- )}- </Title>- {notifLevel && <DmNotifDropdown level={notifLevel} onSetLevel={onSetNotifLevel} />}- </header>+ actions={notifLevel && <DmNotifDropdown level={notifLevel} onSetLevel={onSetNotifLevel} />}+ />)}@@ -38,7 +43,7 @@ function DmNotifDropdown({ level, onSetLevel }: { level: NotifLevel; onSetLevel?return (<DropdownMenu><DropdownMenuTrigger render={- <Button variant="ghost" size="icon-sm" className={`ml-auto ${muted ? "text-destructive" : "text-muted-foreground"}`} aria-label="Direct message notifications" />+ <Button variant="ghost" size="icon-sm" className={muted ? "text-destructive" : "text-muted-foreground"} aria-label="Direct message notifications" />}>{muted ? <BellOff className="size-4" /> : <Bell className="size-4" />}</DropdownMenuTrigger>@@ -59,13 +64,20 @@ function DmNotifDropdown({ level, onSetLevel }: { level: NotifLevel; onSetLevel?// stays anchored across the route change.export function DmHeaderSkeleton({ onBack }: { onBack?: () => void }) {return (- <header className="flex h-12 shrink-0 items-center gap-2 border-b border-border/40 px-3">- {onBack && (- <Skeleton data-slot="loading-back-placeholder" aria-hidden className="size-8 shrink-0 rounded-md" />+ <MessageHeader+ leading={onBack ? (+ <div data-slot="loading-mobile-leading" aria-hidden className="grid size-11 shrink-0 place-items-center sm:hidden">+ <Skeleton className="size-6 rounded-md" />+ </div>+ ) : undefined}+ identityClassName="gap-2"+ identity={(+ <>+ <Skeleton className="size-6 rounded-full" />+ <Skeleton className="h-4 w-32 rounded" />+ </>)}- <Skeleton className="size-6 rounded-full" />- <Skeleton className="h-4 w-32 rounded" />- <Skeleton className="ml-auto size-7 rounded-md" />- </header>+ actions={<Skeleton className="size-7 rounded-md" />}+ />)}diff --git a/src/web/src/components/community/channels/forum-channel-surface.test.ts b/src/web/src/components/community/channels/forum-channel-surface.test.tsindex e8b105436..5547c5b3d 100644--- a/src/web/src/components/community/channels/forum-channel-surface.test.ts+++ b/src/web/src/components/community/channels/forum-channel-surface.test.ts@@ -63,12 +63,7 @@ function surfaceProps(overrides: Record<string, unknown> = {}) {channelName: "ideas",viewer: { id: "viewer_1" },viewerRole: "member" as const,- headerServer: {- id: "srv_1",- name: "Studio",- icon: null,- onNavigate: vi.fn(),- },+ onNavigateParent: vi.fn(),notificationLevel: "Use Server Default" as const,onSetNotificationLevel: vi.fn(),composerMembers: [],@@ -100,7 +95,8 @@ describe("ForumChannelSurface ownership", () => {expect(mocks.activeMessageFeed).not.toHaveBeenCalled()expect(mockedChannelHeader.mock.calls.at(-1)![0]).toEqual(expect.objectContaining({- mobileServer: props.headerServer,+ mobileBack: props.onNavigateParent,+ kind: "forum",}))expect(mockedChannelHeader.mock.calls.at(-1)![0]).not.toHaveProperty("onBack")const forumProps = mockedForumSurface.mock.calls.at(-1)![0]diff --git a/src/web/src/components/community/channels/forum-channel-surface.tsx b/src/web/src/components/community/channels/forum-channel-surface.tsxindex 36f48eb8d..03cd34230 100644--- a/src/web/src/components/community/channels/forum-channel-surface.tsx+++ b/src/web/src/components/community/channels/forum-channel-surface.tsx@@ -25,7 +25,7 @@ export function ForumChannelSurface({channelName,viewer,viewerRole,- headerServer,+ onNavigateParent,notificationLevel,onSetNotificationLevel,composerMembers,@@ -41,7 +41,7 @@ export function ForumChannelSurface({channelName: stringviewer: { id: string }viewerRole: Role | undefined- headerServer?: { id: string; name: string; icon: string | null; onNavigate: () => void }+ onNavigateParent?: () => voidnotificationLevel: ChannelNotifLevelonSetNotificationLevel: (level: ChannelNotifLevel) => voidcomposerMembers: Member[]@@ -94,12 +94,12 @@ export function ForumChannelSurface({header={(<ChannelHeaderchannel={channelName}- forum+ kind="forum"rightPanel={rightPanel}onToggle={togglePanel}notifLevel={notificationLevel}onSetNotifLevel={onSetNotificationLevel}- mobileServer={headerServer}+ mobileBack={onNavigateParent}tools={{ threads: false, pinned: false }}/>)}diff --git a/src/web/src/components/community/channels/forum-child-header.contract.test.ts b/src/web/src/components/community/channels/forum-child-header.contract.test.tsindex 5823c2735..b7f284c8c 100644--- a/src/web/src/components/community/channels/forum-child-header.contract.test.ts+++ b/src/web/src/components/community/channels/forum-child-header.contract.test.ts@@ -14,7 +14,7 @@ describe("forum child header wiring", () => {expect(route).toContain("<ThreadChannelSurface")expect(surface).toContain("parentMessageId && !parentIsForum")expect(surface).toContain("childCreatorId === viewer.id")- expect(surface).toContain("titleRename: parentIsForum")+ expect(surface).toContain("titleRename={parentIsForum}")expect(surface).toContain("messageId: parentMessageId")expect(forumView).not.toContain("Edit post")expect(forumView).not.toMatch(/\bonEditPost(?:\?|\s|=)/)diff --git a/src/web/src/components/community/channels/message-header.test.ts b/src/web/src/components/community/channels/message-header.test.tsnew file mode 100644index 000000000..a41b55c2c--- /dev/null+++ b/src/web/src/components/community/channels/message-header.test.ts@@ -0,0 +1,34 @@+import { createElement } from "react"+import { renderToStaticMarkup } from "react-dom/server"+import TestRenderer, { act } from "react-test-renderer"+import { describe, expect, it, vi } from "vitest"+import { MessageHeader, MessageHeaderMobileBack } from "./message-header"++describe("MessageHeader", () => {+ it("owns one stable left / identity / actions frame", () => {+ const html = renderToStaticMarkup(createElement(MessageHeader, {+ leading: createElement("span", { "data-zone": "leading" }),+ identity: createElement("span", null, "Identity"),+ actions: createElement("button", null, "Action"),+ }))++ expect(html).toContain("h-12")+ expect(html).toContain('data-zone="leading"')+ expect(html).toContain('data-slot="message-header-identity"')+ expect(html).toContain('data-slot="message-header-actions"')+ })++ it("keeps explicit parent navigation mobile-only with a 44px target", () => {+ const onNavigate = vi.fn()+ let renderer!: TestRenderer.ReactTestRenderer+ act(() => {+ renderer = TestRenderer.create(createElement(MessageHeaderMobileBack, { onNavigate }))+ })++ const back = renderer.root.findByProps({ "aria-label": "Back" })+ expect(back.props.className).toContain("size-11")+ expect(back.props.className).toContain("sm:hidden")+ act(() => back.props.onClick())+ expect(onNavigate).toHaveBeenCalledOnce()+ })+})diff --git a/src/web/src/components/community/channels/message-header.tsx b/src/web/src/components/community/channels/message-header.tsxnew file mode 100644index 000000000..81c3cfda8--- /dev/null+++ b/src/web/src/components/community/channels/message-header.tsx@@ -0,0 +1,57 @@+import type { ReactNode } from "react"+import { ChevronLeft } from "lucide-react"+import { Button } from "@/components/ui/button"+import { cn } from "@/lib/utils"++export function MessageHeader({+ testId,+ leading,+ identity,+ actions,+ identityClassName,+}: {+ testId?: string+ leading?: ReactNode+ identity: ReactNode+ actions?: ReactNode+ identityClassName?: string+}) {+ return (+ <header+ role="banner"+ data-testid={testId}+ className="flex h-12 shrink-0 items-center gap-1 border-b border-border/40 px-3"+ >+ {leading}+ <div+ data-slot="message-header-identity"+ className={cn("flex min-w-0 items-center gap-1", identityClassName)}+ >+ {identity}+ </div>+ <div+ data-slot="message-header-actions"+ className="ml-auto flex shrink-0 items-center text-muted-foreground"+ >+ {actions}+ </div>+ </header>+ )+}++export function MessageHeaderMobileBack({ onNavigate, label = "Back" }: {+ onNavigate: () => void+ label?: string+}) {+ return (+ <Button+ variant="ghost"+ size="icon"+ onClick={onNavigate}+ className="size-11 shrink-0 text-muted-foreground hover:text-foreground sm:hidden"+ aria-label={label}+ >+ <ChevronLeft className="size-5" />+ </Button>+ )+}diff --git a/src/web/src/components/community/channels/text-channel-surface.test.ts b/src/web/src/components/community/channels/text-channel-surface.test.tsindex 5582ef921..1090553a5 100644--- a/src/web/src/components/community/channels/text-channel-surface.test.ts+++ b/src/web/src/components/community/channels/text-channel-surface.test.ts@@ -329,13 +329,8 @@ describe("TextChannelSurface header hierarchy", () => {vi.clearAllMocks()})- it("forwards the direct mobile server segment without a Back fallback", () => {- const headerServer = {- id: "server_1",- name: "Server",- icon: null,- onNavigate: vi.fn(),- }+ it("forwards the explicit mobile parent Back callback", () => {+ const onNavigateParent = vi.fn()mockedUseChannelMessageFeed.mockReturnValue(feed())act(() => {@@ -346,7 +341,7 @@ describe("TextChannelSurface header hierarchy", () => {channelName: "general",viewer: { id: "viewer_1", name: "Viewer", avatar: "V" },anchorMessageId: null,- headerServer,+ onNavigateParent,notificationLevel: "default",onSetNotificationLevel: vi.fn(),composerMembers: [],@@ -362,7 +357,8 @@ describe("TextChannelSurface header hierarchy", () => {})const headerProps = mockedChannelHeader.mock.calls.at(-1)![0]- expect(headerProps.mobileServer).toBe(headerServer)+ expect(headerProps.mobileBack).toBe(onNavigateParent)+ expect(headerProps.kind).toBe("text")expect(headerProps).not.toHaveProperty("onBack")})})diff --git a/src/web/src/components/community/channels/text-channel-surface.tsx b/src/web/src/components/community/channels/text-channel-surface.tsxindex da0e6e261..5015951b1 100644--- a/src/web/src/components/community/channels/text-channel-surface.tsx+++ b/src/web/src/components/community/channels/text-channel-surface.tsx@@ -27,7 +27,7 @@ export function TextChannelSurface({channelName,viewer,anchorMessageId,- headerServer,+ onNavigateParent,notificationLevel,onSetNotificationLevel,composerMembers,@@ -47,7 +47,7 @@ export function TextChannelSurface({channelName: stringviewer: { id: string; name: string; discriminator?: string; avatar: string }anchorMessageId: string | null- headerServer?: { id: string; name: string; icon: string | null; onNavigate: () => void }+ onNavigateParent?: () => voidnotificationLevel: ChannelNotifLevelonSetNotificationLevel: (level: ChannelNotifLevel) => voidcomposerMembers: ComponentProps<typeof Composer>["members"]@@ -113,11 +113,12 @@ export function TextChannelSurface({header={(<ChannelHeaderchannel={channelName}+ kind="text"rightPanel={rightPanel}onToggle={togglePanel}notifLevel={notificationLevel}onSetNotifLevel={onSetNotificationLevel}- mobileServer={headerServer}+ mobileBack={onNavigateParent}/>)}body={(diff --git a/src/web/src/components/community/channels/thread-channel-surface.test.ts b/src/web/src/components/community/channels/thread-channel-surface.test.tsindex 796e8b52a..5cf7d3a6f 100644--- a/src/web/src/components/community/channels/thread-channel-surface.test.ts+++ b/src/web/src/components/community/channels/thread-channel-surface.test.ts@@ -172,16 +172,9 @@ function surfaceProps(overrides: Record<string, unknown> = {}) {anchorMessageId: "m_target",parentChannelId: "parent_1",parentMessageId: "opener_1",- parentChannelName: "general",parentIsForum: false,childCreatorId: "viewer_1",canRenameThread: true,- headerServer: {- id: "server_1",- name: "Server",- icon: null,- onNavigate: vi.fn(),- },onNavigateParent: vi.fn(),notificationLevel: "default" as const,onSetNotificationLevel: vi.fn(),@@ -327,15 +320,14 @@ describe("ThreadChannelSurface ownership", () => {mockedUseChannelMessageFeed.mockReturnValue(feed({ isLoading: false, isError: true }))act(() => renderer.update(React.createElement(ThreadChannelSurface, props)))const headerProps = mockedChannelHeader.mock.calls.at(-1)![0]- expect(headerProps.onBack).toBe(props.onNavigateParent)- expect(headerProps.mobileServer).toBe(props.headerServer)- expect(headerProps.breadcrumb).toEqual(expect.objectContaining({- id: "parent_1",- onNavigate: props.onNavigateParent,+ expect(headerProps.mobileBack).toBe(props.onNavigateParent)+ expect(headerProps).toEqual(expect.objectContaining({+ channel: "Thread name",+ kind: "thread",}))})- it("preserves regular-thread breadcrumb, rename, panel, and dialog wiring", async () => {+ it("preserves regular-thread identity, rename, panel, and dialog wiring", async () => {const props = surfaceProps()let renderer: TestRenderer.ReactTestRenderer@@ -343,31 +335,27 @@ describe("ThreadChannelSurface ownership", () => {renderer = TestRenderer.create(React.createElement(ThreadChannelSurface, props))})let headerProps = mockedChannelHeader.mock.calls.at(-1)![0]- expect(headerProps).toEqual(expect.objectContaining({ channel: "general", forum: false }))+ expect(headerProps).toEqual(expect.objectContaining({ channel: "Thread name", kind: "thread" }))expect(headerProps).toEqual(expect.objectContaining({notifLevel: "default",onSetNotifLevel: props.onSetNotificationLevel,- mobileServer: props.headerServer,- onBack: props.onNavigateParent,+ mobileBack: props.onNavigateParent,}))- expect(headerProps.breadcrumb).toEqual(expect.objectContaining({- id: "parent_1",- label: "Thread name",+ expect(headerProps).toEqual(expect.objectContaining({titleRename: false,- onNavigate: props.onNavigateParent,onRename: expect.any(Function),}))await act(async () => {- await headerProps.breadcrumb?.onRename?.("Renamed thread")+ await headerProps.onRename?.("Renamed thread")})expect(mocks.apiFetch).toHaveBeenCalledWith("/api/community/channels/thread_1", {method: "PATCH",body: JSON.stringify({ name: "Renamed thread" }),})headerProps = mockedChannelHeader.mock.calls.at(-1)![0]- expect(headerProps.breadcrumb?.label).toBe("Renamed thread")- act(() => headerProps.breadcrumb?.onNavigate?.())+ expect(headerProps.channel).toBe("Renamed thread")+ act(() => headerProps.mobileBack?.())expect(props.onNavigateParent).toHaveBeenCalledOnce()act(() => headerProps.onToggle("pinned"))@@ -398,16 +386,16 @@ describe("ThreadChannelSurface ownership", () => {TestRenderer.create(renderSurface({ parentIsForum: true, channelName: "Post title" }))})let headerProps = mockedChannelHeader.mock.calls.at(-1)![0]- expect(headerProps).toEqual(expect.objectContaining({ channel: "general", forum: true }))- expect(headerProps.breadcrumb).toEqual(expect.objectContaining({- label: "Post title",+ expect(headerProps).toEqual(expect.objectContaining({+ channel: "Post title",+ kind: "thread",titleRename: true,onRename: expect.any(Function),}))expect(mockedMessageList.mock.calls.at(-1)![0].hero).toBeUndefined()await act(async () => {- await headerProps.breadcrumb?.onRename?.("Renamed post")+ await headerProps.onRename?.("Renamed post")})expect(mocks.editMessage).toHaveBeenCalledWith({serverId: "server_1",@@ -422,7 +410,7 @@ describe("ThreadChannelSurface ownership", () => {TestRenderer.create(renderSurface({ parentIsForum: true, childCreatorId: "other_user" }))})headerProps = mockedChannelHeader.mock.calls.at(-1)![0]- expect(headerProps.breadcrumb?.onRename).toBeUndefined()+ expect(headerProps.onRename).toBeUndefined()})it("preserves rename errors for regular threads and forum posts", async () => {@@ -431,7 +419,7 @@ describe("ThreadChannelSurface ownership", () => {act(() => {TestRenderer.create(renderSurface())})- const threadRename = mockedChannelHeader.mock.calls.at(-1)![0].breadcrumb?.onRename+ const threadRename = mockedChannelHeader.mock.calls.at(-1)![0].onRenameawait expect(threadRename?.("Broken thread")).rejects.toBe(threadError)expect(mocks.toastApiError).toHaveBeenCalledWith(threadError, "Failed to rename")@@ -440,7 +428,7 @@ describe("ThreadChannelSurface ownership", () => {act(() => {TestRenderer.create(renderSurface({ parentIsForum: true }))})- const postRename = mockedChannelHeader.mock.calls.at(-1)![0].breadcrumb?.onRename+ const postRename = mockedChannelHeader.mock.calls.at(-1)![0].onRenameawait expect(postRename?.("Broken post")).rejects.toBe(postError)expect(mocks.toastApiError).toHaveBeenCalledWith(postError, "Failed to edit post")})diff --git a/src/web/src/components/community/channels/thread-channel-surface.tsx b/src/web/src/components/community/channels/thread-channel-surface.tsxindex fed9ddfbd..8116dc486 100644--- a/src/web/src/components/community/channels/thread-channel-surface.tsx+++ b/src/web/src/components/community/channels/thread-channel-surface.tsx@@ -38,12 +38,10 @@ export function ThreadChannelSurface({anchorMessageId,parentChannelId,parentMessageId,- parentChannelName,parentIsForum,threadOpenerHandoff,childCreatorId,canRenameThread,- headerServer,onNavigateParent,notificationLevel,onSetNotificationLevel,@@ -67,12 +65,10 @@ export function ThreadChannelSurface({anchorMessageId: string | nullparentChannelId: string | nullparentMessageId: string | null- parentChannelName: stringparentIsForum: booleanthreadOpenerHandoff?: ThreadOpenerReadHandoff | nullchildCreatorId?: string | nullcanRenameThread: boolean- headerServer?: { id: string; name: string; icon: string | null; onNavigate: () => void }onNavigateParent: () => voidnotificationLevel: ChannelNotifLevelonSetNotificationLevel: (level: ChannelNotifLevel) => void@@ -218,22 +214,16 @@ export function ThreadChannelSurface({<ChannelShellheader={(<ChannelHeader- channel={parentChannelName}- forum={parentIsForum}+ channel={displayName}+ kind="thread"rightPanel={rightPanel}onToggle={togglePanel}notifLevel={notificationLevel}onSetNotifLevel={onSetNotificationLevel}- mobileServer={headerServer}- onBack={onNavigateParent}+ mobileBack={onNavigateParent}tools={{ threads: false }}- breadcrumb={parentChannelId ? {- id: parentChannelId,- label: displayName,- titleRename: parentIsForum,- onNavigate: onNavigateParent,- onRename: splitActions ? undefined : rename,- } : undefined}+ titleRename={parentIsForum}+ onRename={parentChannelId && !splitActions ? rename : undefined}compactActions={!!splitActions}endActions={splitActions ? (<ThreadPanelActionsdiff --git a/src/web/src/components/community/channels/thread-split-parent-surface.tsx b/src/web/src/components/community/channels/thread-split-parent-surface.tsxindex 63c555b82..4452fccc7 100644--- a/src/web/src/components/community/channels/thread-split-parent-surface.tsx+++ b/src/web/src/components/community/channels/thread-split-parent-surface.tsx@@ -20,7 +20,7 @@ export function ThreadSplitParentSurface({server,channel,viewer,- headerServer,+ onNavigateParent,channelRefCandidates,uiHandlers,onOpenChild,@@ -31,7 +31,7 @@ export function ThreadSplitParentSurface({server: ServerDetailchannel: Channelviewer: { id: string; name: string; discriminator?: string; avatar: string }- headerServer?: { id: string; name: string; icon: string | null; onNavigate: () => void }+ onNavigateParent?: () => voidchannelRefCandidates: ComposerProps["channelRefCandidates"]uiHandlers: ComponentProps<typeof TextChannelSurface>["uiHandlers"]onOpenChild: (childId: string) => void@@ -65,7 +65,7 @@ export function ThreadSplitParentSurface({channelName={channel.name}viewer={viewer}viewerRole={members.myRole}- headerServer={headerServer}+ onNavigateParent={onNavigateParent}notificationLevel={notificationLevel}onSetNotificationLevel={setNotificationLevel}composerMembers={members.composerMembers}@@ -87,7 +87,7 @@ export function ThreadSplitParentSurface({channelName={channel.name}viewer={viewer}anchorMessageId={null}- headerServer={headerServer}+ onNavigateParent={onNavigateParent}notificationLevel={notificationLevel}onSetNotificationLevel={setNotificationLevel}composerMembers={members.composerMembers}diff --git a/src/web/src/components/community/shell/community-pending-frame.test.ts b/src/web/src/components/community/shell/community-pending-frame.test.tsindex bcac55318..c063e8e76 100644--- a/src/web/src/components/community/shell/community-pending-frame.test.ts+++ b/src/web/src/components/community/shell/community-pending-frame.test.ts@@ -54,7 +54,7 @@ describe("CommunityPendingFrame", () => {expect(friends.root.findByType("friends-skeleton").props.onBack).toBeUndefined()})- it("separates neutral Me, DM Back geometry, and server-leading channel geometry", () => {+ it("separates neutral Me from DM and channel mobile Back geometry", () => {const root = render("/c/me")expect(root.root.findByProps({ "aria-label": "Loading your space" }).props["aria-busy"]).toBe("true")diff --git a/src/web/src/lib/community/testids.ts b/src/web/src/lib/community/testids.tsindex 597b53bc3..beab28b98 100644--- a/src/web/src/lib/community/testids.ts+++ b/src/web/src/lib/community/testids.ts@@ -26,9 +26,7 @@ export const tid = {serverRailInsertFolder: (id: string) => `community-server-rail-insert-folder-${id}`,channelSidebarScroll: "community-channel-sidebar-scroll",channelSidebarPending: (serverId: string) => `community-channel-sidebar-pending-${serverId}`,- channelHeaderServer: (serverId: string) => `community-channel-header-server-${serverId}`,- channelHeaderParent: (channelId: string) => `community-channel-header-parent-${channelId}`,- channelHeaderServerLoading: "community-channel-header-server-loading",+ messageHeaderLeadingLoading: "community-message-header-leading-loading",dmSidebarPending: "community-dm-sidebar-pending",createServerSubmit: "community-create-server-submit",createServerName: "community-create-server-name",diff --git a/src/web/src/test/e2e-ui/08-mobile.spec.ts b/src/web/src/test/e2e-ui/08-mobile.spec.tsindex 0c177047e..7c6900a3a 100644--- a/src/web/src/test/e2e-ui/08-mobile.spec.ts+++ b/src/web/src/test/e2e-ui/08-mobile.spec.ts@@ -113,28 +113,21 @@ test.describe.serial("mobile layout", () => {}})- test("a direct channel opens detail and its server crumb replaces to the server root", async ({ asUser }) => {+ test("a direct channel opens detail and Back replaces to the server root", async ({ asUser }) => {const { page } = await asUser("alice")await page.goto(`/c/channels/${serverId}/${channelId}`)await page.waitForURL(new RegExp(channelId), { timeout: 20_000 , waitUntil: "commit" })await expect(page.getByTestId(tid.composerInput)).toBeVisible()- const serverCrumb = page.getByTestId(tid.channelHeaderServer(serverId))- await expect(serverCrumb).toBeVisible()- await expect(page.getByRole("button", { name: "Back" })).toHaveCount(0)- const [controlBox, visualBox] = await Promise.all([- serverCrumb.boundingBox(),- serverCrumb.locator(":scope > span").boundingBox(),- ])+ const back = page.getByRole("banner").getByRole("button", { name: "Back" })+ await expect(back).toBeVisible()+ const controlBox = await back.boundingBox()expect(controlBox).not.toBeNull()- expect(visualBox).not.toBeNull()expect(controlBox!.width).toBe(44)expect(controlBox!.height).toBe(44)- expect(visualBox!.width).toBe(24)- expect(visualBox!.height).toBe(24)const historyLength = await page.evaluate(() => history.length)- await serverCrumb.click()+ await back.click()await expect.poll(() => new URL(page.url()).pathname).toBe(`/c/channels/${serverId}`)expect(new URL(page.url()).searchParams.has("pane")).toBe(false)await expect(page.getByTestId(tid.serverIcon(serverId))).toBeVisible()@@ -208,7 +201,7 @@ test.describe.serial("mobile layout", () => {await expect(page.getByRole("dialog").getByText("mobile child seq target")).toBeVisible()})- test("a flat child exposes direct parent breadcrumb and Back controls", async ({ asUser }) => {+ test("a flat child exposes its current identity and direct parent Back control", async ({ asUser }) => {const { page } = await asUser("alice")await page.goto(`/c/channels/${serverId}/${childChannelId}`)const current = page.getByRole("banner").getByText("mobile-child", { exact: true })@@ -216,24 +209,12 @@ test.describe.serial("mobile layout", () => {expect(await current.evaluate((element) => element.tagName)).toBe("SPAN")const back = page.getByRole("button", { name: "Back" })await expect(back).toBeVisible()- await expect(page.getByTestId(tid.channelHeaderServer(serverId))).toHaveCount(0)-const historyLength = await page.evaluate(() => history.length)await back.click()await expect.poll(() => new URL(page.url()).pathname).toBe(`/c/channels/${serverId}/${channelId}`,)expect(await page.evaluate(() => history.length)).toBe(historyLength)-- await page.goto(`/c/channels/${serverId}/${childChannelId}`)- await expect(current).toBeVisible()- const parentHistoryLength = await page.evaluate(() => history.length)- await page.getByTestId(tid.channelHeaderParent(channelId)).click()- await expect.poll(() => new URL(page.url()).pathname).toBe(- `/c/channels/${serverId}/${channelId}`,- )- expect(await page.evaluate(() => history.length)).toBe(parentHistoryLength)-})test("Marked opens a child message on its canonical route without losing context", async ({ asUser }) => {@@ -355,7 +336,7 @@ test.describe.serial("mobile layout", () => {const { page } = await asUser("alice")await page.goto(`/c/channels/${serverId}/${channelId}`)await expect(page.getByTestId(tid.composerInput)).toBeVisible()- await page.getByTestId(tid.channelHeaderServer(serverId)).click()+ await page.getByRole("banner").getByRole("button", { name: "Back" }).click()await expect.poll(() => new URL(page.url()).pathname).toBe(`/c/channels/${serverId}`)await expect(page.getByTestId(tid.channelRow(channelId))).toBeVisible()diff --git a/src/web/src/test/e2e-ui/36-server-switch-pending-checkpoint.spec.ts b/src/web/src/test/e2e-ui/36-server-switch-pending-checkpoint.spec.tsindex 4e3574d40..a9ee03042 100644--- a/src/web/src/test/e2e-ui/36-server-switch-pending-checkpoint.spec.ts+++ b/src/web/src/test/e2e-ui/36-server-switch-pending-checkpoint.spec.ts@@ -177,7 +177,7 @@ test("server switching exposes one target-scoped cold checkpoint and skips it whawait expectActiveServer(page, serverA, serverC)await page.setViewportSize({ width: 390, height: 844 })- await page.getByTestId(tid.channelHeaderServer(serverA)).click()+ await page.getByRole("banner").getByRole("button", { name: "Back" }).click()await expect.poll(() => new URL(page.url()).pathname === `/c/channels/${serverA}`).toBe(true)await expect(page.getByTestId(tid.serverIcon(serverD))).toBeVisible()diff --git a/src/web/src/test/e2e-ui/37-server-rail-pdd.spec.ts b/src/web/src/test/e2e-ui/37-server-rail-pdd.spec.tsindex 5bf82af3c..802507f96 100644--- a/src/web/src/test/e2e-ui/37-server-rail-pdd.spec.ts+++ b/src/web/src/test/e2e-ui/37-server-rail-pdd.spec.ts@@ -366,7 +366,7 @@ test("server rail keeps scroll separate from native, touch, and keyboard drag",await expect.poll(() => railRequests[0]?.status).toBe(200)await page.setViewportSize({ width: 390, height: 844 })- await page.getByTestId(tid.channelHeaderServer(first)).click()+ await page.getByRole("banner").getByRole("button", { name: "Back" }).click()await expect.poll(() => new URL(page.url()).pathname).toBe(`/c/channels/${first}`)const rail = page.getByTestId(tid.serverRailScroll)await rail.evaluate((element) => { element.scrollTop = element.scrollHeight })@@ -412,7 +412,7 @@ test("server rail keeps scroll separate from native, touch, and keyboard drag",await expect.poll(() => new URL(page.url()).pathname).toBe(`/c/channels/${tail}`)expect(railRequests).toHaveLength(1)await page.goto(`/c/channels/${first}/${channel}`)- await page.getByTestId(tid.channelHeaderServer(first)).click()+ await page.getByRole("banner").getByRole("button", { name: "Back" }).click()await expect.poll(() => new URL(page.url()).pathname).toBe(`/c/channels/${first}`)await expect(page.getByTestId(tid.serverIcon(first))).toBeVisible({ timeout: 30_000 })await rail.evaluate((element) => { element.scrollTop = element.scrollHeight })diff --git a/src/web/src/test/e2e-ui/38-community-navigation-checkpoint-matrix.spec.ts b/src/web/src/test/e2e-ui/38-community-navigation-checkpoint-matrix.spec.tsindex a120c26b4..b8fff5df3 100644--- a/src/web/src/test/e2e-ui/38-community-navigation-checkpoint-matrix.spec.ts+++ b/src/web/src/test/e2e-ui/38-community-navigation-checkpoint-matrix.spec.ts@@ -69,7 +69,7 @@ test("community checkpoint keeps the committed frame live until navigation commiawait page.setViewportSize({ width: 390, height: 844 })const rootGate = await holdRoute(page, `/c/channels/${serverId}`)- await page.getByTestId(tid.channelHeaderServer(serverId)).click({ noWaitAfter: true })+ await page.getByRole("banner").getByRole("button", { name: "Back" }).click({ noWaitAfter: true })await expect.poll(rootGate.held).toBeGreaterThan(0)await page.setViewportSize({ width: 1280, height: 900 })await expect(page.getByLabel("Loading conversation")).toHaveCount(0)diff --git a/src/web/src/test/e2e-ui/39-mobile-message-interactions.spec.ts b/src/web/src/test/e2e-ui/39-mobile-message-interactions.spec.tsindex 423756350..369fb4e43 100644--- a/src/web/src/test/e2e-ui/39-mobile-message-interactions.spec.ts+++ b/src/web/src/test/e2e-ui/39-mobile-message-interactions.spec.ts@@ -840,7 +840,7 @@ test("mobile reply, avatar mention, and typing rail keep exact backend and WS idexpect(readingPosition).toBe(2200)const channelReadState = await settledReadState(alice.page, channelId)const channelReturnGets = trackSurfaceGets(alice.page, channelId)- await alice.page.getByRole("button", { name: `Go to server ${serverName}` }).click()+ await alice.page.getByRole("banner").getByRole("button", { name: "Back" }).click()await expect.poll(() => new URL(alice.page.url()).pathname).toBe(`/c/channels/${serverId}`)await alice.page.getByTestId(tid.channelRow(channelId)).evaluate((element) => ((element as HTMLElement).click()diff --git a/src/web/src/test/e2e-ui/40-mobile-server-header-hierarchy.spec.ts b/src/web/src/test/e2e-ui/40-mobile-server-header-hierarchy.spec.tsindex 1859cd568..b7b5db60e 100644--- a/src/web/src/test/e2e-ui/40-mobile-server-header-hierarchy.spec.ts+++ b/src/web/src/test/e2e-ui/40-mobile-server-header-hierarchy.spec.ts@@ -11,27 +11,14 @@ import { tid } from "./_fixtures/testids"test.use({ viewport: { width: 390, height: 844 } })-async function expectServerControl(page: Page, serverId: string) {- const control = page.getByTestId(tid.channelHeaderServer(serverId))+async function expectMobileBack(page: Page) {+ const control = page.getByRole("banner").getByRole("button", { name: "Back" })await expect(control).toBeVisible()- await expect(page.getByRole("button", { name: "Back" })).toHaveCount(0)- const [controlBox, visualBox] = await Promise.all([- control.boundingBox(),- control.locator(":scope > span").boundingBox(),- ])+ const controlBox = await control.boundingBox()expect(controlBox).toMatchObject({ width: 44, height: 44 })- expect(visualBox).toMatchObject({ width: 24, height: 24 })return control}-async function expectParentBack(page: Page, serverId: string) {- const back = page.getByRole("button", { name: "Back" })- await expect(back).toBeVisible()- await expect(page.getByTestId(tid.channelHeaderServer(serverId))).toHaveCount(0)- expect(await back.boundingBox()).toMatchObject({ width: 32, height: 44 })- return back-}-function observeColdBootServerReconciliation(page: Page, serverId: string) {const readStatePath = "/api/community/users/me/read-state"const expectedPaths = new Set([@@ -74,6 +61,8 @@ test.describe.serial("mobile server header direct hierarchy", () => {let forumId: stringlet threadId: stringlet postId: string+ let threadName: string+ let postTitle: stringtest.beforeAll(async () => {const stamp = Date.now()@@ -81,15 +70,17 @@ test.describe.serial("mobile server header direct hierarchy", () => {textId = await seedChannel("alice", serverId, `text-${stamp}`)forumId = await seedChannel("alice", serverId, `forum-${stamp}`, "forum")const openerId = await seedMessage("alice", textId, `thread opener ${stamp}`)- threadId = await seedThread("alice", openerId, `thread-${stamp}`)- postId = await seedForumThread("alice", forumId, `post-${stamp}`, "post body")+ threadName = `thread-${stamp}`+ postTitle = `post-${stamp}`+ threadId = await seedThread("alice", openerId, threadName)+ postId = await seedForumThread("alice", forumId, postTitle, "post body")})test("top-level text and forum replace directly to the canonical server root", async ({ asUser }) => {const { page } = await asUser("alice")for (const channelId of [textId, forumId]) {await page.goto(`/c/channels/${serverId}/${channelId}`, { waitUntil: "commit" })- const control = await expectServerControl(page, serverId)+ const control = await expectMobileBack(page)const historyLength = await page.evaluate(() => history.length)await control.click()await expect.poll(() => new URL(page.url()).pathname).toBe(`/c/channels/${serverId}`)@@ -100,15 +91,14 @@ test.describe.serial("mobile server header direct hierarchy", () => {test("thread and forum post expose direct parent Back and inert current labels", async ({ asUser }) => {const { page } = await asUser("alice")for (const child of [- { id: threadId, parentId: textId },- { id: postId, parentId: forumId },+ { id: threadId, parentId: textId, name: threadName },+ { id: postId, parentId: forumId, name: postTitle },]) {await page.goto(`/c/channels/${serverId}/${child.id}`, { waitUntil: "commit" })- const back = await expectParentBack(page, serverId)- const parent = page.getByTestId(tid.channelHeaderParent(child.parentId))- await expect(parent).toBeVisible()+ const back = await expectMobileBack(page)const current = page.getByRole("banner").locator("span[title]").first()await expect(current).toBeVisible()+ await expect(current).toHaveText(child.name)expect(await current.evaluate((element) => element.tagName)).toBe("SPAN")const backHistoryLength = await page.evaluate(() => history.length)@@ -117,15 +107,6 @@ test.describe.serial("mobile server header direct hierarchy", () => {`/c/channels/${serverId}/${child.parentId}`,)expect(await page.evaluate(() => history.length)).toBe(backHistoryLength)-- await page.goto(`/c/channels/${serverId}/${child.id}`, { waitUntil: "commit" })- const parentHistoryLength = await page.evaluate(() => history.length)- await parent.click()- await expect.poll(() => new URL(page.url()).pathname).toBe(- `/c/channels/${serverId}/${child.parentId}`,- )- expect(await page.evaluate(() => history.length)).toBe(parentHistoryLength)-}})@@ -135,7 +116,7 @@ test.describe.serial("mobile server header direct hierarchy", () => {await page.setViewportSize({ width: 639, height: 844 })await page.goto(`/c/channels/${serverId}/${threadId}`, { waitUntil: "commit" })await expect(page.getByTestId(tid.composerInput)).toBeVisible({ timeout: 20_000 })- await expectParentBack(page, serverId)+ await expectMobileBack(page)await expect.poll(coldBootReconciliation.done, {message: "cold-boot read-state server reconciliation to settle",timeout: 10_000,@@ -159,7 +140,6 @@ test.describe.serial("mobile server header direct hierarchy", () => {await page.setViewportSize({ width: 640, height: 844 })await expect(page.getByRole("button", { name: "Back" })).toBeHidden()- await expect(page.getByTestId(tid.channelHeaderServer(serverId))).toHaveCount(0)await expect(page.getByTestId(tid.channelComposerShell)).toBeVisible()expect(await page.evaluate(({ composerTestId }) => ({banner: Reflect.get(window, "__headerHierarchyBanner") === document.querySelector('button[aria-label="Back"]')?.closest("header[role=banner]"),@@ -170,7 +150,6 @@ test.describe.serial("mobile server header direct hierarchy", () => {await page.setViewportSize({ width: 639, height: 844 })await expect(page.getByRole("button", { name: "Back" })).toBeVisible()- await expect(page.getByTestId(tid.channelHeaderServer(serverId))).toHaveCount(0)expect(await page.evaluate(({ composerTestId }) => ({banner: Reflect.get(window, "__headerHierarchyBanner") === document.querySelector('button[aria-label="Back"]')?.closest("header[role=banner]"),composer: Reflect.get(window, "__headerHierarchyComposer") === document.querySelector(`[data-testid="${composerTestId}"]`),diff --git a/src/web/src/test/e2e-ui/40-server-rail-unread.spec.ts b/src/web/src/test/e2e-ui/40-server-rail-unread.spec.tsindex 16665e7f3..2b8d64460 100644--- a/src/web/src/test/e2e-ui/40-server-rail-unread.spec.ts+++ b/src/web/src/test/e2e-ui/40-server-rail-unread.spec.ts@@ -121,8 +121,7 @@ test("server unread owns exact rail geometry, folder aggregation, read clear, anawait expectIndicatorHeight(folderIndicator, 0)await page.setViewportSize({ width: 390, height: 844 })- await expect(page.getByRole("button", { name: "Back" })).toHaveCount(0)- await page.getByTestId(tid.channelHeaderServer(foregroundServer)).click()+ await page.getByRole("banner").getByRole("button", { name: "Back" }).click()await expect.poll(() => new URL(page.url()).pathname).toBe(`/c/channels/${foregroundServer}`)if (await backgroundIcon.count() === 0) {await folder.click()diff --git a/src/web/src/test/e2e-ui/41-community-initial-load-module-skeletons.spec.ts b/src/web/src/test/e2e-ui/41-community-initial-load-module-skeletons.spec.tsindex a7384c240..e5ee2cb33 100644--- a/src/web/src/test/e2e-ui/41-community-initial-load-module-skeletons.spec.ts+++ b/src/web/src/test/e2e-ui/41-community-initial-load-module-skeletons.spec.ts@@ -178,7 +178,7 @@ test.describe.serial("community initial-load module skeletons", () => {expect(traffic.requests).toEqual([])expect(traffic.sockets()).toBe(0)if (expected.main === "server-conversation") {- await expect(page.getByTestId(tid.channelHeaderServerLoading)).toBeVisible()+ await expect(page.getByTestId(tid.messageHeaderLeadingLoading)).toBeVisible()await expect(page.getByRole("button", { name: "Back" })).toHaveCount(0)}await closeHeldContext(context, gate)diff --git a/src/web/src/test/e2e-ui/43-composer-attachment-drafts.spec.ts b/src/web/src/test/e2e-ui/43-composer-attachment-drafts.spec.tsindex 712da0f7f..dd12d4cff 100644--- a/src/web/src/test/e2e-ui/43-composer-attachment-drafts.spec.ts+++ b/src/web/src/test/e2e-ui/43-composer-attachment-drafts.spec.ts@@ -13,8 +13,8 @@ async function navigateChannel(page: Page, serverId: string, channelId: string)const route = `/c/channels/${serverId}/${channelId}`const row = page.getByTestId(tid.channelRow(channelId))if (!await row.isVisible()) {- const serverCrumb = page.getByTestId(tid.channelHeaderServer(serverId))- if (await serverCrumb.isVisible()) await serverCrumb.evaluate((element) => (element as HTMLElement).click())+ const back = page.getByRole("banner").getByRole("button", { name: "Back" })+ if (await back.isVisible()) await back.evaluate((element) => (element as HTMLElement).click())else await page.getByTestId(tid.serverIcon(serverId)).evaluate((element) => (element as HTMLElement).click())}await expect(row).toBeVisible()