Skip to content

Conversation

@paul-fresquet
Copy link
Contributor

@paul-fresquet paul-fresquet commented Jan 4, 2026

Summary

  • Move rating prompt labels into configuration with per-locale text and clean fallbacks
  • Load rating prompt configuration from embedded settings with validation/normalization
  • Keep existing rating prompt behavior (Store + always-include + random additional)

Changes

  • Add config model + provider for rating prompts (probability, counts, channels, per-locale labels)
  • Update rating prompt service to resolve labels via culture fallback and domain fallback
  • Expand tests to cover config parsing, label resolution, and selection behavior
  • Remove obsolete rating-channel entries from resx/designer
  • Update rating prompt schema in local settings template

Implementation

  • Parse RatingPrompt section into typed configuration with graceful defaults
  • Resolve labels by exact culture, neutral culture, then �n, then URL domain
  • Keep deterministic selection with injected random provider for tests

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the rating prompt system to move channel labels from hardcoded resource files into a flexible configuration system. The changes introduce a configuration provider that loads rating prompt settings from JSON, supporting per-locale labels with culture fallback logic (exact culture → neutral culture → English → domain name). The PR maintains existing behavior where Store channels are shown for MSIX installations, while non-MSIX installations show AlwaysInclude channels plus randomized Additional channels.

Key changes:

  • Introduced RatingPromptConfiguration and RatingPromptConfigurationProvider to parse and validate rating prompt settings from configuration
  • Updated RatingPromptService to use configuration-driven labels with culture fallback chain
  • Added comprehensive test coverage for configuration parsing and label resolution
  • Removed obsolete rating channel entries from resource files

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/ByteSync.Client/Services/Ratings/RatingPromptService.cs Refactored to use configuration provider for channels, added label resolution with culture fallback and domain extraction logic
src/ByteSync.Client/Services/Ratings/RatingPromptConfigurationProvider.cs New provider that parses RatingPrompt configuration section with validation and graceful fallbacks
src/ByteSync.Client/Interfaces/Services/Ratings/RatingPromptConfiguration.cs New record types for rating prompt configuration model
src/ByteSync.Client/Interfaces/Services/Ratings/IRatingPromptConfigurationProvider.cs New interface for configuration provider
src/ByteSync.Client/local.settings.template.json Added RatingPrompt configuration schema with example structure
tests/ByteSync.Client.UnitTests/Services/Ratings/RatingPromptServiceTests.cs Updated tests with configuration stub, added test for culture-based label resolution
tests/ByteSync.Client.UnitTests/Services/Ratings/RatingPromptConfigurationProviderTests.cs New test suite for configuration parsing and validation logic
src/ByteSync.Client/Assets/Resources/Resources.resx Removed channel-specific resource entries
src/ByteSync.Client/Assets/Resources/Resources.fr.resx Removed channel-specific French resource entries
src/ByteSync.Client/Assets/Resources/Resources.Designer.cs Removed generated code for deleted resource entries
Files not reviewed (1)
  • src/ByteSync.Client/Assets/Resources/Resources.Designer.cs: Language not supported

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

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 5, 2026

@paul-fresquet paul-fresquet merged commit 0d9ff01 into master Jan 5, 2026
42 of 44 checks passed
@paul-fresquet paul-fresquet deleted the feat/improve-rating-service branch January 5, 2026 07:19
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