Feat(notifications): What's New — featured item hero + also-new accordion#6
Draft
avivu wants to merge 17 commits into
Draft
Feat(notifications): What's New — featured item hero + also-new accordion#6avivu wants to merge 17 commits into
avivu wants to merge 17 commits into
Conversation
9484ad8 to
3bda21d
Compare
- Add featured item hero layout (image, title, chip overlay) - Add "Also new" collapsed accordion list for non-featured items - New WhatsNewItemCollapsed component with expand/collapse, chevron icon, and per-item unread dot (opacity-based, no layout shift) - Lift seenItemIds state to WhatsNew so it survives drawer close/reopen - Badge (bar button + editor app bar) decrements per item via e-notification-item-seen window event; no 9+ cap; corner-overlap position - Auto-mark fully-visible items as seen (featured hero + all items when no featured exist) so badge clears correctly on drawer open - initialHasUnread flag suppresses dots after page refresh with 0 unread Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace custom CSS keyframe animation and absolutely-positioned Box badge with the MUI Badge component from @elementor/ui, matching the existing design-system pattern. Also restore is_unread alongside unread_count in the JS config to avoid breaking existing consumers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- editor-v1.js: revert unread_count > 0 back to is_unread (restored in PHP config) - whats-new-item.js: use insetInlineStart instead of left for RTL support Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Show 2-line clamped description in collapsed state (disappears when expanded) - Increase item padding from py:1.5 to py:2 (16px) for better breathing room - Align chevron to flex-start to match taller row height Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
a681418 to
71f273e
Compare
…lper - options.php: extract private get_unread_notification_ids() to eliminate duplicated transient logic between has_unread_notifications/get_unread_count - whats-new.js: wrap handleSeen with useCallback for stable reference; make setIsRead optional (default noop) so callers don't need to pass it - whats-new-drawer-content.js: add PropTypes, remove eslint-disable, use useRef for seenItemIds to cleanly satisfy exhaustive-deps - whats-new-item-collapsed.js: add PropTypes, remove eslint-disable - whats-new-item.js: use MUI variant="h6" instead of hardcoded fontSize - bar-button-notification.js: drop explicit setIsRead noop prop Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Notification BarButtonNotification no longer accepts defaultIsRead — badge state is now driven by window.elementorNotifications.unread_count directly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add optional `listLabel` field to featured notifications that controls the text shown in the divider above the collapsed items list. When omitted, a plain divider is rendered with no label. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…isplay wp_localize_script() converts all PHP values to strings, so unread_count: 0 becomes "0" in JS. Strict equality (0 === "0") returns false, causing the badge to display "0" even when there are no unread notifications. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…isNew Collapsing and re-expanding an item was calling onSeen again, causing the badge to double-decrement. Fix in two places: - handleSeen: only dispatch e-notification-item-seen when item wasn't already seen - handleToggle: only call onSeen when the item is still unread (isNew) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6c47038 to
de68c17
Compare
…animation When closing an expanded item, the description preview was appearing in the header immediately (as expanded became false), while the image was still visible inside the animating Collapse — causing a visual jump. Fix: hide the preview on toggle and restore it only after onExited fires (animation fully complete). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ransition Instead of mounting/unmounting the description preview (which caused a height jump when it appeared), always keep it in the DOM and transition opacity only. Header height stays constant throughout the animation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Opacity-only approach left an invisible gap in the expanded header. Also transition max-height and margin-top so the description takes zero space when not shown. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Animating the preview in/out caused layout issues no matter the approach. The title is sufficient for identification in collapsed state; the full description is visible on expand. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pass setIsOpen to WhatsNewItemCollapsed and add the same onClick handler used in WhatsNewItem — clicking a '#'-prefixed CTA URL now closes the drawer, consistent with the featured/regular item behaviour. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
listLabelfield on the featured notification — plain divider is rendered when omittede-notification-item-seenwindow eventseenItemIdsstate is lifted toWhatsNewso it survives drawer close/reopen within a sessioninitialHasUnreadflag (captured once at page load from PHP) suppresses unread dots after a page refresh when there are no unread itemsunread_count(integer) alongsideis_unread(boolean) in the JS config; private helper eliminates duplication inOptionsTest plan
?reset_notifications=1, reload — badge shows unread countlistLabelon featured notification — divider shows the custom label textlistLabel— divider is plain with no text🤖 Generated with Claude Code