Skip to content

feat: attribution as notice box, suppress foreign admin notices on the community page - #48

Merged
Robbertvermeulen merged 1 commit into
mainfrom
feat/attribution-notice-clean-page
Sep 21, 2026
Merged

Robbertvermeulen merged 1 commit into
mainfrom
feat/attribution-notice-clean-page

Conversation

@Robbertvermeulen

Copy link
Copy Markdown
Contributor

The attribution line renders as a calm info notice box (rt-banner family), and all other plugins' admin notices are removed on the community screen only (in_admin_header + remove_all_actions, screen-guarded) so notice-heavy sites keep a clean community tab.

Tests: JS 167/167, PHP 226/226, phpcs + phpstan clean; bundle rebuilt.

🤖 Generated with Claude Code

… on our page

Two approved changes from Robbert's live round.

1. Attribution as a notice box. The attribution line under the page header
   now renders as a proper banner (`rt-banner rt-banner-info rt-attribution`,
   a <div> replacing the old `<p class="rt-sub rt-attribution">`) instead of
   plain subtitle text — same shape/padding as the existing
   `rt-banner-pending`, with a calm info tint. `.rt-banner-info` mirrors the
   base `.rt-banner`'s own default colors explicitly (rather than relying on
   an un-named default), giving it the same paired, self-documenting status
   as `.rt-banner-pending`. Same text, same position, still gated on
   `attribution` being non-empty.

2. Suppress other admin notices on our page. Many sites stack unrelated
   plugin notices under every admin h1; they must not appear on the
   Community page. New `Page::suppressAdminNotices()`, hooked on
   `in_admin_header` (registered in Roundtable::mount() alongside
   registerMenu/enqueue): reads the current screen via
   `get_current_screen()` (in_admin_header carries no hook-suffix argument,
   unlike admin_enqueue_scripts, so this is the only way to identify the
   screen at that point) and, matching Page's screen slug only via the same
   str_ends_with(..., '_page_' . PAGE_SLUG) pattern enqueue() already uses,
   calls remove_all_actions('admin_notices') and
   remove_all_actions('all_admin_notices'). Every other screen is left
   untouched. Our own page never registers anything on those two hooks, so
   nothing of ours is lost.

Tests: community-app.test.mjs's attribution assertion now checks the exact
banner markup/classes. PageTest gained three suppressAdminNotices cases (our
screen removes both hooks; another screen removed nothing; no current screen
removed nothing). RoundtableMountTest now also asserts in_admin_header is
registered by mount().

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Robbertvermeulen
Robbertvermeulen merged commit 47ce28c into main Sep 21, 2026
2 checks passed
@Robbertvermeulen
Robbertvermeulen deleted the feat/attribution-notice-clean-page branch September 21, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant