Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions desktop/src/app/AppHuddleShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ type AppHuddleShellProps = {
onShowHuddleInMainApp: (ephemeralChannelId: string) => void;
onViewHuddleChannel: (ephemeralChannelId: string) => void;
onVisibilityChange: (visible: boolean) => void;
/**
* Terminal substrate layer. Rendered behind the app surface (which carries
* z-10) so the ⌘J handoff can reveal it by fading the surface above. Not
* mounted in the dedicated Huddle room window.
*/
terminal?: React.ReactNode;
};

export function AppHuddleShell({
Expand All @@ -37,7 +31,6 @@ export function AppHuddleShell({
onShowHuddleInMainApp,
onViewHuddleChannel,
onVisibilityChange,
terminal,
}: AppHuddleShellProps) {
return (
<HuddleProvider
Expand All @@ -55,7 +48,6 @@ export function AppHuddleShell({
data-huddle-open={isDrawerOpen}
data-huddle-window={isRoom}
>
{isRoom ? null : terminal}
<div
className={cn(
"buzz-huddle-app-surface z-10 flex min-h-0 flex-row overflow-hidden bg-background",
Expand Down
2 changes: 1 addition & 1 deletion desktop/src/app/AppShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,6 @@ export function AppShell() {
onShowHuddleInMainApp={showHuddleInMainApp}
onViewHuddleChannel={viewHuddleChannel}
onVisibilityChange={handleHuddleVisibilityChange}
terminal={<TerminalBootstrap {...terminalContext} />}
>
{hasCommunityRail && !isHuddleRoom ? (
<CommunityRail
Expand Down Expand Up @@ -942,6 +941,7 @@ export function AppShell() {
isHuddleRoom={isHuddleRoom}
isHuddleRoomStarting={isHuddleRoomStarting}
mainInsetRef={mainInsetRef}
terminal={<TerminalBootstrap {...terminalContext} />}
>
<Outlet />
</AppShellChannelSurface>
Expand Down
4 changes: 3 additions & 1 deletion desktop/src/app/AppShellChannelSurface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ type AppShellChannelSurfaceProps = {
isHuddleRoom: boolean;
isHuddleRoomStarting: boolean;
mainInsetRef: React.RefObject<HTMLElement | null>;
terminal?: React.ReactNode;
};

export function AppShellChannelSurface({
children,
isHuddleRoom,
isHuddleRoomStarting,
mainInsetRef,
terminal,
}: AppShellChannelSurfaceProps) {
return (
<MainInsetProvider mainInsetRef={mainInsetRef}>
Expand All @@ -34,7 +36,7 @@ export function AppShellChannelSurface({
style={chromeCssVarDefaults as React.CSSProperties}
>
{isHuddleRoom && !isHuddleRoomStarting ? <HuddleRoomHeader /> : null}
<BuzzTheme.ContentSurface unframed={isHuddleRoom}>
<BuzzTheme.ContentSurface terminal={terminal} unframed={isHuddleRoom}>
{isHuddleRoomStarting ? <HuddleStartingView /> : children}
</BuzzTheme.ContentSurface>
</SidebarInset>
Expand Down
9 changes: 8 additions & 1 deletion desktop/src/app/BuzzThemeSurfaces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ export function GradientLayer() {
export function ContentSurface({
children,
unframed = false,
terminal,
}: {
children: ReactNode;
terminal?: ReactNode;
/** Used by dedicated huddle windows, which should not resemble app cards. */
unframed?: boolean;
}) {
Expand All @@ -38,7 +40,12 @@ export function ContentSurface({
data-buzz-content-surface
data-buzz-content-unframed={unframed ? true : undefined}
>
{children}
<div className="buzz-content-primary flex min-h-0 flex-1 flex-col overflow-hidden">
{children}
</div>
<div className="buzz-terminal-dock-host" data-terminal-dock>
{terminal}
</div>
</div>
);
}
29 changes: 27 additions & 2 deletions desktop/src/features/channels/ui/ChannelScreenHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LogIn } from "lucide-react";
import { LogIn, SquareTerminal } from "lucide-react";
import type * as React from "react";

import { ChatHeader } from "@/features/chat/ui/ChatHeader";
Expand All @@ -17,6 +17,10 @@ import { UserProfilePopover } from "@/features/profile/ui/UserProfilePopover";
import { Button } from "@/shared/ui/button";
import type { Channel, PresenceStatus } from "@/shared/api/types";
import { UserAvatar } from "@/shared/ui/UserAvatar";
import {
toggleTerminalPanel,
useTerminalPanel,
} from "@/features/terminal/terminalPanelStore";

const DM_HEADER_AVATAR_SIZE = 32;
const DM_HEADER_AVATAR_STATUS_GEOMETRY = scaleProfileAvatarStatusGeometry(
Expand Down Expand Up @@ -74,7 +78,22 @@ export function ChannelScreenHeader({
!activeChannel.archivedAt &&
onJoinChannel;

const actions = activeChannel ? (
const terminalPanel = useTerminalPanel();
const terminalButton = activeChannel ? (
<Button
aria-label={
terminalPanel.mode === "closed" ? "Open Buzz Term" : "Hide Buzz Term"
}
onClick={toggleTerminalPanel}
size="icon"
title="Buzz Term (⌘J)"
type="button"
variant={terminalPanel.mode === "closed" ? "outline" : "secondary"}
>
<SquareTerminal />
</Button>
) : null;
const channelActions = activeChannel ? (
showJoinButton ? (
<Button
disabled={isJoining}
Expand All @@ -97,6 +116,12 @@ export function ChannelScreenHeader({
/>
)
) : null;
const actions = activeChannel ? (
<div className="flex items-center gap-1">
{terminalButton}
{channelActions}
</div>
) : null;

if (!showHeaderContent) {
return null;
Expand Down
Loading
Loading