Skip to content

[create-link]: Add customizable templates and tab selection feature #20120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 54 commits into from
Jun 30, 2025

Conversation

sinsky
Copy link
Contributor

@sinsky sinsky commented Jun 28, 2025

Description

This PR enhances the create-link extension with two major features:

  1. Customizable Link Templates: Users can now define custom link formats through extension preferences, allowing for platform-specific or personalized link generation (e.g., Notion blocks, Slack formatting, etc.)

  2. Tab Selection Interface: Added a new command that lists all open browser tabs, enabling users to select and copy links from any tab without switching between windows

Additional improvements include:

  • Refactored formatting logic from centralized formatter.ts to individual command files for better maintainability
  • Added input sanitization for URLs and titles to handle special characters safely
  • Enhanced error handling for malformed URLs
  • Simplified command descriptions: Updated verbose command descriptions to be more concise and user-friendly (e.g., "Copy the URL of the frontmost tab as plain text" instead of lengthy explanations)

Screencast

create-link-1
CleanShot 2025-06-29 at 03 29 03

Checklist

sinsky and others added 30 commits March 20, 2025 14:12
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…eating links to prevent potential security issues and ensure valid output
…ing an error to improve user experience when fetching the active tab
…copying functionality to enhance user experience with dynamic link creation
…ine custom format structure and improve type safety
…ble links from the current URL for enhanced user flexibility
…stomTemplate for better clarity and consistency in naming
…wn special characters for safe link generation
…ks from title and URL for better formatting and usability
…wn links from title and URL for improved functionality
…arify functionality and improve user understanding
…ty and maintainability of the component's return statement
…opyCustomFormatPreferences for clarity and consistency
[ext/create-link] Copying Links in a Custom User-Defined Format
…to define their own link templates for copied URLs

docs(package.json): update description for copy-custom command to explain custom link formatting and available placeholders
…ion links to enhance user customization options
…eCustomTemplate function for improved code clarity and maintainability
…better user experience

fix(formatter.ts): return an empty string on error to prevent potential issues with undefined values
…o define their own link format for copied URLs
…how toast notification if not set to enhance user experience
sinsky added 14 commits March 27, 2025 00:14
…serExtension.Tab object instead of separate title and url parameters for better structure and clarity
…tly for improved clarity and accuracy in link creation
…BrowserExtension.Tab object instead of separate title and url parameters for better structure and clarity
…logic to enhance flexibility in handling different tab formats
This commit introduces new placeholders, `{title_html_escaped}` and `{title_markdown_escaped}`, for the custom format feature.

These placeholders allow users to safely embed page titles into HTML or Markdown links by applying the respective escaping rules, preventing syntax errors. The existing `{title}` placeholder remains unchanged, providing the raw, unescaped title for flexibility.
This commit corrects an earlier merge conflict in `package.json` by restoring the missing command definition for `show-tabs`. This ensures the file is correctly formatted and aligned with the `main` branch, allowing all commands to be registered properly.
Reduced the length of descriptions for 'copy-plain-text', 'copy-html', 'copy-markdown', 'copy-custom', and 'show-tabs' commands in package.json for conciseness.
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: create-link Issues related to the create-link extension OP is author The OP of the PR is the author of the extension labels Jun 28, 2025
@raycastbot
Copy link
Collaborator

Thank you for the update! 🎉

You can expect an initial review within five business days.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Major update to the create-link extension adding tab selection and customizable link templates, with significant code reorganization.

  • Added new show-tabs command in package.json allowing users to select and copy links from any open browser tab
  • Consolidated link formatting logic into new formatter.ts utility, improving code maintainability
  • Refactored command descriptions in package.json to be more concise while maintaining functionality
  • New TabList component needs attention regarding error handling and accessibility patterns
  • Proper usage of {PR_MERGE_DATE} template in CHANGELOG.md header

9 files reviewed, 5 comments
Edit PR Review Bot Settings | Greptile

icon={Icon.TextCursor}
/>
<Action.CopyToClipboard
// eslint-disable-next-line @raycast/prefer-title-case
Copy link
Contributor

Choose a reason for hiding this comment

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

style: No need to disable eslint rule here. Just use title case 'Copy as HTML' consistently with other actions.

sinsky and others added 4 commits June 29, 2025 03:47
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@sinsky sinsky mentioned this pull request Jun 28, 2025
Copy link
Collaborator

@pernielsentikaer pernielsentikaer left a comment

Choose a reason for hiding this comment

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

Hi 👋

Looks good to me, approved 🔥

@pernielsentikaer pernielsentikaer self-assigned this Jun 30, 2025
@raycastbot raycastbot merged commit 6cb6ac1 into raycast:main Jun 30, 2025
2 checks passed
Copy link
Contributor

Published to the Raycast Store:
https://raycast.com/sinsky/create-link

@raycastbot
Copy link
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension: create-link Issues related to the create-link extension extension fix / improvement Label for PRs with extension's fix improvements OP is author The OP of the PR is the author of the extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants