[2.x] fix: various styling fixes#4480
Merged
Merged
Conversation
On mobile the avatar column is hidden, so the base Post padding (20px right, 0 left) creates visual asymmetry. The container already provides 15px on both sides, so zeroing the right padding here gives symmetric spacing.
- Add primary-colour left border to unread HeaderListItems for clear visual distinction in dark mode, where background contrast alone was insufficient - Use --control-bg-shaded on hover so hovered items are visually distinct from the unread background - Fix PATCH response returning isRead:false: the isRead set handler dispatched a ReadNotification command that updated the DB but left the in-memory Notification model with read_at=null; the serialised response therefore returned isRead:false, causing store.pushPayload to overwrite the local optimistic update; calling refresh() reloads the model from the now-updated DB before serialisation
- Add data-digits attribute to bubble span for CSS targeting - Anchor 3+ digit bubbles to the right edge of the button so they grow leftward - Prevent notification unread count from going negative
luma() uses W3C relative luminance (gamma-corrected) which disagrees with the JS isDark utility's YIQ formula for warm/mid-range colours. For example, orange (#FF8C00) has luma ~40% (below the 50% threshold, giving white text) but YIQ ~158 (above 128, giving dark text — correct). Switch to the same YIQ formula: r*299 + g*587 + b*114, threshold 128. Pre-computed into a variable to avoid nested parentheses in if(). The original fix for dark primaries (#064635) is preserved — YIQ 49 is well below the threshold so white text is still used.
540200b to
ddbf6d6
Compare
imorland
added a commit
that referenced
this pull request
Mar 21, 2026
imorland
added a commit
that referenced
this pull request
Mar 21, 2026
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
.Postfor mobile. The base style haspadding-right: 20pxbutpadding-left: 0(the avatar column provides left balance on desktop). On mobile with no avatar column, this caused visual asymmetry. The container already provides 15px symmetrically, so the extra post-level right padding is zeroed out.box-shadow: inset 3px 0) to unreadHeaderListItems for clear visual distinction in dark mode, where background contrast alone was insufficient. Also use--control-bg-shadedon hover so hovered items are distinct from the unread background./api/notifications/:idreturningisRead: falseafter marking as read. TheisReadset handler dispatched aReadNotificationcommand that updated the database but left the in-memoryNotificationmodel withread_at = null. The serialised response therefore returnedisRead: false, causing the JS store to overwrite the optimistic local update. Calling$notification->refresh()reloads the model from the now-updated DB before serialisation.right: 2px) so it grows leftward over the bell icon rather than rightward into the adjacent avatar. Uses adata-digitsattribute on the bubble span, targeted by CSS attribute selectors at@tablet-up. Also prevents the unread count going negative on optimistic decrement, and guards the bubble against non-positive values.luma()(W3C relative luminance) which disagrees with the JSisDarkutility's YIQ formula for warm/mid-range colours — e.g. orange (#FF8C00) has luma ~40% (white text) but YIQ ~158 (dark text, correct). Switch to the same YIQ formula used byisDark:r×299 + g×587 + b×114, threshold 128. The original fix for dark primaries (#064635) is preserved.Test plan
#064635) — primary buttons should show white text