Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .jules/spider.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
## 2024-05-19 - Typechecking JSON-LD Date Properties
**Learning:** When passing potentially null date fields (like `publishedAt`, `updatedAt`) from Payload CMS to jsonLd generator functions, using the fields directly can cause strict TypeScript compilation failures since the schemas explicitly expect `string | undefined` and not `null`.
**Action:** Always use the logical OR operator with `undefined` (e.g., `datePublished: post.publishedAt || undefined`) when passing date properties to JSON-LD generator functions to satisfy strict type requirements and prevent build regressions.

## 2024-06-27 - [Added dialog roles] **Learning:** Modals using Framer Motion (`motion.div`) in this codebase often act as dialogs but miss proper ARIA roles out of the box. **Action:** Always check interactive popups/modals for `role="dialog"`, `aria-modal="true"`, and `aria-labelledby` attributes to ensure they are accessible and their semantic structure is understood by crawlers.
6 changes: 5 additions & 1 deletion src/components/AnnouncementPopup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,16 @@ export const AnnouncementPopup: React.FC<AnnouncementPopupProps> = ({ announceme
/>

{/* Modal Content */}
{/* SEO: Added role="dialog", aria-modal="true", and aria-labelledby for proper semantic structure and accessibility for screen readers and crawlers */}
<motion.div
initial={{ opacity: 0, scale: 0.95, y: 20 }}
animate={{ opacity: 1, scale: 1, y: 0 }}
exit={{ opacity: 0, scale: 0.95, y: 20 }}
transition={{ type: 'spring', duration: 0.5, bounce: 0.3 }}
className="relative flex max-h-[85vh] w-full max-w-[1000px] flex-col overflow-hidden rounded-[20px] border border-white/10 bg-[#0A0A0A] shadow-2xl"
role="dialog"
aria-modal="true"
aria-labelledby="announcement-title"
>
{/* Noise Overlay */}
<div
Expand Down Expand Up @@ -153,7 +157,7 @@ export const AnnouncementPopup: React.FC<AnnouncementPopupProps> = ({ announceme
{/* Right Side: Content */}
<div className="flex w-full flex-col justify-between overflow-hidden p-5 sm:p-6 lg:w-1/2 lg:p-8">
{/* Title */}
<h2 className="mb-2 font-heading text-2xl font-black uppercase tracking-tighter text-white sm:text-3xl lg:text-4xl">
<h2 id="announcement-title" className="mb-2 font-heading text-2xl font-black uppercase tracking-tighter text-white sm:text-3xl lg:text-4xl">
{title}
</h2>

Expand Down