Skip to content

Hotfix/page crash null seed#18

Merged
miaklwalker merged 10 commits into
masterfrom
hotfix/pageCrashNullSeed
Feb 8, 2026
Merged

Hotfix/page crash null seed#18
miaklwalker merged 10 commits into
masterfrom
hotfix/pageCrashNullSeed

Conversation

@OptimusPi
Copy link
Copy Markdown
Collaborator

This pull request introduces several improvements and refactors to the seed analysis flow, input handling, and state management, focusing on better input sanitization, improved loading state tracking, and enhanced usability for seed and deck selection. The most important changes are grouped below:

Seed Input Handling & Sanitization

  • Refactored SeedInputAutoComplete to a reusable component with debounced input and deck selection, improving seed input UX and ensuring seed values are sanitized before analysis. (src/components/SeedInputAutoComplete.tsx, [1] [2]
  • Centralized seed sanitization logic by using the new sanitizeSeed utility in both UI and analysis functions, preventing invalid seed formats from propagating. (src/modules/ImmolateWrapper/index.ts, [1] [2]; src/modules/state/store.ts, [3]

State Management & Loading Feedback

  • Added a loading state to SeedResultsContainer and integrated loading context (SeedResultLoadingContext) to track and expose analysis progress, allowing UI components to react to analysis status. (src/modules/ImmolateWrapper/CardEngines/Cards.ts, [1]; src/modules/state/analysisResultProvider.tsx, [2] [3]
  • Refactored SeedResultProvider to use useTransition and useEffect for asynchronous analysis, updating loading state and error handling for more robust seed analysis. (src/modules/state/analysisResultProvider.tsx, src/modules/state/analysisResultProvider.tsxR19-R53)

UI Improvements

  • Improved deck and ante selection in navigation and seed input components by adding debounced updates and local state, reducing unnecessary state updates and improving responsiveness. (src/components/blueprint/layout/navbar.tsx, [1] [2]
  • Updated seed analysis trigger logic and simplified ante visibility handling in blueprint views, removing unnecessary debounce logic and clarifying ante selection flow. (src/components/blueprint/simpleView/simple.tsx, [1] [2]

Download Functionality

  • Refactored download provider to use context directly and return null outside provider, improving error handling and integration with the new seed result loading state. (src/modules/state/downloadProvider.tsx, [1] [2]

Miscellaneous

  • Minor improvements to global image cache usage and React import consistency across components. (src/components/Rendering/canvasRenderer.tsx, [1] [2] [3] [4]; src/components/blueprint/layout/navbar.tsx, [5] [6]
  • Fixed window debug assignment to only occur when download function is available. (src/components/blueprint/standardView/index.tsx, src/components/blueprint/standardView/index.tsxL552-R552)

These changes collectively improve seed analysis reliability, user experience, and code maintainability.

Closes #17

Use a local state for the Max Ante input and debounce updates to the global state. Added useState/useEffect and useDebouncedCallback imports, introduced localAntes synced from antes, and a debouncedSetAntes(200ms) to avoid rapid updates. Updated NumberInput to bind to localAntes, parse string values defensively, and call the debounced setter instead of immediately mutating the global state. Cleans up previous immediate NaN/null handling and reduces unnecessary re-renders/updates.
@OptimusPi OptimusPi marked this pull request as ready for review February 7, 2026 22:03
@OptimusPi
Copy link
Copy Markdown
Collaborator Author

image prod rn


export default function Footer() {
const {data: supporters, isPending} = useQuery<Array<{ name: string, subscription: boolean }>>({
const {data: supporters, isPending: isPending} = useQuery<Array<{ name: string, subscription: boolean }>>({
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

my IDE said isPending was not defined, but, it was here but there's something weird with destructuring this

@miaklwalker miaklwalker merged commit 84b4fc3 into master Feb 8, 2026
1 check failed
@OptimusPi OptimusPi deleted the hotfix/pageCrashNullSeed branch February 8, 2026 06:53
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.

Page crash from null seed

2 participants