feat: add rate-now rating and toast content#2328
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the user experience by refining the rating and toast notification components. It introduces more dynamic content for rating prompts, improves the visual presentation of empty states in the 'Where to Watch' section, and adds flexibility to the RateNow component to ensure consistent layout behavior across different parts of the application. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
|
Overall Grade |
Security Reliability Complexity Hygiene Coverage |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| JavaScript | May 14, 2026 9:39a.m. | Review ↗ | |
| Code coverage | May 14, 2026 9:39a.m. | Review ↗ |
Code Coverage Summary
| Language | Line Coverage (Overall) |
|---|---|
| Aggregate | 71.5% |
| Javascript | 71.5% |
➟ Additional coverage metrics may have been reported. See full coverage report ↗
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
There was a problem hiding this comment.
Code Review
This pull request updates a subproject commit, modifies i18n metadata, and introduces a new WhereToWatchEmptyItem component for empty states in the Where to Watch section. It also enhances the Rate Now toast with randomized prompts and layout updates. Key feedback includes addressing SSR safety issues when accessing localStorage, moving hardcoded strings to the i18n system, and cleaning up the styles by removing redundant SCSS declarations, dead CSS, and duplicated global rules.
| function getNextPrompt(): string { | ||
| const stored = localStorage.getItem(PROMPT_INDEX_KEY); | ||
| const current = stored !== null ? parseInt(stored, 10) : -1; | ||
| const next = (current + 1) % RATING_PROMPTS.length; | ||
| localStorage.setItem(PROMPT_INDEX_KEY, String(next)); | ||
| return RATING_PROMPTS[next]; | ||
| } |
There was a problem hiding this comment.
Accessing localStorage directly during component initialization is not SSR-safe and will cause a ReferenceError on the server. Additionally, parseInt can return NaN if the stored value is corrupted, which should be handled.
function getNextPrompt(): string {
if (typeof window === "undefined") {
return RATING_PROMPTS[0];
}
const stored = localStorage.getItem(PROMPT_INDEX_KEY);
const current = stored !== null ? parseInt(stored, 10) : -1;
const next = isNaN(current) ? 0 : (current + 1) % RATING_PROMPTS.length;
localStorage.setItem(PROMPT_INDEX_KEY, String(next));
return RATING_PROMPTS[next];
}
| </div> | ||
| {/if} | ||
|
|
||
| <style lang="scss"> |
There was a problem hiding this comment.
The lang="scss" attribute is unnecessary here as no SCSS-specific features (like variables, mixins, or functions) are being used. Standard CSS nesting is supported natively.
<style>
References
- Only add lang="scss" to <style> tags in Svelte components when SCSS-specific features are used. Plain CSS nesting does not require it.
| :global(.section-list-empty-state) { | ||
| width: auto; | ||
| margin: 0; | ||
| padding-inline: 0; | ||
| align-items: flex-start; | ||
| justify-content: flex-start; | ||
| } | ||
|
|
||
| :global(.section-list-empty-state:not(:has(:global(.trakt-skeleton-list)))) { | ||
| width: auto; | ||
| } |
| <span>No Services</span> | ||
| <span>Available</span> |
| .where-to-watch-item { | ||
| :global(.trakt-link) { | ||
| text-decoration: none; | ||
| color: var(--color-text-secondary); | ||
|
|
||
| &:hover { | ||
| color: var(--color-text-secondary); | ||
| } | ||
| } | ||
| } |
| "What's the verdict?", | ||
| "What did you think?", | ||
| "Well, how was it?", | ||
| "Thoughts?", | ||
| "Out of five stars?", | ||
| "How many stars does it earn?", | ||
| "Rate your experience.", | ||
| "What's the official score?", | ||
| "Give it a grade.", |
Enhances rating component with props and integrates toast notifications.