EDSC-3068: Remove the empty heading Well renders on the order status page - #2071
Open
suthat wants to merge 1 commit into
Open
EDSC-3068: Remove the empty heading Well renders on the order status page#2071suthat wants to merge 1 commit into
suthat wants to merge 1 commit into
Conversation
…page Well always rendered a header block containing an h2 and an intro div fed by `heading` and `introduction` props. Nothing passes those props: OrderStatus, the component's only consumer, uses the Well.Heading and Well.Introduction compound components instead. The result on /downloads/:id is an empty `<h2 class="well__heading">` above the page content, which SortSite flags as an empty heading and screen readers announce as a blank heading. The intro div was dead too. It renders `well__intro`, which does not exist in Well.scss -- the stylesheet only defines `well__introduction`, the class WellIntroduction renders. Drop the header block and the two unused props. Add tests for Well, which had none. Co-authored-by: Cursor <cursoragent@cursor.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.
Overview
What is the feature?
Closes #1362.
Wellalways renders a header block at the top of the component:Nothing ever passes
headingorintroduction.OrderStatusis the only consumer ofWellin the app, and it uses theWell.HeadingandWell.Introductioncompound components as children instead. So on/downloads/:idthe markup comes out with an empty<h2 class="well__heading">sitting above the content — the empty heading SortSite flagged, and the grey gap in the screenshot on the issue. A screen reader user navigating by heading lands on a blank one before reaching "Download Status".The intro
<div>is dead in the same way, and there's a second clue that this block was left behind by the move to compound components: it renderswell__intro, which doesn't exist inWell.scss. The stylesheet only defineswell__introduction, which is the classWellIntroductionrenders. That div has never had any styling.What is the Solution?
Remove the header block and the two props that fed it.
I went with deleting rather than guarding with
{heading && ...}because there's no caller to keep working — the props have no users, and the class name mismatch means half of the block was never wired up correctly in the first place. Happy to switch to a conditional render if you'd rather keep the props available.Wellhad no test file, so I added one covering the children and the empty heading.What areas of the application does this impact?
The order status page (
/downloads/:id), which is the only placeWellis used. Visually the only change is that the emptyh2's bottom margin goes away, so the content above the "Download Status" heading tightens up slightly.Testing
Reproduction steps
section.well. Onmainthere's an<h2 class="well__heading"></h2>with nothing in it, followed by an empty<div class="well__intro">. Both are gone with this change.The two new tests fail on
main(expected document not to contain element, found <h2andexpected [ …(2) ] to have a length of 1 but got 2) and pass here.npm run lintis clean.Attachments
No screenshot — the empty heading has no visible content, only a small amount of vertical space.
Unrelated to this change, but while I was in the folder I noticed
WellHeading.jsxdeclares its component asWellSection, so headings show up under the wrong name in React DevTools. Happy to send a follow-up for that if it's worth fixing.Checklist
npm audit fixand made note of any changes in this PR — no dependencies are touched by this PR