Skip to content

Commit

Permalink
Goofy labs
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Jun 30, 2023
1 parent 1c5ea78 commit aeb4538
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 9 deletions.
7 changes: 5 additions & 2 deletions src/apps/chat/components/composer/Composer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ export function Composer(props: {

// external state
const theme = useTheme();
const enterToSend = useUIPreferencesStore(state => state.enterToSend);
const { enterToSend, goofyLabs } = useUIPreferencesStore(state => ({
enterToSend: state.enterToSend,
goofyLabs: state.goofyLabs,
}), shallow);
const { sentMessages, appendSentMessage, clearSentMessages, startupText, setStartupText } = useComposerStore();
const { assistantTyping, tokenCount: conversationTokenCount, stopTyping } = useChatStore(state => {
const conversation = state.conversations.find(conversation => conversation.id === props.conversationId);
Expand Down Expand Up @@ -592,7 +595,7 @@ export function Composer(props: {
>
Stop
</Button>
) : isImmediate ? chatButton : (
) : (!goofyLabs && isImmediate) ? chatButton : (
<ButtonGroup variant='solid' color={isReAct ? 'info' : isFollowUp ? 'warning' : 'primary'} sx={{ flexGrow: 1 }}>
{chatButton}
<IconButton disabled={!props.conversationId || !chatLLM || !!chatModeMenuAnchor} onClick={handleToggleChatMode}>
Expand Down
14 changes: 14 additions & 0 deletions src/apps/settings/UISettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@ export function UISettings() {
const {
centerMode, setCenterMode,
enterToSend, setEnterToSend,
goofyLabs, setGoofyLabs,
renderMarkdown, setRenderMarkdown,
showPurposeFinder, setShowPurposeFinder,
zenMode, setZenMode,
} = useUIPreferencesStore(state => ({
centerMode: state.centerMode, setCenterMode: state.setCenterMode,
enterToSend: state.enterToSend, setEnterToSend: state.setEnterToSend,
goofyLabs: state.goofyLabs, setGoofyLabs: state.setGoofyLabs,
renderMarkdown: state.renderMarkdown, setRenderMarkdown: state.setRenderMarkdown,
showPurposeFinder: state.showPurposeFinder, setShowPurposeFinder: state.setShowPurposeFinder,
zenMode: state.zenMode, setZenMode: state.setZenMode,
Expand All @@ -82,6 +84,8 @@ export function UISettings() {

const handleRenderMarkdownChange = (event: React.ChangeEvent<HTMLInputElement>) => setRenderMarkdown(event.target.checked);

const handleGoofyLabsChange = (event: React.ChangeEvent<HTMLInputElement>) => setGoofyLabs(event.target.checked);

const handleShowSearchBarChange = (event: React.ChangeEvent<HTMLInputElement>) => setShowPurposeFinder(event.target.checked);

return (
Expand Down Expand Up @@ -156,6 +160,16 @@ export function UISettings() {
<LanguageSelect />
</FormControl>

<FormControl orientation='horizontal' sx={{ justifyContent: 'space-between' }}>
<Box>
<FormLabel>Goofy labs</FormLabel>
<FormHelperText>{goofyLabs ? 'Experiment' : 'Disabled'}</FormHelperText>
</Box>
<Switch checked={goofyLabs} onChange={handleGoofyLabsChange}
endDecorator={goofyLabs ? 'On' : 'Off'}
slotProps={{ endDecorator: { sx: { minWidth: 26 } } }} />
</FormControl>

</Stack>

);
Expand Down
2 changes: 1 addition & 1 deletion src/common/components/LogoSquircle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const LogoSquircle = (props: {
sx?: SxProps
}) =>
<SvgIcon
titleAccess='big-AGI logo'
titleAccess='Application logo'
viewBox='0 0 6.3500006 6.3499996' width='24' height='24'
fill='currentColor'
stroke='none' strokeWidth={0.691986} strokeLinecap='round' strokeLinejoin='round'
Expand Down
27 changes: 21 additions & 6 deletions src/common/layouts/appbar/ApplicationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,33 @@ function AppBarTitle() {
</Typography>
</Link>
);
};
}


function CommonContextItems(props: { onClose: () => void }) {
// external state
const { mode: colorMode, setMode: setColorMode } = useColorScheme();

const handleToggleDarkMode = (event: React.MouseEvent) => {
event.stopPropagation();
setColorMode(colorMode === 'dark' ? 'light' : 'dark');
};
// const { goofyLabs, setGoofyLabs } = useUIPreferencesStore(state => ({
// goofyLabs: state.goofyLabs,
// setGoofyLabs: state.setGoofyLabs,
// }), shallow);

const handleShowSettings = (event: React.MouseEvent) => {
event.stopPropagation();
useUIStateStore.getState().openSettings();
props.onClose();
};

const handleToggleDarkMode = (event: React.MouseEvent) => {
event.stopPropagation();
setColorMode(colorMode === 'dark' ? 'light' : 'dark');
};

// const handleToggleGoofyLabs = (event: React.ChangeEvent | React.MouseEvent) => {
// event.stopPropagation();
// setGoofyLabs(!goofyLabs);
// };

return <>

{/*<MenuItem onClick={handleToggleDarkMode}>*/}
Expand All @@ -75,6 +84,12 @@ function CommonContextItems(props: { onClose: () => void }) {
</IconButton>
</MenuItem>

{/*<MenuItem onClick={handleToggleGoofyLabs}>*/}
{/* <ListItemDecorator><ScienceIcon /></ListItemDecorator>*/}
{/* Goofy Labs*/}
{/* <Switch checked={goofyLabs} onChange={handleToggleGoofyLabs} sx={{ ml: 'auto' }} />*/}
{/*</MenuItem>*/}

</>;
}

Expand Down
6 changes: 6 additions & 0 deletions src/common/state/store-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ interface UIPreferencesStore {
enterToSend: boolean;
setEnterToSend: (enterToSend: boolean) => void;

goofyLabs: boolean;
setGoofyLabs: (goofyLabs: boolean) => void;

renderMarkdown: boolean;
setRenderMarkdown: (renderMarkdown: boolean) => void;

Expand Down Expand Up @@ -81,6 +84,9 @@ export const useUIPreferencesStore = create<UIPreferencesStore>()(
enterToSend: true,
setEnterToSend: (enterToSend: boolean) => set({ enterToSend }),

goofyLabs: false,
setGoofyLabs: (goofyLabs: boolean) => set({ goofyLabs }),

renderMarkdown: false,
setRenderMarkdown: (renderMarkdown: boolean) => set({ renderMarkdown }),

Expand Down

1 comment on commit aeb4538

@vercel
Copy link

@vercel vercel bot commented on aeb4538 Jun 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

big-agi – ./

big-agi-enricoros.vercel.app
big-agi-git-main-enricoros.vercel.app
get.big-agi.com

Please sign in to comment.