Replace custom JS toast system with HTMX-native patterns#177
Merged
chriscarrollsmith merged 3 commits intomainfrom Mar 18, 2026
Merged
Replace custom JS toast system with HTMX-native patterns#177chriscarrollsmith merged 3 commits intomainfrom
chriscarrollsmith merged 3 commits intomainfrom
Conversation
Migrate showToast and flash cookie JS to server-side rendering with htmx-ext-remove-me for auto-dismiss, HTMX responseHandling config for error toasts, and a flash cookie middleware for full-page-load toasts. Replace HX-Refresh on avatar update with OOB swaps for both the profile card and navbar avatar, eliminating the visible flicker from full page reloads and ensuring the success toast is always displayed. Co-Authored-By: Claude Opus 4.6 (1M context) <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
showToast()JS function and client-side flash cookie reader with server-side rendering viahtmx-ext-remove-mefor auto-dismiss, HTMXresponseHandlingconfig for error-status OOB swaps, and a flash cookie middleware for full-page-load toasts.HX-Refresh: trueon avatar upload with OOB swaps for both the profile display and navbar avatar. This eliminates the visible flicker from full page reloads and ensures the "Profile updated successfully" toast always appears (previously lost during refresh).navbar_avatar.html) with an OOB variant (navbar_avatar_oob.html) for HTMX responses.Test plan
test_htmx_success_toast_appears— name-only profile update shows toasttest_avatar_update_toast_appears— avatar update shows toasttest_avatar_update_no_full_reload— avatar update uses OOB swaps, no page reloadtest_htmx_error_toast_appears— error responses show toast via OOBtest_flash_cookie_toast_appears— flash cookies render server-side on loadtest_toast_auto_dismisses— toasts auto-dismiss after 5s via remove-metest_toast_close_button— manual close button works🤖 Generated with Claude Code