Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhnace(frontend): 文字列比較のためのローマナイズを強化(設定の検索) #15632

Conversation

kakkokari-gtyih
Copy link
Contributor

@kakkokari-gtyih kakkokari-gtyih commented Mar 9, 2025

What

ローマナイズ強化

  • 全角英数字を半角に
  • 半角カタカナを全角に
  • 濁点・半濁点がリガチャになっているひらがな・カタカナ(例: で見かけ上 になっているもの)を結合
  • 異体字を正規化
  • 小文字に揃える
  • 文字列のトリム

をしたもの、およびMisskeyの言語設定が日本語の場合は

  • カタカナ・ローマ字をひらがなに揃えた場合
    (ローマ字変換は外部ライブラリを使用するため日本語のみのlazy-loadingとした)

で文字列を比較できる関数を追加

その他

  • IME確定前に検索するように
  • searchIndexが提供されていない場合は検索バーを表示しないように

Why

#13189 (comment)

Additional info (optional)

Related to #6489, #11308, #13981

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions bot added the packages/frontend Client side specific issue/PR label Mar 9, 2025
Copy link

codecov bot commented Mar 9, 2025

Codecov Report

Attention: Patch coverage is 71.60494% with 23 lines in your changes missing coverage. Please review.

Project coverage is 15.34%. Comparing base (d30ddd4) to head (8c922c2).
Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
packages/frontend/src/components/MkSuperMenu.vue 0.00% 23 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #15632      +/-   ##
===========================================
+ Coverage    15.28%   15.34%   +0.06%     
===========================================
  Files          784      785       +1     
  Lines        72025    72100      +75     
  Branches      1268     1279      +11     
===========================================
+ Hits         11008    11066      +58     
- Misses       60593    60610      +17     
  Partials       424      424              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@syuilo
Copy link
Member

syuilo commented Mar 9, 2025

searchIndexが提供されていない場合

そんな場合ってあるかしら

@kakkokari-gtyih
Copy link
Contributor Author

kakkokari-gtyih commented Mar 9, 2025

searchIndexが提供されていない場合

そんな場合ってあるかしら

  • 現状のコントロールパネル
  • 今後MkSuperMenuをsearchIndexを使わずに(単なる副ナビゲーションとして)使用したい場合

@syuilo
Copy link
Member

syuilo commented Mar 9, 2025

initIntlString って設定画面を開いたときに呼び出すのだとダメかしら

@kakkokari-gtyih
Copy link
Contributor Author

initIntlString って設定画面を開いたときに呼び出すのだとダメかしら

今後絵文字検索とかに転用することを考えるとbootで呼び出したほうが良さそう(絵文字ピッカーはbootで呼ばれるので)

@syuilo
Copy link
Member

syuilo commented Mar 9, 2025

bootで一律に呼び出すのではなく、設定画面や絵文字検索など必要になる場面(の直前)ごとに呼び出すようにした方が依存が明確になる & 当該機能を使わない場合に無駄な処理が行われなくなって効率的になり良さそう

@syuilo syuilo merged commit f35eb0f into misskey-dev:develop Mar 9, 2025
21 of 23 checks passed
@syuilo
Copy link
Member

syuilo commented Mar 9, 2025

🙏🏻 🙏🏻 🙏🏻

@kakkokari-gtyih kakkokari-gtyih deleted the enh-settings-search-normalize-string branch March 9, 2025 06:38
DA-TENSHI pushed a commit to SHINANOSKEY-Projekt/SHINANOSKEY that referenced this pull request Mar 9, 2025
* enhnace(frontend): 文字列比較のためのローマナイズを強化

* docs

* fix

* fix

* fix

* comment

* wanakanaの初回ロードをコンポーネント内に移動

* comment

* fix

* add tests

---------

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
harumaki2000 pushed a commit to harumaki2000/misskey-layp that referenced this pull request Mar 11, 2025
* enhnace(frontend): 文字列比較のためのローマナイズを強化

* docs

* fix

* fix

* fix

* comment

* wanakanaの初回ロードをコンポーネント内に移動

* comment

* fix

* add tests

---------

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/frontend Client side specific issue/PR
Projects
Development

Successfully merging this pull request may close these issues.

2 participants