feat: add option to disable favorite iModels fetching - #189
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds functionality to disable the fetching of favorite iModels, allowing users to opt out of the favorites feature when it's not needed or when they lack access to the favorites endpoint.
Key Changes:
- Added a
disabledprop to prevent fetching favorites when the feature is not used - Propagated the
disableFavoritesoption fromIModelGridthroughIModelFavoritesProvidertouseIModelFavorites
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| IModelFavoritesContext.tsx | Added disabled prop to the provider and passed it to the hook |
| useIModelFavorites.ts | Added disabled parameter to skip favorites API calls and updated dependency array |
| IModelGrid.tsx | Added disableFavorites prop and passed it to the favorites provider |
| leobelanger-disable-favorites_2025-11-18-21-33.json | Added changelog entry for the new feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Question: This feature only works when we select requestType to be "All" OR "". My question, aren't favorite iModels automatically fetched when we set requestType to ""? I know we aren't explicitly calling the favorite iModels api but shouldn't that be the default behavior without adding this disableFavorites option? @aruniverse Am I missing something? |
@DanishMehmood-bit Good point, wdyt about merging the options to hide the favourite icon with this new one? Hiding the favourite icon disables the actions so we should not fetch the favourites either. |
@DanishMehmood-bit Favorite iModels are always fetched no matter the request type right now. I'm guessing this is done so we know which iModels are favourite so we can do the correct action (add vs remove). But as you've said in your other comment, we could just merge this option with the hide favourite icon option as a way to disable favourites. Favourites could still be fetched via the request type "favourite" though. But this is fine since the user has to be explicit about that. |
|
Who is this feature for? |
@aruniverse This is for work I'm doing. Basically we're using a custom share contract that do not have access to the favorites endpoint (because there is no need to) and we're already disabling the favorite actions with |
I would prefer this then |
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@aruniverse Done! |


Given that we can hide the favorite icon and the favorite column, we introduce a new option so that we can disable fetching favorite iModels when the user does not care about the feature.
This prevents doing unnecessary calls to the favorites endpoint. This can also prevent unwanted errors when the user does not have access to the favorites endpoint (i.e.: custom shared contract)
Demo
Screen.Recording.2025-11-19.at.08.25.26.mov