Skip to content

Fix stale streak values in the word selection UI #75

Description

@getOffIt

Summary

The word selection screen caches hook results based only on status transitions, so streak counters can go stale while a word remains in-progress.

Problem

BaseWordSelection rebuilds its cached status map only when the comma-joined status string changes. The rendered UI also reads streak from that cached hook result. If a word goes from 1/10 to 2/10 without changing status, the streak indicator can remain stale.

Impact

The UI can show the wrong current streak and mislead the user about actual progress.

Relevant code

  • src/components/BaseWordSelection.tsx:48-61
  • src/components/BaseWordSelection.tsx:241-258

Expected behavior

Streak indicators should update whenever the underlying streak changes.

Suggested direction

  • Remove the manual cache, or key it on the fields that are actually rendered.
  • Prefer deriving the rendered state directly from current hook results.
  • Add a component test covering in-progress streak increments without a status change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions