Skip to content

feat: markdown export#425

Closed
Aditya8369 wants to merge 3 commits into
PRODHOSH:mainfrom
Aditya8369:feat/markdown-export
Closed

feat: markdown export#425
Aditya8369 wants to merge 3 commits into
PRODHOSH:mainfrom
Aditya8369:feat/markdown-export

Conversation

@Aditya8369

@Aditya8369 Aditya8369 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

I have completed the implementation of the copy markdown export option and fully verified it.

Related Issue

Closes #292

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor
  • Chore / dependency update

Changes Made

  • Added the "Copy Markdown" action button to ProfileActions.tsx.
  • Passed the user's contributor stats from ProfileView.tsx to the actions component.

AI Usage

  • I did not use AI for any part of the code in this PR
  • I used AI for coding (specify which tool below) and I fully understand every change I made, including which functions I changed, why I changed them, and what side effects they could create

Checklist

  • I was assigned to the issue before opening this PR
  • My branch is up to date with main
  • Code works locally and I have tested it
  • No console.log left in src/
  • If schema changed — both schema.sql and a new migration file are included
  • If this is a UI change — I read DESIGN.md and followed the design system (colors, spacing, typography, components)
  • Docs updated if needed
  • PR title follows Conventional Commits format (feat:, fix:, docs:, etc.)
  • This PR description is written in my own words

Summary by CodeRabbit

  • New Features
    • Added a “Copy Markdown” action to profile pages that copies an OSSfolio Markdown embed.
    • The embed now includes a contributor score badge (tier-colored) and an “OSSfolio Stats” section.
    • The button updates its appearance to confirm successful copy, then reverts.
  • UI Enhancements
    • Contributor tier badges now use centralized tier logic and render using the tier’s configured color.

@github-actions

Copy link
Copy Markdown
Contributor

Welcome to OSSfolio, @Aditya8369! 🎉

Thank you for opening this pull request and contributing to the open-source community! 🚀

To ensure a smooth review process, please make sure you have:

  • Checked that your changes work locally and compile cleanly.
  • Followed the guidelines outlined in CONTRIBUTING.md.
  • Linked your PR to an open issue (e.g. Closes #ISSUE_NUMBER).

We will review your PR as soon as possible. Happy coding! 💻✨

@github-actions github-actions Bot added frontend Related to UI / Next.js UI Visual / design changes labels Jul 11, 2026
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7de94082-d248-406f-b3b3-ec8346bd6b9f

📥 Commits

Reviewing files that changed from the base of the PR and between 14d658d and 7b34bbc.

📒 Files selected for processing (3)
  • src/components/profile/ProfileActions.tsx
  • src/components/profile/ProfileView.tsx
  • src/lib/score.ts

📝 Walkthrough

Walkthrough

Adds a “Copy Markdown” profile action that embeds contributor statistics, applies shared score-based tier coloring, copies the result to the clipboard, and displays copied-state feedback. ProfileView now passes stats into ProfileActions.

Changes

Markdown profile export

Layer / File(s) Summary
Contributor tier model
src/lib/score.ts, src/components/profile/ProfileView.tsx
Adds shared contributor tier definitions and lookup logic, then uses the resolved tier name and color for the profile badge.
Markdown generation and props
src/components/profile/ProfileActions.tsx
ProfileActions accepts ContributorStats, builds a Markdown embed with tier-colored badge data, and copies it while tracking success state.
Copy action wiring and feedback
src/components/profile/ProfileView.tsx, src/components/profile/ProfileActions.tsx
ProfileView passes stats, and the actions bar renders a conditional “Copy Markdown” button with copied-state icons and labeling.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  actor Contributor
  participant ProfileView
  participant ProfileActions
  participant ClipboardAPI
  Contributor->>ProfileView: open profile
  ProfileView->>ProfileActions: pass username, score, and stats
  Contributor->>ProfileActions: click Copy Markdown
  ProfileActions->>ProfileActions: build Markdown embed with tier color
  ProfileActions->>ClipboardAPI: write Markdown
  ClipboardAPI-->>ProfileActions: copy succeeds
  ProfileActions-->>Contributor: show copied state
Loading

Possibly related PRs

Suggested labels: enhancement

Poem

A bunny found a badge to share,
With stats tucked neatly everywhere.
Click the button—hop, it’s copied,
Markdown petals neatly froppied.
README gardens bloom anew!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the markdown export feature in this PR.
Linked Issues check ✅ Passed The PR implements the requested markdown export button with stats, badges, and a profile link as described in issue #292.
Out of Scope Changes check ✅ Passed The tier-color helper and profile badge refactor support the markdown export feature and do not appear unrelated.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/profile/ProfileActions.tsx`:
- Around line 55-61: Extract the shared tier thresholds and base hex colors from
getTierColor and the ProfileView tier IIFE into a reusable tier utility, then
update both consumers to use it while preserving ProfileView’s “#” prefix and
rgba derivation and shields.io’s raw hex output. Move getTierColor outside the
component body since it has no state or prop dependencies.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0f268200-8ecd-4542-8b3d-566a2cbc854c

📥 Commits

Reviewing files that changed from the base of the PR and between 8626d3b and 14d658d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • src/components/profile/ProfileActions.tsx
  • src/components/profile/ProfileView.tsx

Comment thread src/components/profile/ProfileActions.tsx Outdated
@github-actions github-actions Bot added the backend Supabase / API / database label Jul 11, 2026
@PRODHOSH PRODHOSH self-requested a review July 12, 2026 01:43
@PRODHOSH

Copy link
Copy Markdown
Owner

again same issue here

fix merge conflicts @Aditya8369 and remove unnesseacary code here

@PRODHOSH PRODHOSH added ELUSOC ELUSOC project submission in-progress ADVENTURER Intermediate — 25 pts fix-merge-conflict labels Jul 12, 2026
@Aditya8369

Copy link
Copy Markdown
Contributor Author

@PRODHOSH fixed the conflict and this branch only contains the required changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/components/profile/ProfileActions.tsx (2)

76-82: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Surface clipboard failures to the user.

When clipboard access is unavailable or denied, the core action silently fails and only logs to the console. Set an error state or show the project’s standard error toast in the catch block.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/profile/ProfileActions.tsx` around lines 76 - 82, Update the
clipboard failure handling in the markdown copy action to surface an error to
the user instead of only calling console.error. In the catch block around
navigator.clipboard.writeText, set the existing error state or invoke the
project’s standard error toast, while preserving the current success state
behavior.

173-180: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Announce the copied state to assistive technology.

The constant aria-label overrides the changing button text, so screen-reader users may receive no success feedback. Make the label conditional and expose the status through an aria-live="polite" region.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/profile/ProfileActions.tsx` around lines 173 - 180, Update the
markdown copy button in ProfileActions so its aria-label reflects the
markdownCopied state instead of remaining constant. Add an aria-live="polite"
status region around the changing copied/default text so assistive technology
announces successful copying.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/profile/ProfileView.tsx`:
- Line 22: Remove the unrelated tooltip feature changes from ProfileView,
including the `@radix-ui/react-tooltip` import and the associated code around the
contributor-tier/Markdown-export UI and lines 921-1002. Revert these changes so
the no-noninteractive-tabindex warning is eliminated and the PR remains focused.
- Line 716: Import the getContributorTier symbol used in ProfileView’s tier
calculation so the identifier resolves and the build succeeds. Use the existing
module that defines getContributorTier and preserve the current call site
unchanged.

---

Outside diff comments:
In `@src/components/profile/ProfileActions.tsx`:
- Around line 76-82: Update the clipboard failure handling in the markdown copy
action to surface an error to the user instead of only calling console.error. In
the catch block around navigator.clipboard.writeText, set the existing error
state or invoke the project’s standard error toast, while preserving the current
success state behavior.
- Around line 173-180: Update the markdown copy button in ProfileActions so its
aria-label reflects the markdownCopied state instead of remaining constant. Add
an aria-live="polite" status region around the changing copied/default text so
assistive technology announces successful copying.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7de94082-d248-406f-b3b3-ec8346bd6b9f

📥 Commits

Reviewing files that changed from the base of the PR and between 14d658d and 7b34bbc.

📒 Files selected for processing (3)
  • src/components/profile/ProfileActions.tsx
  • src/components/profile/ProfileView.tsx
  • src/lib/score.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/components/profile/ProfileActions.tsx (2)

76-82: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Surface clipboard failures to the user.

When clipboard access is unavailable or denied, the core action silently fails and only logs to the console. Set an error state or show the project’s standard error toast in the catch block.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/profile/ProfileActions.tsx` around lines 76 - 82, Update the
clipboard failure handling in the markdown copy action to surface an error to
the user instead of only calling console.error. In the catch block around
navigator.clipboard.writeText, set the existing error state or invoke the
project’s standard error toast, while preserving the current success state
behavior.

173-180: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Announce the copied state to assistive technology.

The constant aria-label overrides the changing button text, so screen-reader users may receive no success feedback. Make the label conditional and expose the status through an aria-live="polite" region.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/profile/ProfileActions.tsx` around lines 173 - 180, Update the
markdown copy button in ProfileActions so its aria-label reflects the
markdownCopied state instead of remaining constant. Add an aria-live="polite"
status region around the changing copied/default text so assistive technology
announces successful copying.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/profile/ProfileView.tsx`:
- Line 22: Remove the unrelated tooltip feature changes from ProfileView,
including the `@radix-ui/react-tooltip` import and the associated code around the
contributor-tier/Markdown-export UI and lines 921-1002. Revert these changes so
the no-noninteractive-tabindex warning is eliminated and the PR remains focused.
- Line 716: Import the getContributorTier symbol used in ProfileView’s tier
calculation so the identifier resolves and the build succeeds. Use the existing
module that defines getContributorTier and preserve the current call site
unchanged.

---

Outside diff comments:
In `@src/components/profile/ProfileActions.tsx`:
- Around line 76-82: Update the clipboard failure handling in the markdown copy
action to surface an error to the user instead of only calling console.error. In
the catch block around navigator.clipboard.writeText, set the existing error
state or invoke the project’s standard error toast, while preserving the current
success state behavior.
- Around line 173-180: Update the markdown copy button in ProfileActions so its
aria-label reflects the markdownCopied state instead of remaining constant. Add
an aria-live="polite" status region around the changing copied/default text so
assistive technology announces successful copying.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7de94082-d248-406f-b3b3-ec8346bd6b9f

📥 Commits

Reviewing files that changed from the base of the PR and between 14d658d and 7b34bbc.

📒 Files selected for processing (3)
  • src/components/profile/ProfileActions.tsx
  • src/components/profile/ProfileView.tsx
  • src/lib/score.ts
🛑 Comments failed to post (2)
src/components/profile/ProfileView.tsx (2)

22-22: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Remove the unrelated tooltip feature from this PR.

These changes do not support Markdown export or contributor tiers, expand the PR’s scope, and Line 935 introduces a no-noninteractive-tabindex warning. Revert them here or move them into a separate PR.

Also applies to: 69-76, 921-1002

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/profile/ProfileView.tsx` at line 22, Remove the unrelated
tooltip feature changes from ProfileView, including the `@radix-ui/react-tooltip`
import and the associated code around the contributor-tier/Markdown-export UI
and lines 921-1002. Revert these changes so the no-noninteractive-tabindex
warning is eliminated and the PR remains focused.

Source: Linters/SAST tools


716-716: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Import getContributorTier to restore the build.

Line 716 references an identifier that is not imported, causing Cannot find name 'getContributorTier'.

Proposed fix
+import { getContributorTier } from "`@/lib/score`";
🧰 Tools
🪛 GitHub Actions: CI - Build & Lint / 0_build.txt

[error] 716-716: Type-check failed (tsc). TS2304: Cannot find name 'getContributorTier'.

🪛 GitHub Actions: CI - Build & Lint / build

[error] 716-716: TypeScript (tsc --noEmit) failed: TS2304 Cannot find name 'getContributorTier'.

🪛 GitHub Check: build

[failure] 716-716:
Cannot find name 'getContributorTier'.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/profile/ProfileView.tsx` at line 716, Import the
getContributorTier symbol used in ProfileView’s tier calculation so the
identifier resolves and the build succeeds. Use the existing module that defines
getContributorTier and preserve the current call site unchanged.

Source: Linters/SAST tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ADVENTURER Intermediate — 25 pts backend Supabase / API / database ELUSOC ELUSOC project submission fix-merge-conflict frontend Related to UI / Next.js in-progress UI Visual / design changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Create a markdown export option

2 participants