Skip to content

「Aさんの未チェックの日報はこれで最後です。」が最後の日報じゃなくても表示されるバグを修正#9668

Merged
machida merged 3 commits intomainfrom
bug/message_for_last_unchecked_daily_report_also_appeared_for_other_reports
Feb 27, 2026
Merged

「Aさんの未チェックの日報はこれで最後です。」が最後の日報じゃなくても表示されるバグを修正#9668
machida merged 3 commits intomainfrom
bug/message_for_last_unchecked_daily_report_also_appeared_for_other_reports

Conversation

@s-tone-gs
Copy link
Contributor

@s-tone-gs s-tone-gs commented Feb 18, 2026

Issue

概要

「Aさんの未チェックの日報はこれで最後です。」というメッセージを、他の日報で出現しても違和感のないものに変更しました。

変更確認方法

  1. bug/message_for_last_unchecked_daily_report_also_appeared_for_other_reportsをローカルに取り込む
  2. サーバーを起動する
  3. メンターでログインする
    ログイン名: mentormentaro
    PW: testtest
  4. http://localhost:3000/reports にアクセスする
  5. 日報を開く(どのユーザーのものでもOK)
  6. 「日報を確認」と書かれたボタンを押す
  7. 手順4, 5を繰り返し、未確認の日報が一つになるようにする
  8. 「xxさんの未チェックの日報は残り1つです。」というメッセージが表示されていることを確認する。

Screenshot

変更前

image

変更後

image

Summary by CodeRabbit

  • 改善
    • 未確認レポートが「残り1つ」の場合の画面表示文言を「残り1つです。」に変更し、より明確な案内表現にしました。
  • テスト
    • 上記表示変更に合わせて該当の自動テストを更新しました。

@s-tone-gs s-tone-gs self-assigned this Feb 18, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

📝 Walkthrough

ウォークスルー

UserDecorator::ReportStatus で定数名を LAST_UNCHECKED_REPORT_COUNT から SINGLE_UNCHECKED_REPORT_COUNT にリネームし、未チェックレポート残数が1件のときの表示文言を「これで最後です。」から「残り1つです。」に変更しました。制御フローや条件分岐のロジックに変更はありません。

変更内容

Cohort / File(s) Summary
デコレーター
app/decorators/user_decorator/report_status.rb
定数 LAST_UNCHECKED_REPORT_COUNTSINGLE_UNCHECKED_REPORT_COUNT にリネーム。未チェック1件時の表示文言を更新("これで最後です。" → "残り1つです。")。
テスト
test/decorators/user_decorator/report_status.rb
未チェック1件時の期待メッセージを新文言に合わせて更新。テストの構造やアサーションの意図は変更なし。

Sequence Diagram(s)

(該当なし)

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 分

Possibly related issues

Possibly related PRs

Suggested reviewers

  • komagata

ポエム

🐇 ぴょんと一言
定数名がすこし変わったよ
文がそっと「残り1つ」に
ふわり心は晴れ模様
今日も小さな修正おめでとう 🐾

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed PRタイトルはバグ修正の主要な内容を明確に説明しており、実装内容と合致しています。
Description check ✅ Passed プルリクエストの説明は、テンプレートのすべての必須セクション(Issue、概要、変更確認方法、Screenshot)を完全に満たしており、詳細で分かりやすい内容になっています。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bug/message_for_last_unchecked_daily_report_also_appeared_for_other_reports

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@s-tone-gs s-tone-gs marked this pull request as ready for review February 18, 2026 09:36
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/decorators/user_decorator/report_status.rb (1)

17-25: ⚠️ Potential issue | 🔴 Critical

テストアサーションが実装と一致していません。更新が必要です。

デコレータの実装(line 21)は "残り1つです。" を返していますが、テストアサーション(line 25)は古い文字列 "これで最後です。" を期待しているため、テストが失敗します。

test/decorators/user_decorator/report_status.rb の line 25 を以下のように修正してください:

修正内容
- assert_equal "#{user.login_name}さんの未チェックの日報はこれで最後です。", unchecked_report_message(1, user)
+ assert_equal "#{user.login_name}さんの未チェックの日報は残り1つです。", unchecked_report_message(1, user)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/decorators/user_decorator/report_status.rb` around lines 17 - 25, Update
the failing test assertion to match the decorator implementation: in the test
for unchecked_report_message (test/decorators/user_decorator/report_status.rb)
replace the old expected string "これで最後です。" with the current implementation's
expected string "#{user.login_name}さんの未チェックの日報は残り1つです。" so the test checks the
exact output produced by unchecked_report_message.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@app/decorators/user_decorator/report_status.rb`:
- Around line 17-25: Update the failing test assertion to match the decorator
implementation: in the test for unchecked_report_message
(test/decorators/user_decorator/report_status.rb) replace the old expected
string "これで最後です。" with the current implementation's expected string
"#{user.login_name}さんの未チェックの日報は残り1つです。" so the test checks the exact output
produced by unchecked_report_message.

@s-tone-gs
Copy link
Contributor Author

s-tone-gs commented Feb 19, 2026

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Feb 19, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link

coderabbitai bot commented Feb 19, 2026

✅ Actions performed

Full review triggered.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
app/decorators/user_decorator/report_status.rb (1)

11-11: 定数名 LAST_UNCHECKED_REPORT_COUNT をより説明的な名前へのリネームを検討してください。

現在の定数名「LAST」はメッセージ「残り1つです」の意味と整合性が低下しています。この定数はあくまで値が1であることを示すため、SINGLE_UNCHECKED_REPORT_COUNT へのリネームにより可読性が向上します。定数は当該ファイル内で使用されているため、リネーム時の影響範囲は限定的です。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/decorators/user_decorator/report_status.rb` at line 11, 定数名
LAST_UNCHECKED_REPORT_COUNT が「残り1つ」を表す意図と乖離しているため、定数を
SINGLE_UNCHECKED_REPORT_COUNT
にリネームしてください(定義箇所と当該ファイル内の全ての参照を置換)。リネーム後にメソッド/クラスが参照している箇所(例:
user_decorator/report_status.rb 内の定数参照)を更新し、既存の振る舞いやテストに影響がないかを確認してください。
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@app/decorators/user_decorator/report_status.rb`:
- Line 11: 定数名 LAST_UNCHECKED_REPORT_COUNT が「残り1つ」を表す意図と乖離しているため、定数を
SINGLE_UNCHECKED_REPORT_COUNT
にリネームしてください(定義箇所と当該ファイル内の全ての参照を置換)。リネーム後にメソッド/クラスが参照している箇所(例:
user_decorator/report_status.rb 内の定数参照)を更新し、既存の振る舞いやテストに影響がないかを確認してください。

@s-tone-gs
Copy link
Contributor Author

@kutimiti1234
お疲れ様です!レビュー依頼させていただきました!
お忙しければ他の方に依頼しますので教えてください!

@kutimiti1234
Copy link
Contributor

@s-tone-gs
はい、対応可能となります。
一旦1週間ほど時間をいただきたいです

Copy link
Contributor

@kutimiti1234 kutimiti1234 left a comment

Choose a reason for hiding this comment

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

動作確認して特に問題ありませんでした。
コードとしても、とくには問題ないかなと思いますのでapproveします。
2点だけ思ったことを書きます。

  1. branch名が長いのと、アンダーバーはあまり標準的じゃない。
    他のブランチを確認いただければと思いますが、少し長く感じました。
    bug/not-suitable-unchecked-reports-messageぐらいのほうがパッと見はわかりやすいのかなと思いました(詳細はコミットやissueを見ればわかると思うので)
    また、git-style-guideとかにも書かれていますが、branch名は「-」区切りのほうが標準的かと思います。bootcampも大体のbranchはハイフン区切りになっていると思います。
    https://github.com/objectx/git-style-guide#%E3%83%96%E3%83%A9%E3%83%B3%E3%83%81

  2. 動作確認の説明について。
    これは必ずしもというわけではないと思いますが、「メンターでログイン」と書くより具体的なメンターのユーザー名を書いてあげた方が確認時に迷わないと思いました

@s-tone-gs
Copy link
Contributor Author

s-tone-gs commented Feb 20, 2026

@kutimiti1234
レビューありがとうございます!同時にフィードバックもいただけてとてもありがたいです🙇‍♂️
PR作成の参考にさせていただきます🫡

  1. 動作確認の説明について

こちらでご指摘を参考に、PRの動作確認の説明を修正しました。ありがとうございます!

@s-tone-gs
Copy link
Contributor Author

@okuramasafumi
お疲れ様です!レビューお願いいたします🙇‍♂️

Copy link
Contributor

@okuramasafumi okuramasafumi left a comment

Choose a reason for hiding this comment

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

LGTM!

@s-tone-gs
Copy link
Contributor Author

@komagata
お疲れ様です。マージをお願いします🙇‍♂️

@machida machida merged commit 0001ea9 into main Feb 27, 2026
10 checks passed
@machida machida deleted the bug/message_for_last_unchecked_daily_report_also_appeared_for_other_reports branch February 27, 2026 08:37
@github-actions github-actions bot mentioned this pull request Feb 27, 2026
17 tasks
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.

4 participants