fix(Node): wait for capabilities before tabs#3314
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue where node tabs were rendering before capabilities were fully loaded, causing tabs to incorrectly appear or disappear. The fix ensures that tab filtering only occurs after both node data and capabilities have loaded, preventing premature tab visibility changes.
Changes:
- Renamed
threadsQuantitytohasThreadsfor clearer boolean semantics - Added conditional logic to defer tab filtering until
pageLoadingis false - Added
pageLoadingcheck before renderingNodePageContentto prevent tabs from displaying during loading - Added
pageLoadingas a dependency to theuseMemohook that computes tabs
src/containers/Node/Node.tsx
Outdated
| const actualNodeTabs = NODE_TABS.filter((el) => !skippedTabs.includes(el.id)); | ||
| let actualNodeTabs = NODE_TABS; | ||
|
|
||
| // Do not reset tab when capabilities is not fully loaded |
There was a problem hiding this comment.
The comment "Do not reset tab when capabilities is not fully loaded" is unclear or potentially misleading. The code filters tabs only when NOT loading (pageLoading is false), which means it shows ALL tabs during loading and filters them after loading completes. Consider revising the comment to be more explicit, such as "Show all tabs during loading, filter based on capabilities after loading completes" to better match the actual behavior.
| // Do not reset tab when capabilities is not fully loaded | |
| // Show all tabs while loading; filter tabs by capabilities after loading completes |
Greptile's behavior is changing!From now on, if a review finishes with no comments, we will not post an additional "statistics" comment to confirm that our review found nothing to comment on. However, you can confirm that we reviewed your changes in the status check section. This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR". |
Closes #3305
Currently nodes tabs render before capabilities loaded, some tabs may appear, some other tabs may be hidden. Wait for capabilities and node data before showing content to ensure correct tabs list
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
😟 No changes in tests. 😕
Bundle Size: ✅
Current: 62.67 MB | Main: 62.67 MB
Diff: +0.28 KB (0.00%)
✅ Bundle size unchanged.
ℹ️ CI Information