Complete remaining button and rail config knobs - #29
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ed9738a69
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (config.badges && config.badges.length) { | ||
| config.badges.forEach(function (entry) { |
There was a problem hiding this comment.
Guard
badges against scalar strings before iterating
SF.rail.createCard() now assumes any truthy config.badges.length also supports forEach(). That breaks a single-string badge (badges: 'TEMPRA'): strings have a length, so this branch runs, but forEach is undefined and the card throws before rendering. Because type is already a scalar string and the new API docs describe badges as strings or styled objects, this is an easy input shape for callers to hit.
Useful? React with 👍 / 👎.
3ed9738 to
6ea5f7b
Compare
Closes #10.
Summary
iconOnlybuttons actually icon-only while keeping an accessible labelbadgessupport for rail resource cards instead of silently ignoring it