feat: Add 'Edit this page' button linking to GitHub issues#158
feat: Add 'Edit this page' button linking to GitHub issues#158ankitkumar748846 wants to merge 1 commit intoOneBusAway:mainfrom
Conversation
aaronbrethorst
left a comment
There was a problem hiding this comment.
Hey Ankit, thanks for taking another swing at the "Edit this page" feature — I appreciate you putting in the effort on this. Before we can merge this, I will need you to make a couple changes:
Critical
-
The label "Edit this page" is misleading. The link goes to GitHub's generic new-issue form, but "Edit this page" is a well-established convention across documentation sites (React docs, MDN, Docusaurus, etc.) that means "open the source file on GitHub for direct editing." Users will be confused when they land on an issue form instead. Please either:
- Rename the link to something like "Report an issue" and swap the pencil icon for something more fitting, or
- Make it a true "Edit this page" link that points to the actual source file on GitHub
-
The link isn't page-specific. Every page on the site will link to the exact same
/issues/newURL with zero context. At minimum, please pass query parameters to pre-fill the issue with the page title and URL so maintainers know which page the feedback is about.
Important
-
Use Tailwind's color tokens instead of hardcoded hex values.
text-[#34d399]should betext-emerald-400(ortext-green-400) — they're the same color, but the Tailwind token works with the design system and can be paired with adark:variant. No other file in the codebase uses arbitrary hex colors in class names. -
Remove the magic number
lg:ml-[220px]. This arbitrary pixel value doesn't correspond to any layout dimension and will break if the sidebar width changes. Use Tailwind's standard spacing utilities or let the element flow naturally within the existingpx-4 sm:px-6 lg:px-8container. -
Add missing accessibility and security attributes. The existing footer links all have
titleattributes and their SVGs usearia-hidden="true". Please addtitle="..."to the link,aria-hidden="true"to the SVG, andrel="noopener noreferrer"alongsidetarget="_blank". -
Move the link out of
default.erband into_footer.erb. The project architecture (documented in CLAUDE.md) puts site-wide links insrc/_partials/_footer.erb, where the GitHub, App Store, and blog links already live. The layout file should stay a structural skeleton.
Fit and Finish
- Fix indentation. The file uses 2-space indentation, but the new code uses inconsistent spacing (attributes are indented to 15, 18, and 22 spaces in the same tag). Please reformat to match the surrounding code.
Thanks again, and I look forward to merging this change.
Fixes: #156
Description:
This PR introduces an "Edit this page" button that allows users to quickly navigate to the GitHub issues section to report problems or suggest improvements.
Screenshots
Why is this needed?