bug: emoji suggestions open for times like 12:00 and Enter inserts an emoji instead of sending

オープン 初心者向け
#1,431 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, react
領域
frontend

調査の方向性

まず useSearchEmoji と現在の /:([a-zA-Z0-9_+-]*?)$/ によるマッチを読み、ComposerPopupProvider または useComposerBoxPopup の triggerAnywhere の動作と比較します。時刻や比率のコロンで絵文字候補が開かず、:smi は文頭、スペースの後、改行後でも引き続き機能すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Description:

The emoji suggestions open for any colon followed by two characters, including the colon inside a time or a ratio. While the list is open, Enter picks the highlighted emoji instead of sending the message, so a message like "meeting at 12:00" is changed to "meeting at 12💯 " and not sent.

useSearchEmoji matches /:([a-zA-Z0-9_+-]*?)$/, which does not check what comes before the colon. Rocket.Chat's own composer only opens the emoji popup when the colon starts the message or follows a space ((?:^|\s):, from triggerAnywhere in ComposerPopupProvider / useComposerBoxPopup).

Steps to reproduce:
  1. In the message box, type meeting at 12:00.
  2. The emoji list opens with 💯.
  3. Press Enter.
Expected behavior:

No emoji list opens for 12:00, and Enter sends "meeting at 12:00".

Actual behavior:

The list opens and Enter replaces :00 with 💯. The message box now contains "meeting at 12💯 " and nothing is sent. Other examples with the current emoji list: see you at 10:30 (🈯), ratio 16:10 (💯, 🔟), note:ok (10 suggestions).

I'd like to send a fix that requires the colon to be at the start of the message or after a space, as in Rocket.Chat. Typing :smi at the start, after a space, or on a new line keeps working.

主要言語
JavaScript
スター
170
フォーク
397
平均マージ
8日 20時間
マージ済み PR(30日)
6

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

RocketChat/EmbeddedChat のほかの issue

RocketChat/EmbeddedChat の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。