July 2026 upgrades - #61
Conversation
…mponents for game settings
There was a problem hiding this comment.
Code Review
This pull request replaces the radio button settings UI with custom dropdown selectors, introduces a new 'Image-to-text analysis' setting, and adds support for local models including a procedural 16x16 CGA pixel art generator. Feedback on these changes highlights a mapping bug in getSelectedLabel where the 'mask' style is incorrectly mapped to 'outline', and a fragile base64 string slicing logic in the server. Additionally, it is recommended to replace the non-interactive div elements in the dropdown with semantic <button> elements to improve accessibility, along with corresponding CSS updates.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| 'realistic': 'Realistic', | ||
| 'cartoon': 'Cartoon', | ||
| 'pixellated': 'Pixel Art', | ||
| 'outline': 'Mask', |
There was a problem hiding this comment.
The visual style key mapping in getSelectedLabel is incorrect. The key used in the configuration and HTML template is 'mask', but here it is mapped as 'outline'. This causes the dropdown trigger label to fallback to 'Realistic' when 'Mask' is selected.
| 'outline': 'Mask', | |
| 'mask': 'Mask', |
| return; | ||
| } | ||
|
|
||
| const trimmedData = imageData.startsWith("data:image/") ? imageData.slice(22) : imageData; |
There was a problem hiding this comment.
Slicing exactly 22 characters to strip the data URL prefix is fragile and will fail if the image format is not exactly 3 characters (like png). For example, data:image/jpeg;base64, has 23 characters, which would leave a leading comma and result in invalid base64 decoding. A more robust approach is to split the string by the comma , and take the second part.
| const trimmedData = imageData.startsWith("data:image/") ? imageData.slice(22) : imageData; | |
| const trimmedData = imageData.startsWith("data:image/") ? imageData.split(",")[1] : imageData; |
| <div class="selector-option" (click)="setConfig('imageGenerator', 'imagen')" [class.active]="gameSettings.imageGenerator === 'imagen'"> | ||
| Imagen 4 Fast | ||
| </div> |
There was a problem hiding this comment.
Using non-interactive div elements with (click) handlers for dropdown options makes them inaccessible to keyboard and screen reader users. It is highly recommended to use semantic <button type="button"> elements instead. This ensures they are natively focusable and keyboard-navigable.
Please apply this change to all .selector-option elements in this file.
| <div class="selector-option" (click)="setConfig('imageGenerator', 'imagen')" [class.active]="gameSettings.imageGenerator === 'imagen'"> | |
| Imagen 4 Fast | |
| </div> | |
| <button type="button" class="selector-option" (click)="setConfig('imageGenerator', 'imagen')" [class.active]="gameSettings.imageGenerator === 'imagen'"> | |
| Imagen 4 Fast | |
| </button> |
| .selector-option { | ||
| padding: 8px 14px; | ||
| color: #e2e2e5; | ||
| border-radius: 10px; | ||
| cursor: pointer; | ||
| transition: background 0.15s ease, color 0.15s ease; | ||
| font-size: 13px; | ||
| white-space: nowrap; | ||
| } |
There was a problem hiding this comment.
To support converting the .selector-option elements from div to <button type="button"> for accessibility, we should update the CSS to reset default button styles (like background, border, and text alignment).
| .selector-option { | |
| padding: 8px 14px; | |
| color: #e2e2e5; | |
| border-radius: 10px; | |
| cursor: pointer; | |
| transition: background 0.15s ease, color 0.15s ease; | |
| font-size: 13px; | |
| white-space: nowrap; | |
| } | |
| .selector-option { | |
| display: block; | |
| width: 100%; | |
| background: none; | |
| border: none; | |
| text-align: left; | |
| padding: 8px 14px; | |
| color: #e2e2e5; | |
| border-radius: 10px; | |
| cursor: pointer; | |
| transition: background 0.15s ease, color 0.15s ease; | |
| font-size: 13px; | |
| white-space: nowrap; | |
| } |
No description provided.