Merge origin/main into terry-media-adaptive-trial
Combine collapsible long-text (main) with adaptive image frame (this branch). Resolved conflict in ImageWithTextBubble.tsx by keeping both SingleImageFrame and CollapsibleText imports.
This commit is contained in:
@@ -8,6 +8,7 @@ import { useLightbox } from "../overlays/ImageLightbox";
|
||||
import { autolink } from "../utils/autolink";
|
||||
import { computeAlbumLayout } from "../utils/albumLayout";
|
||||
import { postDisplayText } from "../utils/postText";
|
||||
import { CollapsibleText } from "../CollapsibleText";
|
||||
|
||||
const MAX_VISIBLE = 4;
|
||||
|
||||
@@ -82,9 +83,12 @@ export function AlbumBubble({ post }: { post: Post }) {
|
||||
})}
|
||||
</div>
|
||||
{text ? (
|
||||
<div className="message-stream-copyable-text select-text whitespace-pre-wrap break-words px-4 pt-3 text-[14px] leading-6 text-neutral-100">
|
||||
<CollapsibleText
|
||||
wrapperClassName="px-4 pt-3"
|
||||
className="message-stream-copyable-text select-text whitespace-pre-wrap break-words text-[14px] leading-6 text-neutral-100"
|
||||
>
|
||||
{autolink(text)}
|
||||
</div>
|
||||
</CollapsibleText>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
} from "../utils/filenameDisplay";
|
||||
import { formatBytes } from "../utils/formatBytes";
|
||||
import { postDisplayText } from "../utils/postText";
|
||||
import { CollapsibleText } from "../CollapsibleText";
|
||||
import { useToast } from "../../Toast";
|
||||
|
||||
function AttachmentRow({ postId, att }: { postId: string; att: Attachment }) {
|
||||
@@ -97,9 +98,9 @@ export function FileDocBubble({ post }: { post: Post }) {
|
||||
<AttachmentRow key={att.id} postId={post.id} att={att} />
|
||||
))}
|
||||
{text ? (
|
||||
<div className="message-stream-copyable-text select-text whitespace-pre-wrap break-words text-[15px] font-medium leading-6 text-neutral-100">
|
||||
<CollapsibleText className="message-stream-copyable-text select-text whitespace-pre-wrap break-words text-[15px] font-medium leading-6 text-neutral-100">
|
||||
{text}
|
||||
</div>
|
||||
</CollapsibleText>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useI18n } from "../../../i18n";
|
||||
import type { Post } from "../../../types/post";
|
||||
import { autolink } from "../utils/autolink";
|
||||
import { postDisplayText } from "../utils/postText";
|
||||
import { CollapsibleText } from "../CollapsibleText";
|
||||
import { SingleImageFrame } from "./SingleImageFrame";
|
||||
|
||||
export function ImageWithTextBubble({ post }: { post: Post }) {
|
||||
@@ -13,9 +14,12 @@ export function ImageWithTextBubble({ post }: { post: Post }) {
|
||||
<div className="flex flex-col">
|
||||
<SingleImageFrame postId={post.id} attachment={att} text={text} />
|
||||
{text ? (
|
||||
<div className="message-stream-copyable-text select-text whitespace-pre-wrap break-words px-4 pt-3 text-[14px] leading-6 text-neutral-100">
|
||||
<CollapsibleText
|
||||
wrapperClassName="px-4 pt-3"
|
||||
className="message-stream-copyable-text select-text whitespace-pre-wrap break-words text-[14px] leading-6 text-neutral-100"
|
||||
>
|
||||
{autolink(text)}
|
||||
</div>
|
||||
</CollapsibleText>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -2,12 +2,13 @@ import type { Post } from "../../../types/post";
|
||||
import { useI18n } from "../../../i18n";
|
||||
import { autolink } from "../utils/autolink";
|
||||
import { postDisplayText } from "../utils/postText";
|
||||
import { CollapsibleText } from "../CollapsibleText";
|
||||
|
||||
export function TextBubble({ post }: { post: Post }) {
|
||||
const { lang } = useI18n();
|
||||
return (
|
||||
<div className="message-stream-copyable-text select-text whitespace-pre-wrap break-words text-[14px] leading-snug text-neutral-100">
|
||||
<CollapsibleText className="message-stream-copyable-text select-text whitespace-pre-wrap break-words text-[14px] leading-snug text-neutral-100">
|
||||
{autolink(postDisplayText(post, lang))}
|
||||
</div>
|
||||
</CollapsibleText>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import type { Attachment, Post } from "../../../types/post";
|
||||
import { AttachmentDownloadPill } from "../AttachmentDownloadPill";
|
||||
import { useVideoPlayer } from "../overlays/VideoPlayer";
|
||||
import { autolink } from "../utils/autolink";
|
||||
import { CollapsibleText } from "../CollapsibleText";
|
||||
import { downloadAttachment } from "../utils/downloadFile";
|
||||
import { formatBytes } from "../utils/formatBytes";
|
||||
import { postDisplayText } from "../utils/postText";
|
||||
@@ -355,9 +356,12 @@ export function VideoBubble({ post }: { post: Post }) {
|
||||
})}
|
||||
</div>
|
||||
{text ? (
|
||||
<div className="message-stream-copyable-text select-text whitespace-pre-wrap break-words px-4 pt-3 text-[14px] leading-6 text-neutral-100">
|
||||
<CollapsibleText
|
||||
wrapperClassName="px-4 pt-3"
|
||||
className="message-stream-copyable-text select-text whitespace-pre-wrap break-words text-[14px] leading-6 text-neutral-100"
|
||||
>
|
||||
{autolink(text)}
|
||||
</div>
|
||||
</CollapsibleText>
|
||||
) : null}
|
||||
{listOpen ? (
|
||||
<VideoListDialog
|
||||
@@ -378,9 +382,12 @@ export function VideoBubble({ post }: { post: Post }) {
|
||||
<div className="flex flex-col">
|
||||
<VideoAttachmentCard postId={post.id} attachment={videos[0]} />
|
||||
{text ? (
|
||||
<div className="message-stream-copyable-text select-text whitespace-pre-wrap break-words px-4 pt-3 text-[14px] leading-6 text-neutral-100">
|
||||
<CollapsibleText
|
||||
wrapperClassName="px-4 pt-3"
|
||||
className="message-stream-copyable-text select-text whitespace-pre-wrap break-words text-[14px] leading-6 text-neutral-100"
|
||||
>
|
||||
{autolink(text)}
|
||||
</div>
|
||||
</CollapsibleText>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user