-
Notifications
You must be signed in to change notification settings - Fork 10
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
Improve way to verify is a skill card in spec #2239
Conversation
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 seems like it would not cover a skill that is a subclass of another skill.
selectedDeclaration.cardType.type && | ||
isResolvedCodeRef(selectedDeclaration.cardType.type.codeRef) && | ||
selectedDeclaration.cardType.type.codeRef.name === 'SkillCard' && | ||
selectedDeclaration.cardType.type.codeRef.module === |
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.
The original code was clearer that it didn't do much.
A possible way to fix this is to introduce specType
data in card-type resource. Another way is to just recurse the chain on read and make a stopping condition based on the type data that is already
I'd recommend the 2nd way unless that is visibly inefficient
The test should have a 1-level super and a 2-level super
Thanks @lukemelia @tintinthong for the feedback. I switch the approach by finding the chain in |
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.
Is this typeCache guaranteed to be populated when this check is performed?
To be assured, I introduce a function to find the class matches the desired codeRef at the first level or recursively. |
Refer to https://linear.app/cardstack/issue/CS-8056/cover-boxel-spec-for-skill
This PR is to improve the identification of skill cards in the spec preview component
We would determine the skill card when: