-
Notifications
You must be signed in to change notification settings - Fork 0
svg feedback fix seed increment behavior #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Created a new React app for the prompt guessing game that will: - Generate creative prompts using text.pollinations.ai - Create images from prompts using image.pollinations.ai - Let users guess the prompts and provide feedback Next steps: 1. Integrate with text.pollinations.ai for prompt generation 2. Integrate with image.pollinations.ai for image generation 3. Implement prompt similarity checking for guess evaluation Closes # 140 Mentat precommits passed. Log: https://mentat.ai/log/da1bbadf-deed-4d43-b60e-4fdf03101e21
- Added utility functions for: - Generating creative prompts using text.pollinations.ai - Creating images from prompts using image.pollinations.ai - Evaluating guess similarity - Enhanced UI with loading and error states - Added disabled states for inputs during loading - Improved feedback system for user guesses - Added loading animation and error styling Closes # 140 Mentat precommits passed. Log: https://mentat.ai/log/81a96ae5-98dc-4628-985c-a96846c045de
- Added clear instructions for players - Implemented hint system after 5 attempts - Show actual prompt after successful guess - Added game won state to prevent further guesses - Improved UI feedback and styling - Added loading and disabled states for better UX Closes # 140 Mentat precommits passed. Log: https://mentat.ai/log/10c53bb0-aa10-4fdf-9153-ba6aff1b73bc
- Added proper Vite configuration - Fixed directory structure to match Vite requirements - Added missing index.css file - Updated build settings - Successfully building to dist directory The build is now working correctly and generating the necessary files. Mentat precommits passed. Log: https://mentat.ai/log/549d3bf4-9953-43bc-8d8a-e879e2a81697
|
Automatic code review is enabled for this repository. Reviewing this PR now. |
|
TestGru: The source file has been modified. Please add a comment |
|
🚀 PR Preview deployed! Preview URL: https://pollinations.github.io/hive/pr-151/ |
1 similar comment
|
🚀 PR Preview deployed! Preview URL: https://pollinations.github.io/hive/pr-151/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reviewed the changes to the seed handling behavior in the SVG feedback tool. Here are my observations and suggestions:
The changes look generally good and help fix the seed increment behavior. A few specific points:
-
The change to use
currentSeeddirectly instead of checkingparseInt(elements.seed.value)in the generate function makes sense - it ensures consistent seed progression during animation. -
Moving the seed initialization to the start function is a good improvement:
if (parseInt(elements.seed.value) >= 0) {
initialSeed = parseInt(elements.seed.value);
}This ensures the seed is only set once at the start of animation rather than potentially changing during generation.
- Using
initialSeedinstead ofcurrentSeedwhen saving presets is correct since we want to save the starting seed value that can reproduce the animation.
One minor suggestion - it might be worth adding a comment explaining the difference between initialSeed and currentSeed for future maintainers, since their roles are quite important for the animation behavior.
Overall these changes make the seed handling more robust and predictable. The changes look good to merge.
Thanks for using MentatBot. Give comments a 👍 or 👎 to help me improve!
You can change my review settings on my settings page.
|
🚀 PR Preview deployed! Preview URL: https://pollinations.github.io/hive/pr-151/ |
Testing .mentatTesting ai-chatTesting static HTML app: ai-chat Testing graphics-editorTesting static HTML app: graphics-editor Testing llm-feedbackTesting static HTML app: llm-feedback Testing millionaire-gameTesting static HTML app: millionaire-game Testing placeholder-generatorTesting Node.js app: placeholder-generator Installing dependenciesℹ️ No tests found BuildingTesting pollinations-image-showTesting Node.js app: pollinations-image-show Installing dependenciesℹ️ No tests found BuildingTesting prompt-guessing-gameTesting Node.js app: prompt-guessing-game Installing dependenciesℹ️ No tests found BuildingTesting svg-feedbackTesting static HTML app: svg-feedback ❌ HTML tests failed for svg-feedback Testing tarot-readerTesting Node.js app: tarot-reader Installing dependenciesℹ️ No tests found Building |
|
🚀 PR Preview deployed! Preview URL: https://pollinations.github.io/hive/pr-151/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to the seed increment behavior look well-structured. I've suggested some improvements around documentation and input validation that would make the code more maintainable and robust. The changes can be merged after addressing these minor improvements.
svg-feedback/index.html
Outdated
| const seed = parseInt(elements.seed.value) >= 0 ? | ||
| parseInt(elements.seed.value) : | ||
| currentSeed++; // Use and increment the current seed | ||
| const seed = currentSeed; // Use and increment the current seed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The seed increment is now handled outside this function, but there's no comment indicating where the increment happens. Consider adding a comment here to point to where currentSeed gets incremented (line 364) for better code maintainability.
| elements.start.disabled = true; | ||
| elements.stop.disabled = false; | ||
|
|
||
| if (parseInt(elements.seed.value) >= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The seed initialization should validate that the parsed value is a finite number to prevent potential issues with NaN or Infinity. Consider adding validation using !isNaN() and isFinite(). Here's how:
if (!isNaN(parseInt(elements.seed.value)) && isFinite(parseInt(elements.seed.value)) && parseInt(elements.seed.value) >= 0) {
initialSeed = parseInt(elements.seed.value);
}| prompt: elements.basePrompt.value, | ||
| temperature: elements.temperature.value, | ||
| initialSvg: elements.initialSvg.value, | ||
| model: elements.modelSelect.value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good change to store initialSeed instead of currentSeed in presets, as it represents the starting point of the evolution sequence. However, consider adding a comment explaining why we store initialSeed rather than currentSeed to make the intent clear for future maintainers.
Testing .mentatTesting ai-chatTesting static HTML app: ai-chat Testing graphics-editorTesting static HTML app: graphics-editor Testing llm-feedbackTesting static HTML app: llm-feedback Testing millionaire-gameTesting static HTML app: millionaire-game Testing placeholder-generatorTesting Node.js app: placeholder-generator Installing dependenciesℹ️ No tests found BuildingTesting pollinations-image-showTesting Node.js app: pollinations-image-show Installing dependenciesℹ️ No tests found BuildingTesting prompt-guessing-gameTesting Node.js app: prompt-guessing-game Installing dependenciesℹ️ No tests found BuildingTesting svg-feedbackTesting static HTML app: svg-feedback ❌ HTML tests failed for svg-feedback Testing tarot-readerTesting Node.js app: tarot-reader Installing dependenciesℹ️ No tests found Building |
- Modify systemPrompt to set SVG dimensions to 100% - Ensure SVG adapts to container size for better responsiveness
|
TestGru: The source file has been modified. Please add a comment |
|
🚀 PR Preview deployed! Preview URL: https://pollinations.github.io/hive/pr-151/ |
Testing .mentatTesting ai-chatTesting static HTML app: ai-chat Testing graphics-editorTesting static HTML app: graphics-editor Testing llm-feedbackTesting static HTML app: llm-feedback Testing millionaire-gameTesting static HTML app: millionaire-game Testing placeholder-generatorTesting Node.js app: placeholder-generator Installing dependenciesℹ️ No tests found BuildingTesting pollinations-image-showTesting Node.js app: pollinations-image-show Installing dependenciesℹ️ No tests found BuildingTesting prompt-guessing-gameTesting Node.js app: prompt-guessing-game Installing dependenciesℹ️ No tests found BuildingTesting svg-feedbackTesting static HTML app: svg-feedback ❌ HTML tests failed for svg-feedback Testing tarot-readerTesting Node.js app: tarot-reader Installing dependenciesℹ️ No tests found Building |
|
🚀 PR Preview deployed! Preview URL: https://pollinations.github.io/hive/pr-151/ |
|
TestGru: The source file has been modified. Please add a comment |
|
🚀 PR Preview deployed! Preview URL: https://pollinations.github.io/hive/pr-151/ |
1 similar comment
|
🚀 PR Preview deployed! Preview URL: https://pollinations.github.io/hive/pr-151/ |
Testing .mentatTesting ai-chatTesting static HTML app: ai-chat Testing graphics-editorTesting static HTML app: graphics-editor Testing llm-feedbackTesting static HTML app: llm-feedback Testing millionaire-gameTesting static HTML app: millionaire-game Testing placeholder-generatorTesting Node.js app: placeholder-generator Installing dependenciesℹ️ No tests found BuildingTesting pollinations-image-showTesting Node.js app: pollinations-image-show Installing dependenciesℹ️ No tests found BuildingTesting prompt-guessing-gameTesting Node.js app: prompt-guessing-game Installing dependenciesℹ️ No tests found BuildingTesting svg-feedbackTesting static HTML app: svg-feedback ❌ HTML tests failed for svg-feedback Testing tarot-readerTesting Node.js app: tarot-reader Installing dependenciesℹ️ No tests found Building |
No description provided.