[Fix] Search navigation routing API models to blank page #534
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes a bug where searching for and selecting API models (like OCR) from the search results leads to a blank page #517 . This PR also fixes the same issue in other navigation paths that use
ModelDetails.Root Cause:
The navigation logic had hardcoded assumptions that all models should go to the "Models" page, without checking if they are API models (WCRAPIs) that should go to the "APIs" page instead.
Solution:
1. Search Result Handler Upgrade (Core Fix)
Changed from hardcoded routing:
To intelligent routing:
2. ID-to-Type Resolution
ModelDetails.Id→ModelTypeby searching across all registered samples, model families, model groups, and API definitionsNavigateToApiOrModelPage()logic that correctly classifies WCR APIs vs. regular models3. Navigation Performance Optimization
Added
SetSelectedModelInMenu()to ModelSelectionPage to avoid unnecessary page reloads:Testing
Core Navigation Tests
API Navigation Tests
Recently Used (MRU) Tests
Navigation Menu Tests
End-to-End Flow