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

fix: MkInputをジェネリックコンポーネントにする #15345

Draft
wants to merge 17 commits into
base: develop
Choose a base branch
from

Conversation

takejohn
Copy link
Contributor

@takejohn takejohn commented Jan 25, 2025

What

  • MkInputをジェネリックコンポーネントにしてupdate:modelValueイベントの値の型がtypeプロパティに合うように変更
  • MkInputを使用してる箇所で省略されていたtype="text"を追加して型エラーを低減
  • Vue Test Utilsを導入
  • コンポーネントのテスト

Why

#15173 (comment) 関連

Additional info (optional)

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 Jan 25, 2025
Copy link

codecov bot commented Jan 25, 2025

Codecov Report

Attention: Patch coverage is 35.33835% with 86 lines in your changes missing coverage. Please review.

Project coverage is 19.86%. Comparing base (297186e) to head (42fcdaa).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...ckages/frontend/src/pages/admin/bot-protection.vue 0.00% 9 Missing ⚠️
...ckages/frontend/src/pages/admin/object-storage.vue 0.00% 5 Missing ⚠️
packages/frontend/src/pages/admin/settings.vue 0.00% 5 Missing ⚠️
packages/frontend/src/pages/settings/profile.vue 0.00% 5 Missing ⚠️
packages/frontend/src/components/MkPreview.vue 0.00% 4 Missing ⚠️
...ges/frontend/src/components/MkUserSelectDialog.vue 0.00% 4 Missing ⚠️
packages/frontend/src/pages/emoji-edit-dialog.vue 0.00% 4 Missing ⚠️
.../frontend/src/components/MkSystemWebhookEditor.vue 0.00% 3 Missing ⚠️
...ntend/src/components/MkUserSetupDialog.Profile.vue 0.00% 3 Missing ⚠️
packages/frontend/src/pages/admin/security.vue 0.00% 3 Missing ⚠️
... and 31 more
Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #15345       +/-   ##
============================================
- Coverage    38.70%   19.86%   -18.85%     
============================================
  Files         1603      764      -839     
  Lines       204267   111030    -93237     
  Branches      4015     1302     -2713     
============================================
- Hits         79067    22053    -57014     
+ Misses      124594    88395    -36199     
+ Partials       606      582       -24     

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

@takejohn takejohn changed the title fix: AiScriptで用いられるコンポーネントの型エラー修正 fix: MkInputをジェネリックコンポーネントにする Jan 26, 2025
@takejohn takejohn marked this pull request as ready for review January 26, 2025 14:17
@tai-cha
Copy link
Contributor

tai-cha commented Jan 26, 2025

MkInputのtype属性に関してはwithDefaultsを使ってむしろデフォルトvalueをtextにしてしまう手もあると思うのですがどうでしょうか…?(現在と変わらない使い勝手で型エラーを減らせるはず、かつ同時並行で動いているPRが死なないと思うのですが)

@takejohn
Copy link
Contributor Author

MkInputのtype属性に関してはwithDefaultsを使ってむしろデフォルトvalueをtextにしてしまう手もあると思うのですがどうでしょうか…?(現在と変わらない使い勝手で型エラーを減らせるはず、かつ同時並行で動いているPRが死なないと思うのですが)

withDefaultsを使ってtypeを省略すると型は推論できないみたいですね……
ただ、typeを省略するとupdate:modelValueイベントの値の型は従来通りstring | numberになるので、
42fcdaa はrevertして型エラーが出るところだけ変更するようにします。

@takejohn takejohn marked this pull request as draft January 27, 2025 02:38
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