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

入出金作成ページを Figma に合わせる #168

Merged
merged 8 commits into from
Jul 22, 2024

Conversation

anko9801
Copy link
Contributor

@anko9801 anko9801 commented May 18, 2024

  • InputRadioButton コンポーネントを変更しました。他に入出金詳細ページの編集時のみに使われていて見た目は大丈夫そうです。

入出金作成ページの Figma のリンク

@anko9801 anko9801 requested a review from mehm8128 May 18, 2024 06:55
@anko9801 anko9801 self-assigned this May 18, 2024
@anko9801 anko9801 linked an issue May 18, 2024 that may be closed by this pull request
src/pages/NewTransactionPage.vue Outdated Show resolved Hide resolved
src/components/shared/InputRadioButton.vue Outdated Show resolved Hide resolved
src/pages/NewTransactionPage.vue Outdated Show resolved Hide resolved
@anko9801 anko9801 requested a review from mehm8128 May 18, 2024 14:40
Copy link
Contributor

@mehm8128 mehm8128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修正完了したら再レビュー投げてほしいです

src/components/newTransaction/NewTransactionTarget.vue Outdated Show resolved Hide resolved
@mehm8128
Copy link
Contributor

mehm8128 commented Jul 5, 2024

/improve

Copy link

github-actions bot commented Jul 5, 2024

PR Code Suggestions ✨

CategorySuggestion                                                                                                                                    Score
Possible issue
取引相手が1人の場合の削除を防ぐロジックを復元する。

handleRemoveTarget
関数で、取引相手が1人の場合に削除を防ぐロジックが削除されました。これにより、取引相手が1人の場合でも削除できてしまいます。このロジックを復元することを提案します。

src/components/newTransaction/NewTransactionTarget.vue [22-25]

 function handleRemoveTarget(index: number) {
+  if (props.targets.length === 1) {
+    alert('取引相手は1人以上必要です');
+    return;
+  }
   emit(
     'input',
     props.targets.filter((_, i) => i !== index)
 
Suggestion importance[1-10]: 9

Why: The suggestion addresses a critical issue where the logic to prevent deleting the last target was removed. Restoring this logic is important to ensure that at least one target remains, preventing potential user errors.

9
Enhancement
空の取引相手を追加する前に既存の空フィールドをチェックする。

handleAddTarget
関数で新しい取引相手を追加する際に、空の文字列を追加していますが、これによりユーザーが意図しない空の入力フィールドが作成される可能性があります。ユーザーが新しい取引相手を明示的に追加するまでフィールドを追加しないように修正することを提案します。

src/components/newTransaction/NewTransactionTarget.vue [20-21]

 function handleAddTarget() {
-  emit('input', [...props.targets, ''])
+  if (!props.targets.includes('')) {
+    emit('input', [...props.targets, ''])
+  }
 
Suggestion importance[1-10]: 8

Why: This suggestion enhances user experience by preventing the addition of unintended empty input fields, which can lead to confusion and clutter in the UI.

8
Best practice
SimpleButton のプロパティの型安全性を向上させる。

SimpleButton コンポーネントの font-sizepadding
プロパティが文字列で設定されていますが、これは型安全ではなく、予期しない動作を引き起こす可能性があります。適切な型のプロパティを使用するか、型チェックを追加することを提案します。

src/pages/NewTransactionPage.vue [83-87]

 <SimpleButton
   :disabled="isSending"
-  font-size="md"
-  padding="md"
+  :font-size="mediumSize"
+  :padding="mediumPadding"
   @click.stop="postTransaction">
 
Suggestion importance[1-10]: 7

Why: Improving type safety for the SimpleButton component properties is a good practice, but it is not critical. It enhances maintainability and reduces the risk of unexpected behavior.

7
Accessibility
新規作成フォームのアクセシビリティを向上させるために id 属性を追加する。

新規作成ページのフォームに id
属性を追加することで、フォームのアクセシビリティを向上させることができます。これにより、スクリーンリーダーや自動テストツールがフォームをより簡単に識別できるようになります。

src/pages/NewTransactionPage.vue [48]

-<form class="flex flex-col gap-6">
+<form id="new-transaction-form" class="flex flex-col gap-6">
 
Suggestion importance[1-10]: 6

Why: Adding an id attribute to the form improves accessibility, making it easier for screen readers and automated testing tools to identify the form. This is a beneficial enhancement but not crucial.

6

@anko9801 anko9801 requested a review from mehm8128 July 15, 2024 01:50
Comment on lines +43 to 46
<button class="flex items-center p-2 border rounded" @click="handleAddTarget">
<PlusIcon class="w-5 mr-2" />
取引相手を追加
</button>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

できればSimpleButton使ってほしいです

src/pages/NewTransactionPage.vue Outdated Show resolved Hide resolved
@anko9801 anko9801 requested a review from mehm8128 July 22, 2024 03:08
Copy link
Contributor

@mehm8128 mehm8128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI通ったらOKです
ボタンのやつだけissueかPR立てておいてほしいです🙏

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minとかも明示してたのでどっちでもいいのですが、一応Vueの場合はpropsで明示していないものでも<input-number id="aaa" />ってしたらInputNumberの一番上の要素(今回はinput要素)に勝手に受け継いでくれる気がします

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

僕の環境だと受け継がなくて入れた覚えがあります

@anko9801 anko9801 merged commit 1ea13db into main Jul 22, 2024
6 checks passed
@anko9801 anko9801 deleted the feat/new_transaction branch July 22, 2024 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

入出金作成ページ
2 participants