Files
buzz/mobile/lib/features/channels/compose_bar.dart
klopez4212 874a5699ba Add inline emoji shortcode suggestions on mobile (#9882)
Show Unicode and community emoji in the mobile composer after a colon
and two shortcode characters. Tap a suggestion or press Tab or Enter to
replace the token at the cursor. Long labels truncate on one line.

Tested on iPhone Duo and with iOS and Android composer widget tests. The
final label truncation was validated locally.

---------

Signed-off-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
Signed-off-by: Tom Brow <tomb@block.xyz>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
Co-authored-by: Tom Brow <tomb@block.xyz>
2026-11-23 17:07:50 +00:00

117 lines
4.6 KiB
Dart

import 'composer_geometry.dart';
import 'composer_transcription.dart';
import 'package:buzz/shared/widgets/buzz_toast.dart';
import 'package:buzz/shared/widgets/feedback_snackbar.dart';
import 'package:buzz/shared/utils/stylus_handwriting.dart';
import 'composer_send_origin.dart';
import 'dart:async';
import 'dart:collection';
import 'dart:io';
import 'dart:math' as math;
import 'package:camera/camera.dart' as camera;
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/physics.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:image_picker/image_picker.dart';
import 'package:buzz/shared/theme/buzz_icons.dart';
import 'package:nostr/nostr.dart' as nostr;
import '../../shared/agents/owned_agent_directory.dart';
import '../../shared/identity_names/identity_name_policy.dart';
import '../../shared/identity_names/identity_names.dart';
import '../../shared/identity_names/identity_names_provider.dart';
import '../../shared/mentions/agent_identity_provider.dart';
import '../../shared/mentions/bound_mentions.dart';
import '../../shared/mentions/mention_bindings.dart';
import '../../shared/mentions/mention_identity_links.dart';
import '../../shared/mentions/mention_rules.dart';
import '../../shared/huddle/huddle_session.dart';
import '../../shared/relay/relay.dart';
import '../../shared/theme/theme.dart';
import '../../shared/widgets/avatar_image.dart';
import '../../shared/widgets/anchored_popover_menu.dart';
import '../../shared/widgets/buzz_loading_indicator.dart';
import '../../shared/widgets/concentric_sheet_surface.dart';
import '../../shared/widgets/keyboard_dismiss_on_drag.dart';
import '../../shared/widgets/ios_glass_navigation_button.dart';
import '../../shared/widgets/mobile_tab_footer_backdrop.dart';
import '../../shared/widgets/modal_presentation.dart';
import '../../shared/profile/user_cache_provider.dart';
import '../../shared/profile/user_profile.dart';
import '../../shared/custom_emoji/custom_emoji.dart';
import '../../shared/custom_emoji/custom_emoji_provider.dart';
import '../../shared/deeplink/deep_link.dart';
import '../../shared/share/pending_share.dart';
import '../../shared/drafts/compose_drafts_provider.dart';
import 'camera_capture_cleanup.dart';
import 'channel.dart';
import 'channel_management_provider.dart';
import 'channels_provider.dart';
import 'timeline_message.dart';
import '../../shared/custom_emoji/custom_emoji_render.dart';
import '../../shared/emoji/emoji_data_provider.dart';
import '../../shared/emoji/emoji_search.dart';
import '../../shared/emoji/emoji_picker.dart';
import 'message_content/markdown_link_mentions.dart';
import 'mentions/mention_candidates.dart';
import 'mentions/mention_candidates_provider.dart';
import 'mentions/mention_ranking.dart';
import 'mentions/stable_mention_rows.dart';
import 'photo_library.dart';
import 'voice_note_attachment.dart';
import 'voice_note_composer_recorder.dart';
import 'voice_note_recording.dart';
import 'package:buzz/shared/crypto/event_signing.dart';
part 'compose_bar/helpers.dart';
part 'compose_bar/composer_mentions.dart';
part 'compose_bar/mention_chip_qualifiers.dart';
part 'compose_bar/agent_mention_prefill.dart';
part 'compose_bar/markdown_editing_controller.dart';
part 'compose_bar/composer_chips.dart';
part 'compose_bar/draft_lifecycle.dart';
part 'compose_bar/suggestions.dart';
part 'compose_bar/mention_chooser.dart';
part 'compose_bar/formatting_toolbar.dart';
part 'compose_bar/attachments.dart';
part 'compose_bar/binding_history.dart';
part 'compose_bar/video_thumbnail.dart';
part 'compose_bar/upload_progress_pill.dart';
part 'compose_bar/photo_gallery_picker.dart';
part 'compose_bar/ios_photo_picker.dart';
part 'compose_bar/ios_attachment_popover.dart';
part 'compose_bar/camera_preview.dart';
part 'compose_bar/send_button.dart';
part 'compose_bar/voice_note.dart';
part 'compose_bar/input_tray.dart';
part 'compose_bar/layout.dart';
part 'compose_bar/ios_controls.dart';
part 'compose_bar/selection_menu.dart';
part 'compose_bar/hardware_keyboard.dart';
part 'compose_bar/dock.dart';
part 'compose_bar/share_delivery.dart';
part 'compose_bar/compose_bar_widget.dart';
part 'compose_bar/message_edit_sheet.dart';
/// Callback used by channels and threads to submit composer content.
typedef ComposeBarOnSend =
Future<void> Function(
String content,
List<String> mentionPubkeys, {
List<List<String>> mediaTags,
});