mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Bits
This commit is contained in:
@@ -49,6 +49,7 @@ export async function runImageGenerationUpdatingState(cHandler: ConversationHand
|
||||
return true;
|
||||
} catch (error: any) {
|
||||
|
||||
|
||||
const drawError = `Issue: Sorry, I couldn't create an image for you.\n${error?.message || error?.toString() || 'Unknown error'}`;
|
||||
cHandler.messageFragmentReplace(assistantMessageId, placeholderFragmentId, createErrorContentFragment(drawError), true);
|
||||
|
||||
|
||||
@@ -113,11 +113,12 @@ export function DrawCreate(props: {
|
||||
// state
|
||||
const [prompts, setPrompts] = React.useState<DesignerPrompt[]>([]);
|
||||
|
||||
|
||||
// external state
|
||||
const { queueState } = useProcessingQueue(props.queue);
|
||||
console.log('DrawCreate', { queueState });
|
||||
// handlers
|
||||
|
||||
// handlers
|
||||
const handleStopDrawing = React.useCallback(() => {
|
||||
setPrompts([]);
|
||||
}, []);
|
||||
@@ -171,35 +172,41 @@ export function DrawCreate(props: {
|
||||
}}
|
||||
>
|
||||
|
||||
{/* Gallery/Placeholders Grid */}
|
||||
<Box sx={{
|
||||
// my: 'auto',
|
||||
mt: 'auto',
|
||||
mx: 'auto',
|
||||
border: '1px solid purple',
|
||||
minHeight: '300px',
|
||||
|
||||
{/* Draw history (last 50) */}
|
||||
// layout
|
||||
display: 'grid',
|
||||
gridTemplateColumns: props.isMobile
|
||||
? 'repeat(auto-fit, minmax(320px, 1fr))'
|
||||
: 'repeat(auto-fit, minmax(max(min(100%, 400px), 100%/5), 1fr))',
|
||||
gap: { xs: 2, md: 2 },
|
||||
}}>
|
||||
|
||||
{/*<Box sx={{*/}
|
||||
{/* // my: 'auto',*/}
|
||||
{/* // display: 'flex', flexDirection: 'column', alignItems: 'center',*/}
|
||||
{/* border: DEBUG_LAYOUT ? '1px solid purple' : undefined,*/}
|
||||
{/* minHeight: '300px',*/}
|
||||
{/* {prompts.map((prompt, _index) => {*/}
|
||||
{/* return (*/}
|
||||
{/* <TempPromptImageGen*/}
|
||||
{/* key={prompt.dpId}*/}
|
||||
{/* prompt={prompt}*/}
|
||||
{/* sx={{*/}
|
||||
{/* border: DEBUG_LAYOUT ? '1px solid green' : undefined,*/}
|
||||
{/* }}*/}
|
||||
{/* />*/}
|
||||
{/* );*/}
|
||||
|
||||
{/* // layout*/}
|
||||
{/* display: 'grid',*/}
|
||||
{/* gridTemplateColumns: props.isMobile*/}
|
||||
{/* ? 'repeat(auto-fit, minmax(320px, 1fr))'*/}
|
||||
{/* : 'repeat(auto-fit, minmax(max(min(100%, 400px), 100%/5), 1fr))',*/}
|
||||
{/* gap: { xs: 2, md: 2 },*/}
|
||||
{/*}}>*/}
|
||||
{/* {prompts.map((prompt, _index) => {*/}
|
||||
{/* return (*/}
|
||||
{/* <TempPromptImageGen*/}
|
||||
{/* key={prompt.dpId}*/}
|
||||
{/* prompt={prompt}*/}
|
||||
{/* sx={{*/}
|
||||
{/* border: DEBUG_LAYOUT ? '1px solid green' : undefined,*/}
|
||||
{/* }}*/}
|
||||
{/* />*/}
|
||||
{/* );*/}
|
||||
{/* })}*/}
|
||||
{/*</Box>*/}
|
||||
|
||||
<Box sx={{background:'red'}}>a</Box>
|
||||
<Box>a</Box>
|
||||
<Box>a</Box>
|
||||
<Box>a</Box>
|
||||
<Box>a</Box>
|
||||
<Box>a</Box>
|
||||
</Box>
|
||||
|
||||
{/* Fallback */}
|
||||
<ZeroGenerations />
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Box, Table } from '@mui/joy';
|
||||
|
||||
import { DBlobAssetType, DBlobImageAsset } from '~/modules/dblobs/dblobs.types';
|
||||
import { useDBAssetsByScopeAndType } from '~/modules/dblobs/dblobs.hooks';
|
||||
|
||||
import { ZeroGallery } from './gallery/ZeroGallery';
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ const drawCreateWorker: ItemAsyncWorker<DesignerPrompt> = async (item, _update,
|
||||
item.prompt,
|
||||
item._repeatCount,
|
||||
'global', 'app-draw',
|
||||
);
|
||||
).catch(console.error);
|
||||
return item;
|
||||
};
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ export async function requestPersistentStorage(): Promise<boolean> {
|
||||
}
|
||||
|
||||
const isGranted = await navigator.storage.persist();
|
||||
if (DEBUG_PERSISTENCE)
|
||||
console.log(`Persistent storage granted: ${isGranted}`, await estimatePersistentStorageOrThrow());
|
||||
if (DEBUG_PERSISTENCE || !isGranted)
|
||||
console.warn('Persistent storage granted', isGranted, /*await navigator.storage.getDirectory(),*/ await estimatePersistentStorageOrThrow());
|
||||
return isGranted;
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user