+
{alias}
))}
diff --git a/src/components/ScreenTransition.tsx b/src/components/ScreenTransition.tsx
index 3c67c71..1a508cc 100644
--- a/src/components/ScreenTransition.tsx
+++ b/src/components/ScreenTransition.tsx
@@ -22,11 +22,6 @@ export const ScreenTransition = ({
{children}
diff --git a/src/components/TitleBar.tsx b/src/components/TitleBar.tsx
index 106f406..6e78ee8 100644
--- a/src/components/TitleBar.tsx
+++ b/src/components/TitleBar.tsx
@@ -19,9 +19,10 @@ import { useState } from 'react';
import { soundAssets, playSound, initializeAudio } from '@/utils/sounds';
import { useAppUpdateChecker } from '@/hooks/useAppUpdateChecker';
import { useModalStore } from '@/stores/modal';
+import { useLaunchConfigStore } from '@/stores/launchConfig';
import iconUrl from '/icon.png';
-import { PRODUCT_NAME, TITLEBAR_HEIGHT } from '@/constants';
-import type { InterfaceTab, Screen } from '@/types';
+import { FRONTENDS, PRODUCT_NAME, TITLEBAR_HEIGHT } from '@/constants';
+import type { FrontendPreference, InterfaceTab, Screen } from '@/types';
interface TitleBarProps {
currentScreen: Screen;
@@ -29,6 +30,7 @@ interface TitleBarProps {
onTabChange?: (tab: InterfaceTab) => void;
onEject?: () => void;
onOpenSettings?: () => void;
+ frontendPreference?: FrontendPreference;
}
export const TitleBar = ({
@@ -37,16 +39,19 @@ export const TitleBar = ({
onTabChange,
onEject,
onOpenSettings,
+ frontendPreference,
}: TitleBarProps) => {
const computedColorScheme = useComputedColorScheme('light', {
getInitialValueInEffect: false,
});
const { hasUpdate, openReleasePage } = useAppUpdateChecker();
const { isAnyModalOpen } = useModalStore();
+ const { isImageGenerationMode } = useLaunchConfigStore();
const [logoClickCount, setLogoClickCount] = useState(0);
const [isElephantMode, setIsElephantMode] = useState(false);
const [isMouseSqueaking, setIsMouseSqueaking] = useState(false);
const [isMaximized, setIsMaximized] = useState(false);
+ const [isSelectOpen, setIsSelectOpen] = useState(false);
const handleMinimize = () => {
window.electronAPI.app.minimizeWindow();
@@ -101,7 +106,8 @@ export const TitleBar = ({
? 'var(--mantine-color-dark-7)'
: 'var(--mantine-color-gray-0)',
borderBottom: '1px solid var(--mantine-color-default-border)',
- WebkitAppRegion: isAnyModalOpen() ? 'no-drag' : 'drag',
+ WebkitAppRegion:
+ isAnyModalOpen() || isSelectOpen ? 'no-drag' : 'drag',
userSelect: 'none',
position: 'relative',
}}
@@ -154,10 +160,17 @@ export const TitleBar = ({
onTabChange?.(value as InterfaceTab);
}
}}
+ onDropdownOpen={() => setIsSelectOpen(true)}
+ onDropdownClose={() => setIsSelectOpen(false)}
data={[
{
value: 'chat',
- label: 'Chat',
+ label:
+ frontendPreference === 'sillytavern'
+ ? FRONTENDS.SILLYTAVERN
+ : isImageGenerationMode
+ ? FRONTENDS.STABLE_UI
+ : FRONTENDS.KOBOLDAI_LITE,
},
{ value: 'terminal', label: 'Terminal' },
{ value: 'eject', label: 'Eject' },
@@ -167,7 +180,7 @@ export const TitleBar = ({
size="sm"
style={{
textAlign: 'center',
- minWidth: '120px',
+ minWidth: '7.5rem',
}}
styles={{
input: {
diff --git a/src/components/UpdateAvailableModal.tsx b/src/components/UpdateAvailableModal.tsx
index a8dac56..cfac1e5 100644
--- a/src/components/UpdateAvailableModal.tsx
+++ b/src/components/UpdateAvailableModal.tsx
@@ -19,8 +19,8 @@ import { safeExecute } from '@/utils/logger';
interface UpdateAvailableModalProps {
opened: boolean;
onClose: () => void;
- currentVersion: InstalledVersion;
- availableUpdate: DownloadItem;
+ currentVersion?: InstalledVersion;
+ availableUpdate?: DownloadItem;
onUpdate: (download: DownloadItem) => Promise;
isDownloading?: boolean;
downloadProgress?: number;
@@ -38,11 +38,13 @@ export const UpdateAvailableModal = ({
const [isUpdating, setIsUpdating] = useState(false);
const handleUpdate = async () => {
- setIsUpdating(true);
- await safeExecute(async () => {
- await onUpdate(availableUpdate);
- onClose();
- }, 'Failed to update:');
+ if (availableUpdate) {
+ setIsUpdating(true);
+ await safeExecute(async () => {
+ await onUpdate(availableUpdate);
+ onClose();
+ }, 'Failed to update:');
+ }
setIsUpdating(false);
};
@@ -65,7 +67,7 @@ export const UpdateAvailableModal = ({
Current Version
- {currentVersion.version}
+ {currentVersion?.version}
@@ -78,14 +80,16 @@ export const UpdateAvailableModal = ({
Available Version
- {availableUpdate.version}
+ {availableUpdate?.version}