diff --git a/gui/src/components/AssistantAndOrgListbox/AccountOption.tsx b/gui/src/components/AssistantAndOrgListbox/AccountOption.tsx
new file mode 100644
index 000000000..8f4f8e11e
--- /dev/null
+++ b/gui/src/components/AssistantAndOrgListbox/AccountOption.tsx
@@ -0,0 +1,42 @@
+import { isOnPremSession } from "core/control-plane/AuthTypes";
+import { useAuth } from "../../context/Auth";
+import { ListboxOption, useFontSize } from "../ui";
+
+interface AccountOptionProps {
+ onClose: () => void;
+}
+
+export function AccountOption({ onClose }: AccountOptionProps) {
+ const { session, logout, login } = useAuth();
+ const tinyFont = useFontSize(-4);
+
+ // No account option for on-prem deployments
+ if (session && isOnPremSession(session)) {
+ return null;
+ }
+
+ async function handleClick() {
+ if (session) {
+ logout();
+ } else {
+ await login(false);
+ }
+ onClose();
+ }
+
+ return (
+
+
+ {session ? "Log out" : "Sign in"}
+
+
+ );
+}
diff --git a/gui/src/components/AssistantAndOrgListbox/OrganizationInfo.tsx b/gui/src/components/AssistantAndOrgListbox/OrganizationInfo.tsx
index 7965616ad..a4439afab 100644
--- a/gui/src/components/AssistantAndOrgListbox/OrganizationInfo.tsx
+++ b/gui/src/components/AssistantAndOrgListbox/OrganizationInfo.tsx
@@ -1,12 +1,20 @@
+import { useAuth } from "../../context/Auth";
import { ScopeSelect } from "./ScopeSelect";
export function OrganizationInfo() {
+ const { session } = useAuth();
+
return (
-
+
+
+ {!session && (
+ (Signed out)
+ )}
+
diff --git a/gui/src/components/AssistantAndOrgListbox/index.tsx b/gui/src/components/AssistantAndOrgListbox/index.tsx
index f4e92c144..114b70ef2 100644
--- a/gui/src/components/AssistantAndOrgListbox/index.tsx
+++ b/gui/src/components/AssistantAndOrgListbox/index.tsx
@@ -16,6 +16,7 @@ import {
Transition,
useFontSize,
} from "../ui";
+import { AccountOption } from "./AccountOption";
import { AssistantOptions } from "./AssistantOptions";
import { OrganizationInfo } from "./OrganizationInfo";
import { SelectedAssistantButton } from "./SelectedAssistantButton";
@@ -26,7 +27,7 @@ export function AssistantAndOrgListbox() {
const currentOrg = useAppSelector(selectCurrentOrg);
const ideMessenger = useContext(IdeMessengerContext);
const { isToolbarExpanded } = useLump();
- const { profiles, logout, selectedProfile, session, login } = useAuth();
+ const { profiles, selectedProfile, session, login } = useAuth();
const smallFont = useFontSize(-3);
const tinyFont = useFontSize(-4);
@@ -44,11 +45,6 @@ export function AssistantAndOrgListbox() {
close();
}
- function onLogout() {
- logout();
- close();
- }
-
useEffect(() => {
let lastToggleTime = 0;
const DEBOUNCE_MS = 800;
@@ -140,21 +136,7 @@ export function AssistantAndOrgListbox() {
- {session && (
-
-
- Log out
-
-
- )}
+
login(false)}
- >
- Sign in
-
- );
- }
-
- // No login button for on-prem deployments
- if (isOnPremSession(session)) {
- return null;
- }
-
- return (
-
- {({ close }) => (
- <>
-
-
-
- {selectedOrg === null ? "Personal" : selectedOrg.name}
-
-
-
-
-
-
-
-
-
- {session.account.label}
-
- {session.account.id}
-
-
-
- {organizations.length > 0 && (
-
-
-
-
- )}
-
-
-
-
-
- >
- )}
-
- );
-}
diff --git a/gui/src/pages/config/index.tsx b/gui/src/pages/config/index.tsx
index ea5ccef44..d9939a2c8 100644
--- a/gui/src/pages/config/index.tsx
+++ b/gui/src/pages/config/index.tsx
@@ -9,7 +9,6 @@ import { useNavigate } from "react-router-dom";
import { PageHeader } from "../../components/PageHeader";
import { useNavigationListener } from "../../hooks/useNavigationListener";
import { fontSize } from "../../util";
-import { AccountButton } from "./AccountButton";
import { HelpCenterSection } from "./HelpCenterSection";
import { IndexingSettingsSection } from "./IndexingSettingsSection";
import KeyboardShortcuts from "./KeyboardShortcuts";
@@ -63,7 +62,6 @@ function ConfigPage() {
showBorder
onTitleClick={() => navigate("/")}
title="Chat"
- rightContent={
}
/>
{/* Tab Headers */}
diff --git a/gui/src/pages/history/index.tsx b/gui/src/pages/history/index.tsx
index a8be3d92f..86950ff24 100644
--- a/gui/src/pages/history/index.tsx
+++ b/gui/src/pages/history/index.tsx
@@ -2,7 +2,6 @@ import { useNavigate } from "react-router-dom";
import { History } from "../../components/History";
import { PageHeader } from "../../components/PageHeader";
import { getFontSize } from "../../util";
-import { AccountButton } from "../config/AccountButton";
export default function HistoryPage() {
const navigate = useNavigate();
@@ -12,12 +11,7 @@ export default function HistoryPage() {
className="flex flex-1 flex-col overflow-auto"
style={{ fontSize: getFontSize() }}
>
-
navigate("/")}
- title="Chat"
- rightContent={}
- />
+ navigate("/")} title="Chat" />
);