feat: markdown export#425
Conversation
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:
We will review your PR as soon as possible. Happy coding! 💻✨ |
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds 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. ChangesMarkdown profile export
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
Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
src/components/profile/ProfileActions.tsxsrc/components/profile/ProfileView.tsx
|
again same issue here fix merge conflicts @Aditya8369 and remove unnesseacary code here |
|
@PRODHOSH fixed the conflict and this branch only contains the required changes |
There was a problem hiding this comment.
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 winSurface 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
catchblock.🤖 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 winAnnounce the copied state to assistive technology.
The constant
aria-labeloverrides the changing button text, so screen-reader users may receive no success feedback. Make the label conditional and expose the status through anaria-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
📒 Files selected for processing (3)
src/components/profile/ProfileActions.tsxsrc/components/profile/ProfileView.tsxsrc/lib/score.ts
There was a problem hiding this comment.
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 winSurface 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
catchblock.🤖 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 winAnnounce the copied state to assistive technology.
The constant
aria-labeloverrides the changing button text, so screen-reader users may receive no success feedback. Make the label conditional and expose the status through anaria-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
📒 Files selected for processing (3)
src/components/profile/ProfileActions.tsxsrc/components/profile/ProfileView.tsxsrc/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-tabindexwarning. 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
getContributorTierto 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
Summary
I have completed the implementation of the copy markdown export option and fully verified it.
Related Issue
Closes #292
Type of Change
Changes Made
AI Usage
Checklist
mainconsole.logleft insrc/schema.sqland a new migration file are includedDESIGN.mdand followed the design system (colors, spacing, typography, components)feat:,fix:,docs:, etc.)Summary by CodeRabbit