-
Notifications
You must be signed in to change notification settings - Fork 322
minor tweaks for card #1755
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
minor tweaks for card #1755
Conversation
|
@jjagielka is attempting to deploy a commit to the Themesberg Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughUpdates Card.svelte to add alt="" to images, loading="lazy", and an onerror handler that hides failed images; makes children rendering calls safe with optional chaining. Adjusts card shadow tokens (adds xs, remaps normal). Removes the required Changes
Sequence Diagram(s)sequenceDiagram
actor Consumer
participant Card as Card.svelte
participant DOM as Browser DOM
Consumer->>Card: Render Card({ img?, children? })
alt img provided
Card->>DOM: create <img src=... alt="" loading="lazy" onerror=hide>
note right of DOM #ffe6cc: onerror -> hide image element
Card-->>Consumer: Render children if present (children?.())
else no img
Card-->>Consumer: Render children if present (children?.())
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Pre-merge checks (1 passed, 1 warning, 1 inconclusive)❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/lib/card/theme.ts (1)
44-46: Optional: align “normal” to Tailwind’s defaultshadowto avoid duplication withsmCurrently both sm and normal resolve to shadow-sm. If “normal” is meant to be the default (non-sm) shadow, consider using
shadowfor normal.Proposed diff:
shadow: { sm: { base: "shadow-sm" }, - normal: { base: "shadow-sm" }, + normal: { base: "shadow" }, md: { base: "shadow-md" },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/lib/card/Card.svelte(1 hunks)src/lib/card/theme.ts(1 hunks)src/lib/types.ts(0 hunks)
💤 Files with no reviewable changes (1)
- src/lib/types.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Playwright and Lint
🔇 Additional comments (3)
src/lib/card/theme.ts (1)
44-44: Shadow(sm) fix looks rightMapping the sm variant to Tailwind’s shadow-sm aligns with the intended scale. No issues spotted.
src/lib/card/Card.svelte (2)
41-44: Children optional chaining — LGTMUsing
children?.()prevents runtime errors and matches the updated CardProps.Please ensure the docs/examples reflect that
childrenis optional.
29-41: ExposeimgAltprop for image alt text and simplify error handling
AddimgAlt?: stringtoCardPropsand destructure it; update<img>toalt={imgAlt ?? ""}and includedecoding="async". Replace the inlineonerrorblock withonerror={(e) => e.currentTarget.hidden = true}. Confirm whether card images should be decorative by default—if not, document usingimgAlt.
…e CardProps typing
|
@jjagielka Is this PR still valid? Please let me know. |
|
Yes. It introduces some error management for the image loading. |
📑 Description
Tweaks:
smStatus
✅ Checks
api-checkdirectory as requiredpnpm check && pnpm test:e2eℹ Additional Information
Summary by CodeRabbit