Repository navigation
fix(core): treat a falsy widget id as the class default, as views do - #11135
Merged
Merged
Conversation
Like layer props, `View` and `Widget` now keep their default `id` on the props prototype, so `Object.hasOwn(props, 'id')` tells a passed id from the default while `props.id` still reads the resolved id. - `makeViewport` sets `id` explicitly, since spreading props drops it - `View#equals` compares resolved ids, so an implicit and an explicit default id stay equal For #11113 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LGNhMnSJ94uYgx7ihcVwPn
[Medium impact] This PR appears safe to merge. SummaryWidgets now use their class default when constructed with an empty or
No new actionable issues found. Tests were not run during this review. Reviews (2) · Last reviewed commit: "fix(core): treat a falsy widget id as th..." · Reviewed by Greptile |
This was referenced Nov 15, 2026
Takes master's #11114 (squash-merged) for the files this branch stacked on, keeps this PR's own change, and extends it to setProps: since #11114, setProps treats an undefined id as the class default, and it now does so for any falsy id. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LGNhMnSJ94uYgx7ihcVwPn
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
This was referenced Nov 22, 2026
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.
For #11113
Background
View(#1379) andViewport(viewport.ts:281) treat any falsyidas the class default.Widgetusedprops.id ?? this.id(#8072) until #9576's spread, so''andnullare kept and collide inWidgetManager. Views can't keep''instead, or a view and its viewport would get different ids (the #3259 bug). Widgets now follow the view rule.Change List
Widget: falsyiduses the class default, in the constructor andsetProps; reads only an ownidcreatePropsWithDefaultId: document the shared falsy-id ruleyarn lint,tscon core, and the core and widgets headless testsTODO
id: undefinedas the id; possible follow-upGenerated by Claude Code
Note
Low Risk
Low risk change aligning widget ID fallback behavior with views to prevent ID collisions.
Overview
Updates
Widgetto treat falsyidvalues (''andnull) as unspecified, falling back to the widget's default ID. This aligns withViewbehavior and prevents widgets without an explicit ID from colliding and replacing each other inWidgetManager.Additionally, the widget constructor now inspects only own properties for
id, ensuring inherited default IDs copied from existing widget props are not incorrectly treated as user-supplied.Reviewed by Cursor Bugbot for commit ade130c. Bugbot is set up for automated code reviews on this repo. Configure here.
Generated by Claude Code