Skip to content

Conversation

@VitorAEltz
Copy link
Contributor

Overview
This PR introduces a new split button component that enhances the documentation experience by providing quick access to AI-powered tools and content sharing features. The component replaces the previous dropdown with a more intuitive split button design.

✨ New Features
🔄 Split Button Design
Left Button: "Copy Page" - Directly copies markdown content to clipboard
Right Button: Dropdown arrow - Reveals additional AI integration options
Compact Layout: Optimized spacing and sizing for better UI density

📋 Copy Page Functionality
Fetches clean markdown content from production .md endpoints
Smart URL Mapping: Automatically converts localhost:4321 to https://www.azion.com for local development
Visual Feedback: Button text changes to "Copied" with auto-reset after 2 seconds
Error Handling: Graceful fallbacks with user-friendly error messages

🤖 AI Integration Options
View Page as Markdown: Opens .md version in new tab for raw content viewing
Open in ChatGPT: Launches ChatGPT with pre-filled prompt about the documentation page
Open in Claude: Launches Claude AI with pre-filled prompt about the documentation page

@VitorAEltz VitorAEltz requested review from a team as code owners October 16, 2025 22:29

// For local development, replace localhost with production URL
if (markdownUrl.includes('localhost:4321')) {
markdownUrl = markdownUrl.replace('http://localhost:4321/', 'https://www.azion.com/');
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead, use hard-coded use const.ts to import the correct URL.

let markdownUrl = url.replace(/\/$/, '') + '.md';

// For local development, replace localhost with production URL
if (markdownUrl.includes('localhost:4321')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead, use hard-coded use const.ts to import the correct URL.


openChatGPT(url) {
const prompt = encodeURIComponent(`Read this page from the Azion docs: ${url} and answer questions about the content.`);
const chatGptUrl = `https://chat.openai.com/?prompt=${prompt}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest using this URL as constants in the top of the component


openClaude(url) {
const prompt = encodeURIComponent(`Read this page from the Azion docs: ${url} and answer questions about the content.`);
const claudeUrl = `https://claude.ai/new?q=${prompt}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same her, use as constant.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants