Skip to content

feat: add broken link reporting workflow to 404 page#7843

Open
ananyaa0518 wants to merge 7 commits into
layer5io:masterfrom
ananyaa0518:master
Open

feat: add broken link reporting workflow to 404 page#7843
ananyaa0518 wants to merge 7 commits into
layer5io:masterfrom
ananyaa0518:master

Conversation

@ananyaa0518

@ananyaa0518 ananyaa0518 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes #7832 by adding a "Report Broken Link" action to the 404 page.

Changes introduced

  • Added a Report Broken Link button to the 404 page.
  • Implemented client-side generation of a pre-filled GitHub bug report URL using:
    • window.location.href (broken URL)
    • document.referrer (referrer information)
    • navigator.userAgent (browser information)
  • Integrated the existing Layer5 bug_report.md issue template to keep reporting consistent with the repository's workflow.
  • Updated the 404 page button layout to support the additional action while maintaining responsiveness.

This enhancement enables visitors to report unknown 404s originating from stale external links, cached search results, and legacy campaigns without requiring additional backend infrastructure.

Notes for Reviewers

Verification

  • Verified the 404 page locally using invalid routes.
  • Confirmed that the "Report Broken Link" button opens the Layer5 bug report template.
  • Verified that the issue title and body are pre-populated with:
    • Broken URL
    • Referrer
    • Browser/User-Agent information
  • Tested responsiveness of the updated button layout.

before

image

after

image image

Demo

demo.mov

Signed commits

  • Yes, I signed my commits.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview deployment: https://layer5.io/pr-preview/pr-7843/

Note: Preview may take a moment (GitHub Pages deployment in progress). Please wait and refresh. Track deployment here

Comment thread src/sections/404/index.js
Comment thread src/sections/404/404.style.js Outdated

@Oluwatunmise-olat Oluwatunmise-olat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great work on the implementation, the broken link reporting flow works really well! One small thing. The three buttons on the 404 page look a bit uneven in sizing. Could we make sure they're all consistently sized so the layout feels balanced or make it better?

@ananyaa0518

ananyaa0518 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author
image @Oluwatunmise-olat Thanks for the feedback! I've updated the button styling to ensure all three actions have consistent sizing while preserving the existing column layout. The latest changes have been pushed and the updated preview/screenshots are available for review.

Signed-off-by: ananyaa <dk80655@gmail.com>
@Bhumikagarggg

Copy link
Copy Markdown
Contributor

@ananyaa0518 Thank you for your contribution! Let's discuss this during the website call tomorrow at 5:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would 🙂

@Oluwatunmise-olat

Copy link
Copy Markdown
Contributor

image @Oluwatunmise-olat Thanks for the feedback! I've updated the button styling to ensure all three actions have consistent sizing while preserving the existing column layout. The latest changes have been pushed and the updated preview/screenshots are available for review.

Is there any reason why the nav bar is duplicated?

@ananyaa0518

Copy link
Copy Markdown
Contributor Author

Thanks for catching that! The duplicated navbar is only appearing in my local environment and doesn't show up in the deployed preview.

Oluwatunmise-olat

This comment was marked as outdated.

@Oluwatunmise-olat Oluwatunmise-olat self-requested a review July 6, 2026 12:47

@KhushamBansal KhushamBansal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One potential concern: if a user lands on the 404 page because they manually entered a URL with a typo, the Report Broken Link option would still be available.

@ananyaa0518

Copy link
Copy Markdown
Contributor Author

@KhushamBansal Thanks for bringing that up! I can think of two possible approaches here:

  • Only render the "Report Broken Link" action when document.referrer is present, which would avoid reports from manually entered URLs while still capturing broken links from search engines, external sites, and internal navigation.

  • Keep the reporting action available, but if document.referrer is empty, show a confirmation dialog reminding users to verify that they didn't manually enter the URL before submitting a report.

Which approach would you prefer, or do you have another approach in mind?

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.

Enhance 404 page to facilitate broken link reporting

5 participants