Attachments: uniform remove

This commit is contained in:
Enrico Ros
2024-05-24 22:33:33 -07:00
parent 2396966740
commit b824ddf2e3
2 changed files with 7 additions and 5 deletions
@@ -94,7 +94,7 @@ export function LLMAttachmentMenu(props: {
<CloseableMenu
dense placement='top'
open anchorEl={props.menuAnchor} onClose={props.onClose}
sx={{ minWidth: 200 }}
sx={{ minWidth: 260 }}
>
{/* Move Arrows */}
@@ -178,14 +178,14 @@ export function LLMAttachmentMenu(props: {
🡒 {mime/*unic.replace('image/', 'img: ')*/} · {resolution} · {output.source.reftype === 'dblob' ? output.source.bytesSize?.toLocaleString() : '(remote)'}
{' · '}
<Link onClick={() => handleShowContentInNewTab(output.source)}>
show <LaunchIcon sx={{ mx: 0.5, fontSize: 16 }} />
open <LaunchIcon sx={{ mx: 0.5, fontSize: 16 }} />
</Link>
</Typography>
);
} else if (output.atype === 'atext') {
return (
<Typography key={index} level='body-sm'>
🡒 txt: {output.text.length.toLocaleString()} bytes
🡒 text: {output.text.length.toLocaleString()} bytes
</Typography>
);
} else {
@@ -221,6 +221,7 @@ export function LLMAttachmentMenu(props: {
<ListItemDecorator><VerticalAlignBottomIcon /></ListItemDecorator>
Inline text
</MenuItem>
<ListDivider />
<MenuItem onClick={handleRemove}>
<ListItemDecorator><ClearIcon /></ListItemDecorator>
Remove
@@ -1,6 +1,6 @@
import * as React from 'react';
import { Box, IconButton, ListItemDecorator, MenuItem } from '@mui/joy';
import { Box, IconButton, ListDivider, ListItemDecorator, MenuItem } from '@mui/joy';
import ClearIcon from '@mui/icons-material/Clear';
import ExpandLessIcon from '@mui/icons-material/ExpandLess';
import VerticalAlignBottomIcon from '@mui/icons-material/VerticalAlignBottom';
@@ -150,9 +150,10 @@ export function LLMAttachmentsList(props: {
<ListItemDecorator><VerticalAlignBottomIcon /></ListItemDecorator>
Inline <span style={{ opacity: 0.5 }}>text attachments</span>
</MenuItem>
<ListDivider />
<MenuItem onClick={handleOverallClear}>
<ListItemDecorator><ClearIcon /></ListItemDecorator>
Clear{attachmentDrafts.length > 5 ? <span style={{ opacity: 0.5 }}> {attachmentDrafts.length} attachments</span> : null}
Remove All{attachmentDrafts.length > 5 ? <span style={{ opacity: 0.5 }}> {attachmentDrafts.length} attachments</span> : null}
</MenuItem>
</CloseableMenu>
)}