-
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
Fix pre-rendered spec card icon #2254
Conversation
packages/base/spec.gts
Outdated
|
||
export type SpecType = 'card' | 'field' | 'app' | 'skill'; | ||
|
||
class SpecTypeField extends StringField { | ||
static displayName = 'Spec Type'; | ||
} | ||
|
||
class Isolated extends Component<typeof Spec> { | ||
@tracked icon: CardOrFieldTypeIcon | undefined; |
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.
I had to move out the Isolated
, Fitted
, and Edit
views to satisfy the type check since I use @tracked
.
Host Test Results 1 files ± 0 1 suites ±0 26m 14s ⏱️ + 1m 5s Results for commit 13f6838. ± Comparison against base commit 40ad332. This pull request removes 803 and adds 827 tests. Note that renamed tests count towards both.
This pull request removes 2 skipped tests and adds 3 skipped tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
packages/base/spec.gts
Outdated
this.loadCardIcon.perform(); | ||
} | ||
|
||
private loadCardIcon = restartableTask(async () => { |
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.
Since this is only ever called once in the constructor, there is no reason for it to be a restartableTask. It should just be a task.
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.
On that topic, perhaps this task should be executed again if the ref
changes?
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.
I used resource instead, so it will be reload if the value of ref is updated.
packages/base/spec.gts
Outdated
this.loadCardIcon.perform(); | ||
} | ||
|
||
private loadCardIcon = restartableTask(async () => { |
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.
Same note
packages/base/spec.gts
Outdated
this.loadCardIcon.perform(); | ||
} | ||
|
||
private loadCardIcon = restartableTask(async () => { |
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.
Same note
da8eb7e
to
bde2119
Compare
This is the minimal solution to fix the bug where the pre-rendered spec card displays a loading state as its icon. In this PR, we use the spec card's own card type icon as the icon for the pre-rendered spec card.
Screen.Recording.2025-03-10.at.12.11.25.mov