ux: make the "No notes found" empty-state notice dismissible
The inline notice on the My Notes page rendered with class="notice notice-info" but no is-dismissible modifier, so WordPress's core common.js never attached an X close button. Users had no way to clear the empty-state message for the current view. Audited every notice the plugin emits while I was in there — the migration notice and the settings_errors() calls were already correctly dismissible AND only fired in their intended state. The empty-state notice was the only laggard. All four notice paths now share the same contract: dismissible by the user, AND only rendered when the underlying state warrants it. Dismissal is per-page-load (WP core's default behavior — clicking X hides the element for the current view only). Cross-page-load persistence would need user_meta or a transient and isn't built yet; flagged in the changelog for a future enhancement. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,26 @@ Format: [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/) — versi
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed — Empty-state notice ("No notes found") now dismissible
|
||||
The "No active notes found" / "No completed notes found" inline
|
||||
notice on the My Notes page rendered with `class="notice notice-info"`
|
||||
but no `is-dismissible` modifier, so WordPress's core common.js
|
||||
never attached an X close button to it. Users couldn't clear the
|
||||
message for the current view. Adding `is-dismissible` is the only
|
||||
change — WP core handles the X button render + click-to-hide
|
||||
automatically. Dismissal is per-page-load (the message reappears on
|
||||
next refresh if the list is still empty); persistence across
|
||||
reloads would need user_meta tracking and isn't built yet.
|
||||
|
||||
**Notice inventory after this fix** — every notice the plugin emits
|
||||
is now both dismissible AND only fires in its intended state:
|
||||
|
||||
| Notice | Class | Fires when |
|
||||
|---|---|---|
|
||||
| "No active/completed notes found" | `notice notice-info is-dismissible` | List is empty |
|
||||
| Migration prompt | `notice notice-info is-dismissible` | `wp_notes_migration_completed` option is unset |
|
||||
| Settings save / import errors / import success | rendered by core `settings_errors()` (auto-dismissible since WP 4.2) | Only on form submission events |
|
||||
|
||||
### Changed — Removed duplicate smiley-face button on the emoji picker
|
||||
The "Add emoji" formatting option rendered two clickable elements
|
||||
stacked: the *"Click to add emoji"* text input AND a separate button
|
||||
|
||||
Reference in New Issue
Block a user