feat: add Export to PDF action on public profile page (#2604) - #3495
Open
aaniya22 wants to merge 1 commit into
Open
feat: add Export to PDF action on public profile page (#2604)#3495aaniya22 wants to merge 1 commit into
aaniya22 wants to merge 1 commit into
Conversation
…-coder#2604) Signed-off-by: aaniya22 <aaniyaatomar@gmail.com>
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
Contributor
Author
|
The 2 failing tests (in |
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.
closes #2604
Summary
Adds a "Print Profile / Export to PDF" action on the public profile page. Clicking the button triggers the browser's native
window.print(), with@media printCSS overrides that hide navigation, share, and footer elements so the printed output shows a clean, card-based metrics layout.Closes #2604
Type of Change
What Changed
src/components/ExportPdfButton.tsx— client button that triggerswindow.print()ExportPdfButtonintosrc/app/u/[username]/page.tsx, placed alongside the compare buttonsprint:hiddento the Share section, Powered-by-DevTrack footer, and other non-essential UI so they're excluded from the printed/PDF output@media printrules insrc/app/globals.cssto strip shadows, flatten borders on card elements (.surface-card,[class*="rounded-2xl"]), and prevent cards from breaking across pagesHow to Test
/u/<username>Expected result: A clean, print-ready view of the profile stats with no interactive UI elements, matching the layout described in the issue.
Checklist
console.log, debug code, or commented-out blocksnpm run lintpasses locallynpm run type-check)Accessibility (UI changes only)
Additional Context
No external dependencies added — uses native
window.print()and CSS@media printper the issue's acceptance criteria.