-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new arg to filter by subclass ref #2105
base: main
Are you sure you want to change the base?
Conversation
ab3f885
to
c8b1f13
Compare
… the type. Query system doesn't behave well with two types
c8b1f13
to
9f0fe1c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all good, but I think it would be fine to make an exception and not check isInsideAncestorChain
when the type
we're comparing to is the base carddef. isInsideAncestorChain
will end up loading all the cards in the ancestor chain when we already know that all card subtypes descend from card def. In that case, you can just confirm via isCardDef
for the subtype if we're not sure if the type is a card.
@@ -143,6 +147,7 @@ export class LinksToEditor extends GlimmerComponent<Signature> { | |||
|
|||
private chooseCard = restartableTask(async () => { | |||
let type = identifyCard(this.args.field.card) ?? baseCardRef; | |||
type = await getNarrowestType(this.args.subclassType, type, myLoader()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, you can only call this function if a subclassType arg was provided
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually do you even need to check if the type
is the base CardDef? We know that all cards descend from it, so maybe in that case you can skip loading the whole chain and just use the provided subtype.
Purpose of this PR is to enable spec to choose linkedExamples that link by type
API change