Skip to content

Feat: Randomize reminder messages - #21

Merged
Kyo-s-s merged 2 commits into
mainfrom
random-reminder
Mar 11, 2026
Merged

Kyo-s-s merged 2 commits into
mainfrom
random-reminder

Conversation

@Kyo-s-s

@Kyo-s-s Kyo-s-s commented Mar 11, 2026

Copy link
Copy Markdown
Owner

Resolve #8

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds randomized reminder text to the timer UI to address Issue #8 (“この時間はもう戻りません” を複数パターンでランダム表示).

Changes:

  • Introduce a new reminder-message catalog + random picker utility.
  • Update NumaTimer to display a randomly selected reminder message instead of a fixed string.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
lib/messages.ts Adds reminder message variants and a function to pick one at random.
components/NumaTimer.tsx Uses the new picker and renders the selected reminder message in the UI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread components/NumaTimer.tsx Outdated
Comment on lines 59 to 60
const reminderMessage = useMemo(() => pickReminderMessage(), [])

Copilot AI Mar 11, 2026

Copy link

Choose a reason for hiding this comment

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

reminderMessage is intended to be stable for the lifetime of the component, but useMemo is not a semantic guarantee (React may discard memoized values). Prefer useState with an initializer or useRef to compute the random message once per mount and keep it stable across renders.

Copilot uses AI. Check for mistakes.
@Kyo-s-s
Kyo-s-s merged commit 50a63dc into main Mar 11, 2026
3 checks passed
@Kyo-s-s
Kyo-s-s deleted the random-reminder branch March 11, 2026 15:58
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.

Feature: "この時間はもう戻りません" を何パターンか用意しておいて、ランダムで表示するように

2 participants