diff --git a/.changeset/file_description_editing.md b/.changeset/file_description_editing.md new file mode 100644 index 000000000..aa47ec3ca --- /dev/null +++ b/.changeset/file_description_editing.md @@ -0,0 +1,5 @@ +--- +default: minor +--- + +Added the ability to edit the description of a file and streamlined the image and video ui diff --git a/src/app/components/RenderMessageContent.tsx b/src/app/components/RenderMessageContent.tsx index 1a1a5376f..f235b7586 100644 --- a/src/app/components/RenderMessageContent.tsx +++ b/src/app/components/RenderMessageContent.tsx @@ -47,6 +47,7 @@ type RenderMessageContentProps = { htmlReactParserOptions: HTMLReactParserOptions; linkifyOpts: Opts; outlineAttachment?: boolean; + hideCaption?: boolean; }; const getMediaType = (url: string) => { @@ -71,6 +72,7 @@ function RenderMessageContentInternal({ htmlReactParserOptions, linkifyOpts, outlineAttachment, + hideCaption, }: RenderMessageContentProps) { const content = useMemo(() => getContent(), [getContent]); @@ -121,7 +123,7 @@ function RenderMessageContentInternal({ const renderCaption = () => { const hasCaption = content.body && content.body.trim().length > 0; - if (captionPosition === CaptionPosition.Hidden) return null; + if (captionPosition === CaptionPosition.Hidden || hideCaption) return null; if (hasCaption && content.filename && content.filename !== content.body) { if (captionPosition !== CaptionPosition.Inline) return ( diff --git a/src/app/components/message/content/ImageContent.tsx b/src/app/components/message/content/ImageContent.tsx index 017569662..c1856eb53 100644 --- a/src/app/components/message/content/ImageContent.tsx +++ b/src/app/components/message/content/ImageContent.tsx @@ -6,6 +6,8 @@ import { Chip, Icon, Icons, + Menu, + MenuItem, Modal, Overlay, OverlayBackdrop, @@ -15,6 +17,7 @@ import { Tooltip, TooltipProvider, as, + config, } from 'folds'; import classNames from 'classnames'; import { BlurhashCanvas } from 'react-blurhash'; @@ -84,6 +87,7 @@ export const ImageContent = as<'div', ImageContentProps>( const [error, setError] = useState(false); const [viewer, setViewer] = useState(false); const [blurred, setBlurred] = useState(markedAsSpoiler ?? false); + const [isHovered, setIsHovered] = useState(false); const [srcState, loadSrc] = useAsyncCallback( useCallback(async () => { @@ -119,7 +123,13 @@ export const ImageContent = as<'div', ImageContentProps>( }, [autoPlay, loadSrc]); return ( - + setIsHovered(true)} + onPointerLeave={() => setIsHovered(false)} + > {srcState.status === AsyncStatus.Success && ( }> @@ -156,7 +166,12 @@ export const ImageContent = as<'div', ImageContentProps>( /> )} {!autoPlay && !markedAsSpoiler && srcState.status === AsyncStatus.Idle && ( - +