MCPcopy Create free account
hub / github.com/block/buzz / AppShell

Function AppShell

desktop/src/app/AppShell.tsx:91–890  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89});
90
91export function AppShell() {
92 useWebviewZoomShortcuts();
93 useTauriWindowDrag();
94 useWebviewScrollBoundaryLock();
95
96 const workspacesHook = useWorkspaces();
97 const workspaceRailEnabled = useFeatureEnabled("workspaceRail");
98 const [isAddWorkspaceOpen, setIsAddWorkspaceOpen] = React.useState(false);
99 const [isChannelManagementOpen, setIsChannelManagementOpen] =
100 React.useState(false);
101 const [managedChannelId, setManagedChannelId] = React.useState<string | null>(
102 null,
103 );
104 const [searchFocusRequest, setSearchFocusRequest] = React.useState(0);
105 const [browseDialogType, setBrowseDialogType] =
106 React.useState<BrowseDialogType>(null);
107 const [isNewDmOpen, setIsNewDmOpen] = React.useState(false);
108 const [isCreateChannelOpen, setIsCreateChannelOpen] = React.useState(false);
109 const [isHuddleDrawerOpen, setIsHuddleDrawerOpen] = React.useState(false);
110 const mainInsetRef = React.useRef<HTMLElement>(null);
111 const location = useLocation();
112 const queryClient = useQueryClient();
113 const {
114 goAgents,
115 goChannel,
116 goHome,
117 goProjects,
118 goPulse,
119 goSettings,
120 goWorkflows,
121 closeSettings,
122 openSearchHit,
123 } = useAppNavigation();
124 const { canGoBack, canGoForward, goBack, goForward } =
125 useBackForwardControls();
126 const { selectedChannelId, selectedView } = React.useMemo(
127 () => deriveShellRoute(location.pathname),
128 [location.pathname],
129 );
130 // Settings lives in history so back returns to the previous app entry.
131 const settingsOpen = location.pathname === "/settings";
132 const locationSearchSection = (location.search as { section?: unknown })
133 .section;
134 const settingsSection: SettingsSection = isSettingsSection(
135 locationSearchSection,
136 )
137 ? locationSearchSection
138 : DEFAULT_SETTINGS_SECTION;
139 const startupReady = useDeferredStartup();
140
141 const identityQuery = useIdentityQuery();
142 const { mutedChannelIds, muteChannel, unmuteChannel } = useChannelMutes(
143 identityQuery.data?.pubkey,
144 );
145 const { starredChannelIds, starChannel, unstarChannel } = useChannelStars(
146 identityQuery.data?.pubkey,
147 );
148 usePersonaSync(identityQuery.data?.pubkey);

Callers

nothing calls this directly

Calls 15

useWebviewZoomShortcutsFunction · 0.90
useTauriWindowDragFunction · 0.90
useWorkspacesFunction · 0.90
useFeatureEnabledFunction · 0.90
useAppNavigationFunction · 0.90
useBackForwardControlsFunction · 0.90
deriveShellRouteFunction · 0.90
isSettingsSectionFunction · 0.90
useDeferredStartupFunction · 0.90
useIdentityQueryFunction · 0.90
useChannelMutesFunction · 0.90

Tested by

no test coverage detected