Skip to content

Commit

Permalink
squash fork diff
Browse files Browse the repository at this point in the history
  • Loading branch information
harlanlewis committed Jun 27, 2023
1 parent e3ea589 commit 8115b8c
Show file tree
Hide file tree
Showing 54 changed files with 2,587 additions and 1,201 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.16.0
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# This is Harlan's personal fork

Upstream readme below:

---

# `BIG-AGI` 🤖💬

Welcome to `big-AGI` 👋 your personal AGI application
Expand Down Expand Up @@ -156,4 +162,4 @@ This project is licensed under the MIT License.

[//]: # ([![GitHub issues](https://img.shields.io/github/issues/enricoros/big-agi)](https://github.com/enricoros/big-agi/issues))

Made with 💙
Made with 💙
6 changes: 3 additions & 3 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import Head from 'next/head';
import { Analytics as VercelAnalytics } from '@vercel/analytics/react';
// import { Analytics as VercelAnalytics } from '@vercel/analytics/react';
import { AppProps } from 'next/app';
import { CacheProvider, EmotionCache } from '@emotion/react';
import { CssBaseline, CssVarsProvider } from '@mui/joy';
Expand All @@ -26,7 +26,7 @@ function MyApp({ Component, emotionCache = clientSideEmotionCache, pageProps }:
<CacheProvider value={emotionCache}>
<Head>
<title>{Brand.Title.Common}</title>
<meta name='viewport' content='minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no' />
<meta name='viewport' content='minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no, maximum-scale=1, user-scalable=no' />
</Head>
{/* Rect-query provider */}
<QueryClientProvider client={queryClient}>
Expand All @@ -37,7 +37,7 @@ function MyApp({ Component, emotionCache = clientSideEmotionCache, pageProps }:
</CssVarsProvider>
</QueryClientProvider>
</CacheProvider>
<VercelAnalytics debug={false} />
{/* <VercelAnalytics debug={false} /> */}
</>;
}

Expand Down
10 changes: 5 additions & 5 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ export default function MyDocument({ emotionStyleTags }: MyDocumentProps) {
<meta name='theme-color' content={Brand.Meta.ThemeColor} />

{/* Favicons & PWA */}
<link rel='shortcut icon' href='/favicon.ico' />
<link rel='shortcut icon' href='/favicon.png' />
<link rel='icon' type='image/png' sizes='32x32' href='/icons/favicon-32x32.png' />
<link rel='icon' type='image/png' sizes='16x16' href='/icons/favicon-16x16.png' />
<link rel='apple-touch-icon' sizes='180x180' href='/icons/apple-touch-icon.png' />
<link rel='icon' type='image/png' sizes='64x64' href='/icons/favicon-64x64.png' />
<link rel='apple-touch-icon' sizes='192x192' href='/icons/apple-touch-icon.png' />
<link rel='manifest' href='/manifest.json' />
<meta name='apple-mobile-web-app-capable' content='yes' />
<meta name='apple-mobile-web-app-status-bar-style' content='black' />
Expand All @@ -46,7 +46,7 @@ export default function MyDocument({ emotionStyleTags }: MyDocumentProps) {
<meta property='twitter:title' content={Brand.Meta.Title} />
<meta property='twitter:description' content={Brand.Meta.Description} />
{Brand.URIs.CardImage && <meta property='twitter:image' content={Brand.URIs.CardImage} />}
<meta name='twitter:site' content={Brand.Meta.TwitterSite} />
{/* <meta name='twitter:site' content={Brand.Meta.TwitterSite} /> */}
<meta name='twitter:card' content='summary_large_image' />

{/* Style Sheets (injected and server-side) */}
Expand Down Expand Up @@ -119,4 +119,4 @@ MyDocument.getInitialProps = async (ctx: DocumentContext) => {
...initialProps,
emotionStyleTags,
};
};
};
Binary file removed public/favicon.ico
Binary file not shown.
Binary file added public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/card-dark-1200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/icons/favicon-16x16.png
Binary file not shown.
Binary file modified public/icons/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/favicon-64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/icon-1024x1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/icon-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 15 additions & 6 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
{
"name": "big-AGI",
"short_name": "AGI",
"theme_color": "#434356",
"background_color": "#B9B9C6",
"name": "HL GPT",
"short_name": "HL GPT",
"theme_color": "#EFEFEF",
"background_color": "#EFEFEF",
"description": "Personal AGI App",
"display": "standalone",
"start_url": "/",
"icons": [
{
"src": "/icons/icon-128x128.png",
"sizes": "128x128",
"type": "image/png"
},
{
"src": "/icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
"type": "image/png"
},
{
"src": "/icons/icon-256x256.png",
"sizes": "256x256",
"type": "image/png"
},
{
"src": "/icons/icon-512x512.png",
Expand Down
82 changes: 59 additions & 23 deletions src/apps/chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ import { Link } from '~/common/components/Link';
import { conversationToMarkdown } from '~/common/util/conversationToMarkdown';
import { createDMessage, DMessage, restoreConversationFromJson, useChatStore } from '~/common/state/store-chats';
import { extractCommands } from '~/common/util/extractCommands';
import { ApplicationBar } from '~/common/layouts/appbar/ApplicationBar';
import { useApplicationBarStore } from '~/common/layouts/appbar/store-applicationbar';
import { useUIPreferencesStore } from '~/common/state/store-ui';

import { ActionItems } from './components/appbar/ActionItems';
import { ChatContextItems } from '~/common/layouts/appbar/ChatContextItems';
import { ChatShareItems } from '~/common/layouts/appbar/ChatShareItems';
import { ChatMessageList } from './components/ChatMessageList';
import { Composer } from './components/composer/Composer';
import { ConversationItems } from './components/appbar/ConversationItems';
import { Dropdowns } from './components/appbar/Dropdowns';
import { Ephemerals } from './components/ephemerals/Ephemerals';
import { Ephemerals } from './components/Ephemerals';
import { ImportedModal, ImportedOutcome } from './components/appbar/ImportedModal';
import { runAssistantUpdatingState } from './editors/chat-stream';
import { runImageGenerationUpdatingState } from './editors/image-generate';
Expand Down Expand Up @@ -62,10 +64,11 @@ export function Chat() {

// external state
const theme = useTheme();
const { activeConversationId, isConversationEmpty, conversationsCount, importConversation, deleteAllConversations, setMessages, systemPurposeId, setAutoTitle } = useChatStore(state => {
const { activeConversationId, topNewConversationId, isConversationEmpty, conversationsCount, importConversation, deleteAllConversations, setMessages, systemPurposeId, setAutoTitle } = useChatStore(state => {
const conversation = state.conversations.find(conversation => conversation.id === state.activeConversationId);
return {
activeConversationId: state.activeConversationId,
topNewConversationId: state.conversations.length ? state.conversations[0].messages.length === 0 ? state.conversations[0].id : null : null,
isConversationEmpty: conversation ? !conversation.messages.length : true,
conversationsCount: state.conversations.length,
importConversation: state.importConversation,
Expand Down Expand Up @@ -136,7 +139,6 @@ export function Chat() {
}
};


const handleClearConversation = (conversationId: string) => setClearConfirmationId(conversationId);

const handleConfirmedClearConversation = () => {
Expand Down Expand Up @@ -170,7 +172,7 @@ export function Chat() {
try {
const paste = await apiAsync.publish.publish.mutate({
to: 'paste.gg',
title: '🤖💬 Chat Conversation',
title: 'GPT Conversation',
fileContent: markdownContent,
fileName: 'my-chat.md',
origin: linkToOrigin(),
Expand Down Expand Up @@ -236,34 +238,72 @@ export function Chat() {
[activeConversationId],
);

const actionItems = React.useMemo(() =>
<ActionItems
const contextItems = React.useMemo(() =>
<ChatContextItems
conversationId={activeConversationId} isConversationEmpty={isConversationEmpty}
isMessageSelectionMode={isMessageSelectionMode} setIsMessageSelectionMode={setIsMessageSelectionMode}
onClearConversation={handleClearConversation}
onPublishConversation={handlePublishConversation}
/>,
[activeConversationId, isConversationEmpty, isMessageSelectionMode],
);

const shareItems = React.useMemo(() =>
<ChatShareItems
conversationId={activeConversationId} isConversationEmpty={isConversationEmpty}
onPublishConversation={handlePublishConversation}
/>,
[activeConversationId, isConversationEmpty],
);

React.useEffect(() => {
useApplicationBarStore.getState().register(dropdowns, conversationsBadge, conversationItems, actionItems);
return () => useApplicationBarStore.getState().unregister();
}, [dropdowns, conversationsBadge, conversationItems, actionItems]);
useApplicationBarStore.getState().registerClientComponents(dropdowns, conversationsBadge, conversationItems, contextItems, shareItems);
return () => useApplicationBarStore.getState().unregisterClientComponents();
}, [dropdowns, conversationsBadge, conversationItems, contextItems, shareItems]);

const onLandingView = topNewConversationId === activeConversationId;

return <>

<ApplicationBar
onLandingView={ onLandingView }
sx={{
position: 'fixed',
zIndex: 100,
top: 0,
left: onLandingView ? undefined : 0,
right: 0,
py: 1,
px: 2,
...( !onLandingView && {
'&:before': {
content: '" "',
display: 'block',
backgroundImage: `linear-gradient(to bottom, rgba(${theme.vars.palette.neutral.lightChannel} / 0.85) 50%, rgba(${theme.vars.palette.neutral.lightChannel} / 0.0001))`,
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: '-1rem',
zIndex: '-1',
},
})
}}
/>

<ChatMessageList
conversationId={activeConversationId}
isMessageSelectionMode={isMessageSelectionMode} setIsMessageSelectionMode={setIsMessageSelectionMode}
onExecuteConversation={handleExecuteConversation}
onImagineFromText={handleImagineFromText}
sx={{
flexGrow: 1,
background: theme.vars.palette.background.level2,
overflowY: 'auto', // overflowY: 'hidden'
// There are multiple views within ChatMessageList (for example, PurposeSelector and the message thread)
// that inherit these `sx` values
maxWidth: '100dvw',
minHeight: 96,
}} />
overflowY: 'auto',
flexGrow: 1,
}}
/>

<Ephemerals
conversationId={activeConversationId}
Expand All @@ -274,18 +314,14 @@ export function Chat() {
minHeight: 64,
}} />


<Composer
conversationId={activeConversationId} messageId={null}
isDeveloperMode={systemPurposeId === 'Developer'}
onSendMessage={handleSendUserMessage}
sx={{
zIndex: 21, // position: 'sticky', bottom: 0,
background: theme.vars.palette.background.surface,
borderTop: `1px solid ${theme.vars.palette.divider}`,
p: { xs: 1, md: 2 },
pb: { xs: 4, md: 1 }, // space for iOS home indicator (TODO: conditional on browser env, not breakpoint)
}} />


{/* Import Chat */}
<input type='file' multiple hidden accept='.json' ref={conversationFileInputRef} onChange={handleImportConversationFromFiles} />
{!!conversationImportOutcome && (
Expand All @@ -295,14 +331,14 @@ export function Chat() {
{/* Clear */}
<ConfirmationModal
open={!!clearConfirmationId} onClose={() => setClearConfirmationId(null)} onPositive={handleConfirmedClearConversation}
confirmationText={'Are you sure you want to discard all the messages?'} positiveActionText={'Clear conversation'}
confirmationText={'Are you sure you want to discard all the messages?'} positiveActionText={'Delete conversation'}
/>

{/* Deletion */}
<ConfirmationModal
open={!!deleteConfirmationId} onClose={() => setDeleteConfirmationId(null)} onPositive={handleConfirmedDeleteConversation}
confirmationText={deleteConfirmationId === SPECIAL_ID_ALL_CHATS
? 'Are you absolutely sure you want to delete ALL conversations? This action cannot be undone.'
? 'Are you sure you want to delete all conversations? This cannot be undone.'
: 'Are you sure you want to delete this conversation?'}
positiveActionText={deleteConfirmationId === SPECIAL_ID_ALL_CHATS
? 'Yes, delete all'
Expand Down
Loading

0 comments on commit 8115b8c

Please sign in to comment.