Skip to content

[Issue #8845] Refactor returnToGrants link#8951

Open
andycochran wants to merge 12 commits intomainfrom
andycochran/#8845--return-to-grants
Open

[Issue #8845] Refactor returnToGrants link#8951
andycochran wants to merge 12 commits intomainfrom
andycochran/#8845--return-to-grants

Conversation

@andycochran
Copy link
Collaborator

@andycochran andycochran commented Mar 10, 2026

Summary

Fixes #8845

Changes proposed

  • Delete the "Return to Grants.gov" link
    • rm ReturnToGrantsNotification component and test files
    • Nix Suspense and ReturnToGrantsNotification from the <Breadcrumbs> component
    • Nix the unnecessary flex classes and container around the breadcrumbs, since the "Return to GG" link no longer
      needs to sit beside it in the layout
    • Nix the utm_source query parameter, which is no longer needed to conditionally show the "Return to GG" link
  • Move the /search page heading directly into the page's h1
    • rm unnecessary SearchCallToAction component (which was just the h1 and "Return to GG" link)
  • Add a new banner that's always visible on the search page below the site header
  • Adjust margin/padding of /search heading
image image

Context for reviewers

This PR is the first step in refactoring the Breadcrumbs component so that all pages are managing them consistently. Removing the "Return to GG" link from Breadcrumbs will make that easier.

Validation steps

  • Run the app and check that all pages with breadcrumbs are still working properly:
    • The breadcrumbs should still be there
    • The "Return to GG" link should not be there
  • The Search page (only) should display a new banner that inform users that Simpler is the new way to search and they must sign in on GG to access classic search

@andycochran andycochran marked this pull request as draft March 10, 2026 18:08
@andycochran andycochran marked this pull request as ready for review March 10, 2026 18:28
@andycochran andycochran requested review from mdragon and removed request for btabaska, chay-REIsys and dghazvini March 10, 2026 21:54
@andycochran andycochran requested a review from btabaska March 11, 2026 14:57
<div className="bg-primary-lightest line-height-body-2 font-body-3xs padding-y-1">
<div className="grid-container">
<SearchCallToAction />
{t.rich("goToGG", {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This refactor implements new behavior in t.rich("goToGG") with both internal and external links, but I don’t see replacement coverage for this flow. Would be super helpful to add a test that asserts the banner renders and that the Grants.gov link includes the expected safe external-link attrs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added minimal tests (tho there's no good way to test for external-link attrs in intl'd content).

Comment on lines +80 to +90
<div className="bg-primary-lightest line-height-body-2 font-body-3xs padding-y-1">
<div className="grid-container">
<SearchCallToAction />
{t.rich("goToGG", {
"search-link": (chunks) => <Link href="/search">{chunks}</Link>,
"gg-link": (chunks) => (
<a href="https://grants.gov/" target="_blank">
{chunks}
</a>
),
})}
</div>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I could be wrong, but since this is an important banner-style message, have we thought about giving it alert semantics (for example a USWDS alert/site-alert pattern)? Right now it’s just plain text in a div, so screen reader folks may not get any extra signal that this is important context.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though this is styled very similarly to the usa-alert component, I don't think it's an alert.

Do you think this needs to be an alert? Or is the problem that it's a new pattern that looks similar to an alert?

I don't see much value in using usa-alert , as we'd then have to override many of its styles (the left border, content width/container, font size, etc…). And the only thing it'd get us is an ARIA role, but the usa-alert doesn't require an ARIA role unless you wanna raise the importance of its message. If we do want to make this an alert, I could be convinced to add role="region". But our <SimplerAlert> component only has two roles: "error" or "alert". And this message doesn't rise to either of those levels of importance.

I don't see much value in refactoring our <SimplerAlert> component and overriding all its styles for this piece of content (which is a temporary solution btw). I see this as similar to the "Official website…" usa-banner, which does not have an ARIA role.

@btabaska
Copy link
Collaborator

Totally makes sense to remove the old component and its tests, but we did drop all coverage around the “return to Grants.gov” messaging in the same PR. Let’s make sure we replace that with search-page-level tests so we still cover the user-facing path end to end.

@andycochran
Copy link
Collaborator Author

Moved the banner to a component and added tests. @btabaska I think I've addressed all your concerns. Re-review?

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.

New "Return to Grants.gov" pattern

3 participants