Repository navigation
feat: attribution as notice box, suppress foreign admin notices on the community page - #48
Merged
Merged
Conversation
… 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>
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.
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