diff --git a/.Jules/palette.md b/.Jules/palette.md new file mode 100644 index 0000000..210f904 --- /dev/null +++ b/.Jules/palette.md @@ -0,0 +1,3 @@ +## 2025-05-14 - [Range Input Clear Action] +**Learning:** Native HTML range inputs cannot represent a `null` or "unset" state once a value has been selected. For user-provided ratings where `null` is a valid "not rated" state, providing a separate localized "Clear" button improves UX by allowing users to undo a rating without choosing an arbitrary low/default value. +**Action:** Always provide a clear/reset action next to range inputs if the underlying data model supports an optional or null state. diff --git a/src/components/Library/GameDetailHeader.tsx b/src/components/Library/GameDetailHeader.tsx index aa3d128..0b50af0 100644 --- a/src/components/Library/GameDetailHeader.tsx +++ b/src/components/Library/GameDetailHeader.tsx @@ -365,6 +365,17 @@ export function GameDetailHeader({ game, onGameUpdated, onPlatformChange, onFilt
{t('personalRating')} (0-100): {game.personal_rating !== null && game.personal_rating !== undefined ? `${game.personal_rating}/100` : '-'} + {game.personal_rating !== null && game.personal_rating !== undefined && ( + + )}
0 diff --git a/src/components/Library/GameScreenshotsCarousel.tsx b/src/components/Library/GameScreenshotsCarousel.tsx index 6a4e37c..bfae3b8 100644 --- a/src/components/Library/GameScreenshotsCarousel.tsx +++ b/src/components/Library/GameScreenshotsCarousel.tsx @@ -20,7 +20,6 @@ export function GameScreenshotsCarousel({ gameId }: GameScreenshotsCarouselProps const [igdbScreenshots, setIgdbScreenshots] = useState([]); const [currentIndex, setCurrentIndex] = useState(0); const [loading, setLoading] = useState(true); - const [hasIgdbId, setHasIgdbId] = useState(false); useEffect(() => { const loadScreenshots = async () => { @@ -29,7 +28,6 @@ export function GameScreenshotsCarousel({ gameId }: GameScreenshotsCarouselProps // Load game data to check IGDB ID try { const game = await invoke<{ igdb_id: number | null }>("get_game_by_id", { id: gameId }); - setHasIgdbId(!!game?.igdb_id); // Load IGDB screenshots if available if (game?.igdb_id) { diff --git a/src/i18n/translations.ts b/src/i18n/translations.ts index 1664377..6cce4b0 100644 --- a/src/i18n/translations.ts +++ b/src/i18n/translations.ts @@ -49,6 +49,7 @@ export const translations = { // Game Detail personalRating: 'Personal Rating', + clearRating: 'Clear Rating', notes: 'Notes', saveNotes: 'Save Notes', deleteGame: 'Delete Game', @@ -435,6 +436,7 @@ export const translations = { // Game Detail personalRating: 'Note personnelle', + clearRating: 'Effacer la note', notes: 'Notes', saveNotes: 'Sauvegarder les notes', deleteGame: 'Supprimer le jeu',