KIT-48: copy skills.sh search result links#246
Conversation
|
Warning Review limit reached
More reviews will be available in 15 minutes and 36 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR adds clipboard copy functionality for per-skill Skills.sh URLs in the search page. A ChangesSkills.sh URL Clipboard Copy
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 `@crates/desktop/src/pages/skills-sh/search.tsx`:
- Around line 127-133: The toast.danger call in the error handler is showing the
raw error.message to users when the error is an Error instance, but user-facing
messages should always be localized. Keep the raw error details in the
console.error log for debugging purposes, but change the toast.danger call to
always use the localized string t("skillsShLinkCopyFailed") instead of
conditionally displaying error.message. Remove the ternary operator and pass
only the localized translation string to ensure users see a consistent,
localized error message regardless of the actual error type.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 70ba38bc-a00c-4b14-9ecc-f2e06eaaf4e0
📒 Files selected for processing (4)
crates/desktop/src/lib/locales/en.tscrates/desktop/src/lib/locales/zh-Hans.tscrates/desktop/src/lib/locales/zh-Hant.tscrates/desktop/src/pages/skills-sh/search.tsx
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7def19397c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const pathParts = | ||
| sourceParts[0] === "github" ? sourceParts.slice(1) : sourceParts; |
There was a problem hiding this comment.
Prefix site sources in copied skills.sh URLs
When a search result comes from a site/domain source such as open.feishu.cn, skills.sh detail pages live under /site/<source>/<skill> (for example https://www.skills.sh/site/open.feishu.cn/lark-approval), but this branch leaves every non-github source unprefixed. Copying those results therefore produces links like https://www.skills.sh/open.feishu.cn/lark-approval, which are not the valid skills.sh detail URLs for site-backed skills.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 285cbcabca
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return sourceParts; | ||
| } | ||
|
|
||
| return ["site", ...sourceParts]; |
There was a problem hiding this comment.
Preserve GitHub shorthand paths
For GitHub-backed search results whose source is the normal skills.sh shorthand like vercel-labs/skills, this fallback treats the source as a site source because it does not start with github or site. Copying a result such as find-skills would produce https://www.skills.sh/site/vercel-labs/skills/find-skills, while skills.sh serves those GitHub results at /vercel-labs/skills/find-skills; only domain sources such as open.feishu.cn should receive the site/ prefix.
Useful? React with 👍 / 👎.
| const skillSegment = skill.slug || skill.name; | ||
| const urlSegments = [...pathParts, skillSegment] | ||
| .filter(Boolean) | ||
| .map((part) => encodeURIComponent(part)); |
There was a problem hiding this comment.
Avoid appending full IDs as leaf slugs
When the skills.sh search API omits skillId, this app maps the API id into skill.slug (see crates/skills-sh/src/types.rs), and those IDs are already full skills.sh paths such as vercel-labs/skills/find-skills or site/open.feishu.cn/lark-approval. Appending that full path as the final segment and then encodeURIComponent-ing it copies URLs with duplicated/escaped paths like /site/open.feishu.cn/site%2Fopen.feishu.cn%2Flark-approval; use the full slug path directly or extract only the final segment before appending.
Useful? React with 👍 / 👎.
Summary
Verification
Closes KIT-48
Summary by CodeRabbit