Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Resolve the critical initialization error and the moderate navigation-path issue.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Fixes sample initialization when window.load has already fired and updates hierarchical-grid state-persistence navigation.
Changes:
- Adds load-aware state restoration and column readiness handling.
- Makes remote paging initialization load-safe.
- Updates back-navigation paths.
File summaries
| File | Summary and findings |
|---|---|
samples/grids/hierarchical-grid/state-persistence-main/src/index.ts |
Adds column readiness and load handling. Critical (2 votes): strict-mode fields lack initialization or definite-assignment assertions, causing TS2564 at lines 23 and 44. |
samples/grids/hierarchical-grid/state-persistence-about/src/index.ts |
Updates navigation. Moderate (2 votes): companion links still use an incorrect nested path; they should use ./state-persistence-about. |
samples/grids/hierarchical-grid/remote-paging-sample/src/index.ts |
Handles initial data loading when the page is already complete. |
Review details
Suppressed comments (1)
samples/grids/hierarchical-grid/state-persistence-main/src/index.ts:44
Promise'sresolvecallback accepts a value argument, so assigning it directly to the zero-argumentresolveColumnsLoadedfunction is not type-compatible under this sample's strict TypeScript settings. Store a zero-argument wrapper aroundresolve(and explicitly usePromise<void>) so the sample passes type checking.
this.columnsLoaded = new Promise((resolve) => this.resolveColumnsLoaded = resolve);
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| private grid: IgcHierarchicalGridComponent; | ||
| private gridState: IgcGridStateComponent; | ||
| private columnsLoaded: Promise<void>; | ||
| private resolveColumnsLoaded: () => void; |
|
|
||
| this._bind = () => { | ||
| backBtn.addEventListener("click", () => { window.location.replace("./grids/hierarchical-grid/state-persistence-main");}); | ||
| backBtn.addEventListener("click", () => { window.location.replace("./state-persistence-main");}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.