feat: added field "title" and switched to it to free up caption for its normal use

This commit is contained in:
2026-02-15 09:09:48 +01:00
parent 4f71ac25bc
commit b5795867a8
20 changed files with 886 additions and 42 deletions

View File

@@ -11,17 +11,17 @@ interface PostSearchResult {
interface MediaSearchResult {
id: string;
originalName: string;
caption?: string;
title?: string;
mimeType: string;
createdAt: string;
}
/** Get display name for media: caption (truncated to 60 chars) or fallback to filename */
/** Get display name for media: title (truncated to 60 chars) or fallback to filename */
function getMediaDisplayName(media: MediaSearchResult): string {
if (media.caption) {
return media.caption.length > 60
? media.caption.substring(0, 60) + '...'
: media.caption;
if (media.title) {
return media.title.length > 60
? media.title.substring(0, 60) + '...'
: media.title;
}
return media.originalName;
}
@@ -187,7 +187,7 @@ export const InsertModal: React.FC<InsertModalProps> = ({
const externalLabel = mode === 'link' ? 'External URL' : 'External Image';
const searchPlaceholder = mode === 'link'
? 'Search posts by title or content...'
: 'Search media by name, caption, or alt text...';
: 'Search media by name, title, or alt text...';
return (
<div className="insert-modal-backdrop" onClick={handleBackdropClick}>