Skip to content

Explain why the rating filter is disabled#3032

Merged
veloce merged 1 commit into
lichess-org:mainfrom
CloudyDino:rating-filter-provisional-explanation
Apr 25, 2026
Merged

Explain why the rating filter is disabled#3032
veloce merged 1 commit into
lichess-org:mainfrom
CloudyDino:rating-filter-provisional-explanation

Conversation

@CloudyDino

@CloudyDino CloudyDino commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Summary

When a user's rating for the selected perf is provisional, the rating filter in the lobby game creator is disabled. Previously the UI just showed it greyed-out with no explanation — users were left wondering why they couldn't use it (see e.g. #3011 where the reporter asked why the filter is "always blocked out").

Now tapping the disabled rating filter opens an adaptive dialog with the existing localized string ratingRangeIsDisabledBecauseYourRatingIsProvisional:

Rating filters are locked because your rating is not stable. Playing rated games will increase stability.

Changes are in two places, since the filter is rendered twice:

  • Real-time lobby (create_game_widget.dart) — the OutlinedButton gets an onPressed that shows the dialog when unavailable; foregroundColor is set to the theme's disabled color to keep the greyed-out appearance.
  • Inline PlayRatingRange (common_play_widgets.dart) used by the correspondence sheet — the disabled ListTile is wrapped in IgnorePointer + GestureDetector(HitTestBehavior.opaque) so the inner NonLinearSlider widgets don't swallow the tap in the gesture arena.

A SnackBar was tried first but renders behind modal bottom sheets (it anchors to the root ScaffoldMessenger), so a dialog route is used instead.

Test plan

  • flutter analyze clean on both files
  • dart format clean
  • Manual testing
Android.alert.for.rating.filter.mp4

🤖 Generated with Claude Code

The rating filter is disabled whenever the user's rating for the
selected perf is provisional. Previously the UI showed the filter as
greyed-out with no explanation, leaving users confused about why they
couldn't use it.

Tapping the disabled rating filter now opens an adaptive dialog with
the existing localized message
`ratingRangeIsDisabledBecauseYourRatingIsProvisional` explaining the
cause. Applied in both places the filter is rendered:

- The real-time lobby sheet (`create_game_widget.dart`) — the
  `OutlinedButton` now has an `onPressed` that shows the dialog when
  the filter is unavailable, with `foregroundColor` set to the theme's
  disabled color to preserve the greyed-out look.
- The inline `PlayRatingRange` widget (`common_play_widgets.dart`)
  used by the correspondence sheet — the disabled `ListTile` is wrapped
  in `IgnorePointer` + `GestureDetector(HitTestBehavior.opaque)` so the
  inner `NonLinearSlider` widgets cannot swallow the tap in the gesture
  arena.

A `SnackBar` was tried first but is invisible behind modal bottom
sheets (it anchors to the root `ScaffoldMessenger`), so a dialog route
is used instead — it pushes on top of the sheet.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@CloudyDino CloudyDino force-pushed the rating-filter-provisional-explanation branch from 14d5992 to ae2778b Compare April 22, 2026 18:19
@veloce

veloce commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Thanks for this. I've added a small improvement: an info icon next to the "rating filter" label when the button is disabled.

@veloce veloce merged commit 1820c47 into lichess-org:main Apr 25, 2026
1 check passed
@CloudyDino CloudyDino deleted the rating-filter-provisional-explanation branch May 3, 2026 14:20
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