mirror of
https://github.com/block/buzz.git
synced 2026-11-14 05:12:27 +00:00
## Summary - simplify channel settings into concise detail, member, canvas, and action sections - align human and agent profiles around shared rows, segmented tabs, and top-level actions - add agent runtime presentation, sticky glass behavior, and scroll-linked action transitions ## Snapshots ### Channel settings  ### Agent info  ### Agent runtime  ## Validation - `pnpm -C desktop check` - `pnpm -C desktop test` (4,604 passed) - `pnpm -C desktop build:e2e` - focused channel settings and agent profile Playwright tests --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Co-authored-by: Mongo <9cfd347903944d5b85aa6c93d2ab67381b978a92a31914bca69998968752a1d7@buzz.block.builderlab.xyz>
127 lines
4.0 KiB
TypeScript
127 lines
4.0 KiB
TypeScript
export { TerminalBootstrap } from "@/features/terminal/TerminalBootstrap";
|
|
import * as React from "react";
|
|
|
|
import type { Channel } from "@/shared/api/types";
|
|
import type { CreateChannelInput } from "@/features/sidebar/lib/useCreateChannelForm";
|
|
import { useDeferredModalOpen } from "@/shared/ui/deferredModalOpen";
|
|
|
|
const ChannelBrowserDialog = React.lazy(async () => {
|
|
const module = await import("@/features/channels/ui/ChannelBrowserDialog");
|
|
return { default: module.ChannelBrowserDialog };
|
|
});
|
|
|
|
const ChannelManagementSheet = React.lazy(async () => {
|
|
const module = await import("@/features/channels/ui/ChannelManagementSheet");
|
|
return { default: module.ChannelManagementSheet };
|
|
});
|
|
|
|
const MembersSidebar = React.lazy(async () => {
|
|
const module = await import("@/features/channels/ui/MembersSidebar");
|
|
return { default: module.MembersSidebar };
|
|
});
|
|
|
|
export type BrowseDialogType = "stream" | "forum" | null;
|
|
|
|
type AppShellOverlaysProps = {
|
|
activeChannel: Channel | null;
|
|
browseDialogType: BrowseDialogType;
|
|
channels: Channel[];
|
|
currentPubkey?: string;
|
|
isChannelManagementOpen: boolean;
|
|
isCreatingBrowseChannel?: boolean;
|
|
onBrowseChannelJoin: (channelId: string) => Promise<void>;
|
|
onBrowseChannelCreate?: (input: CreateChannelInput) => Promise<void>;
|
|
onBrowseDialogOpenChange: (open: boolean) => void;
|
|
onChannelManagementOpenChange: (open: boolean) => void;
|
|
onDeleteActiveChannel: () => void;
|
|
onSelectChannel: (channelId: string) => void;
|
|
relayUrl?: string;
|
|
};
|
|
|
|
export function AppShellOverlays({
|
|
activeChannel,
|
|
browseDialogType,
|
|
channels,
|
|
currentPubkey,
|
|
isChannelManagementOpen,
|
|
isCreatingBrowseChannel,
|
|
onBrowseChannelJoin,
|
|
onBrowseChannelCreate,
|
|
onBrowseDialogOpenChange,
|
|
onChannelManagementOpenChange,
|
|
onDeleteActiveChannel,
|
|
onSelectChannel,
|
|
relayUrl,
|
|
}: AppShellOverlaysProps) {
|
|
const [membersChannel, setMembersChannel] = React.useState<Channel | null>(
|
|
null,
|
|
);
|
|
const [visibleBrowseDialogType, setVisibleBrowseDialogType] =
|
|
React.useState<BrowseDialogType>(null);
|
|
const { cancelDeferredModalOpen, openNextFrame: openModalNextFrame } =
|
|
useDeferredModalOpen();
|
|
|
|
React.useEffect(() => {
|
|
if (browseDialogType === null) {
|
|
cancelDeferredModalOpen();
|
|
setVisibleBrowseDialogType(null);
|
|
return;
|
|
}
|
|
|
|
setVisibleBrowseDialogType(null);
|
|
openModalNextFrame(() => {
|
|
setVisibleBrowseDialogType(browseDialogType);
|
|
});
|
|
}, [browseDialogType, cancelDeferredModalOpen, openModalNextFrame]);
|
|
|
|
const renderedBrowseDialogType = visibleBrowseDialogType ?? browseDialogType;
|
|
|
|
return (
|
|
<>
|
|
{browseDialogType !== null ? (
|
|
<React.Suspense fallback={null}>
|
|
<ChannelBrowserDialog
|
|
channels={channels}
|
|
channelTypeFilter={renderedBrowseDialogType ?? browseDialogType}
|
|
isCreatingChannel={isCreatingBrowseChannel}
|
|
onCreateChannel={onBrowseChannelCreate}
|
|
onJoinChannel={onBrowseChannelJoin}
|
|
onOpenChange={onBrowseDialogOpenChange}
|
|
onSelectChannel={onSelectChannel}
|
|
open={visibleBrowseDialogType !== null}
|
|
/>
|
|
</React.Suspense>
|
|
) : null}
|
|
|
|
{isChannelManagementOpen && activeChannel !== null ? (
|
|
<React.Suspense fallback={null}>
|
|
<ChannelManagementSheet
|
|
channel={activeChannel}
|
|
currentPubkey={currentPubkey}
|
|
onDeleted={onDeleteActiveChannel}
|
|
onOpenMembers={() => setMembersChannel(activeChannel)}
|
|
onOpenChange={onChannelManagementOpenChange}
|
|
open={true}
|
|
/>
|
|
</React.Suspense>
|
|
) : null}
|
|
|
|
{membersChannel ? (
|
|
<React.Suspense fallback={null}>
|
|
<MembersSidebar
|
|
channel={membersChannel}
|
|
currentPubkey={currentPubkey}
|
|
onOpenChange={(nextOpen) => {
|
|
if (!nextOpen) {
|
|
setMembersChannel(null);
|
|
}
|
|
}}
|
|
open={true}
|
|
relayUrl={relayUrl}
|
|
/>
|
|
</React.Suspense>
|
|
) : null}
|
|
</>
|
|
);
|
|
}
|