Fun picker fixes

This commit is contained in:
Jamie Kyle
2025-03-26 17:14:29 -07:00
committed by GitHub
parent 58da01ed51
commit 5e61230a24
6 changed files with 15 additions and 6 deletions

View File

@@ -35,7 +35,7 @@
&__input__scroller { &__input__scroller {
max-height: 300px; max-height: 300px;
min-height: 300px; min-height: 100px;
padding: 16px; padding: 16px;
// Need more padding on the right to make room for floating emoji button // Need more padding on the right to make room for floating emoji button
padding-inline-end: 36px; padding-inline-end: 36px;

View File

@@ -141,7 +141,7 @@ export function CompositionTextArea({
isActive={isActive} isActive={isActive}
isFormattingEnabled={isFormattingEnabled} isFormattingEnabled={isFormattingEnabled}
inputApi={inputApiRef} inputApi={inputApiRef}
large large={false}
moduleClassName="CompositionTextArea__input" moduleClassName="CompositionTextArea__input"
onEditorStateChange={handleChange} onEditorStateChange={handleChange}
onPickEmoji={onPickEmoji} onPickEmoji={onPickEmoji}

View File

@@ -84,7 +84,7 @@ export function DraftGifMessageSendModal(
state={props.gifDownloadState.loadingState} state={props.gifDownloadState.loadingState}
width={props.gifSelection.width} width={props.gifSelection.width}
height={props.gifSelection.height} height={props.gifSelection.height}
maxHeight={200} maxHeight={256}
aria-label={props.gifSelection.title} aria-label={props.gifSelection.title}
aria-describedby={descriptionId} aria-describedby={descriptionId}
/> />

View File

@@ -39,6 +39,8 @@ const FunImageBase = forwardRef(function FunImageBase(
width={props.width} width={props.width}
height={props.height} height={props.height}
draggable={false} draggable={false}
decoding="async"
loading="lazy"
/> />
); );
}); });

View File

@@ -5,6 +5,7 @@ import { sortBy } from 'lodash';
import { useEffect, useMemo, useState } from 'react'; import { useEffect, useMemo, useState } from 'react';
import { z } from 'zod'; import { z } from 'zod';
import * as log from '../../../logging/log'; import * as log from '../../../logging/log';
import * as Errors from '../../../types/errors';
import type { LocaleEmojiListType } from '../../../types/emoji'; import type { LocaleEmojiListType } from '../../../types/emoji';
import type { LocalizerType } from '../../../types/I18N'; import type { LocalizerType } from '../../../types/I18N';
import { strictAssert } from '../../../util/assert'; import { strictAssert } from '../../../util/assert';
@@ -569,7 +570,7 @@ function createEmojiSearchIndex(
const FuseKeys: Array<Fuse.FuseOptionKey> = [ const FuseKeys: Array<Fuse.FuseOptionKey> = [
{ name: 'shortName', weight: 100 }, { name: 'shortName', weight: 100 },
// { name: 'shortNames', weight: 1 }, { name: 'shortNames', weight: 1 },
{ name: 'emoticon', weight: 50 }, { name: 'emoticon', weight: 50 },
{ name: 'emoticons', weight: 1 }, { name: 'emoticons', weight: 1 },
]; ];
@@ -648,7 +649,10 @@ export function useEmojiSearch(i18n: LocalizerType): EmojiSearch {
setLocaleIndex(result); setLocaleIndex(result);
} }
} catch (error) { } catch (error) {
log.error(`Failed to get localized emoji list for ${locale}`, error); log.error(
`Failed to get localized emoji list for ${locale}`,
Errors.toLogFormat(error)
);
} }
} }

View File

@@ -402,6 +402,7 @@ export function saveDraftRecordingIfNeeded(): ThunkAction<
type WithPreSendChecksOptions = Readonly<{ type WithPreSendChecksOptions = Readonly<{
message?: string; message?: string;
voiceNoteAttachment?: InMemoryAttachmentDraftType; voiceNoteAttachment?: InMemoryAttachmentDraftType;
draftAttachments?: ReadonlyArray<AttachmentDraftType>;
}>; }>;
async function withPreSendChecks( async function withPreSendChecks(
@@ -425,6 +426,8 @@ async function withPreSendChecks(
]); ]);
const { message, voiceNoteAttachment } = options; const { message, voiceNoteAttachment } = options;
const draftAttachments =
options.draftAttachments ?? conversation.attributes.draftAttachments;
try { try {
dispatch(setComposerDisabledState(conversationId, true)); dispatch(setComposerDisabledState(conversationId, true));
@@ -457,7 +460,7 @@ async function withPreSendChecks(
if ( if (
!message?.length && !message?.length &&
!hasDraftAttachments(conversation.attributes.draftAttachments, { !hasDraftAttachments(draftAttachments, {
includePending: false, includePending: false,
}) && }) &&
!voiceNoteAttachment !voiceNoteAttachment