fix(ui): stop the Reflector page giving two opposite instructions - #1293
Merged
Merged
Conversation
On a platform without the reflector dataplane, a Test Master saw the role
banner ("Switch to Reflector…") stacked directly above the platform banner
("…switch this stem to Test Master mode"). The platform banner is the more
specific of the two — where there is no dataplane, switching to Reflector is
advice the operator cannot act on — so RoleGuard now yields to it.
The remaining banner then still offered a "Switch to Test Master" button to an
operator who already held that role, and its body said the same. The switch
hint moves into its own key and, with the button, renders only when the switch
is still available.
The test harness pinned role to 'reflector', which is why no existing test saw
either state; it takes a role now.
Fixes #1258
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
Plan row
UI-STEM-2(high). With the role set to Test Master on a platformwithout the reflector dataplane (macOS / Windows builds), the Reflector page
stacked two banners telling the operator opposite things:
RoleGuard'srole.guard.needReflector("Switch to Reflector…") directly aboverole.platform.bannerTitle/bannerBody("…switch this stem to Test Mastermode").
RoleGuardtakes asupersededprop and renders children only when anotherbanner on the page already speaks for it.
ReflectorPagepassessuperseded={!reflectorSupported}: where there is no dataplane, "switch toReflector" is advice the operator cannot act on, so the platform banner —
the more specific of the two — is the one that stays.
Extension beyond the row's one line, same defect class. Once the role
banner is gone, the surviving platform banner still told a Test Master to
"switch this stem to Test Master mode" and offered a
Switch to Test Masterbutton that switches to the role they already hold — a banner instructing an
action that is already taken. The trailing clause moves out of
role.platform.bannerBodyinto a newrole.platform.bannerSwitchHint(
en+es), and hint and button render only whenrole !== 'test_master'.ReflectorPage.test.tsx'srenderPagehardcodedrole: 'reflector', which iswhy no existing test could see either state; it takes a
roleoption now.scripts/ui-coverage-baseline.txtfloors raised ascheck-ui-coverage.shasks (it prints the ratchet instruction while exiting 0).
Linked Issue
Fixes #1258
Type of Change
Bug fix (UI, no API or schema change). One new locale key in
enandes; oneexisting locale string shortened (its removed clause is the new key).
Risk
Low and contained to the Reflector page.
RoleGuard's default behaviour isunchanged —
supersededis optional and every other caller omits it, so therole banner still appears on every module page. The regression that matters
(losing the role banner where the reflector can run) is asserted by a new
test. No backend, no Go changes.
Testing Evidence
RED first — the two new banner assertions fail on the unfixed tree, and the
regression guard already passes:
GREEN after the fix:
Full gates on this branch:
Row acceptance ("ReflectorPage test: platform-unsupported + Test Master
renders exactly one banner") is the first new test above.
Security and Release Checklist
RoleGuardis anadvisory banner, not an authorization gate. The Start control stays
disabled on an unsupported platform (existing test unchanged).
check-banned-vocabulary.pygreen.govulncheck ./...green; no Go code changed.enandes.to document in release notes beyond the changelog entry.