fix: show lock icon for private channels in chat header (#198)

This commit is contained in:
Wes
2026-03-27 10:00:16 -07:00
committed by GitHub
parent d17f5d793c
commit 86d63aaebe
2 changed files with 24 additions and 3 deletions
+1
View File
@@ -668,6 +668,7 @@ export function AppShell() {
) : null
}
channelType={activeChannel?.channelType}
visibility={activeChannel?.visibility}
description={channelDescription}
statusBadge={
activeChannel?.channelType === "dm" &&
+23 -3
View File
@@ -1,22 +1,33 @@
import { Bot, CircleDot, FileText, Hash, Home, Settings2 } from "lucide-react";
import {
Bot,
CircleDot,
FileText,
Hash,
Home,
Lock,
Settings2,
} from "lucide-react";
import type * as React from "react";
import type { ChannelType } from "@/shared/api/types";
import type { ChannelType, ChannelVisibility } from "@/shared/api/types";
type ChatHeaderProps = {
actions?: React.ReactNode;
title: string;
description: string;
channelType?: ChannelType;
visibility?: ChannelVisibility;
mode?: "home" | "channel" | "settings" | "agents";
statusBadge?: React.ReactNode;
};
function ChannelIcon({
channelType,
visibility,
mode = "channel",
}: {
channelType?: ChannelType;
visibility?: ChannelVisibility;
mode?: "home" | "channel" | "settings" | "agents";
}) {
if (mode === "home") {
@@ -35,6 +46,10 @@ function ChannelIcon({
return <CircleDot className="h-5 w-5 text-primary" />;
}
if (visibility === "private") {
return <Lock className="h-5 w-5 text-primary" />;
}
if (channelType === "forum") {
return <FileText className="h-5 w-5 text-primary" />;
}
@@ -47,6 +62,7 @@ export function ChatHeader({
title,
description,
channelType,
visibility,
mode = "channel",
statusBadge,
}: ChatHeaderProps) {
@@ -58,7 +74,11 @@ export function ChatHeader({
>
<div className="min-w-0 flex-1">
<div className="flex min-w-0 items-center gap-2">
<ChannelIcon channelType={channelType} mode={mode} />
<ChannelIcon
channelType={channelType}
mode={mode}
visibility={visibility}
/>
<h1
className="truncate text-lg font-semibold tracking-tight"
data-testid="chat-title"