Skip to content
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

endpoint/scroll #143

Merged
merged 2 commits into from
Dec 28, 2024
Merged

endpoint/scroll #143

merged 2 commits into from
Dec 28, 2024

Conversation

enzonotario
Copy link
Owner

Description

  • Adds a Copy Button to Endpoint section
  • Use scrollIntoView instead of scrollTo to scroll to a specific operation.

Related issues/external references

Types of changes

  • New feature

Copy link

vercel bot commented Dec 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vitepress-openapi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 28, 2024 2:12am

Copy link
Contributor

coderabbitai bot commented Dec 28, 2024

Walkthrough

This pull request introduces several modifications across different files, primarily focusing on enhancing the UI components related to API path and endpoint display. The changes include styling updates in Vue components, a simplification of the scrolling utility function, and the addition of localization strings for a new "Copy endpoint" feature. The modifications aim to improve the visual presentation and user interaction with API documentation components.

Changes

File Change Summary
src/components/Path/OAPath.vue Removed gap-4 class from grid container, affecting item spacing
src/components/Path/OAPathEndpoint.vue Added new styling classes, introduced copy endpoint button, enhanced horizontal overflow handling
src/lib/utils.ts Simplified scrollIntoOperationByOperationId function, removed custom scrolling logic
src/locales/en.json Added new translation key "Copy endpoint"
src/locales/es.json Added Spanish translation for "Copy endpoint"
src/locales/pt-BR.json Added Brazilian Portuguese translation for "Copy endpoint"

Sequence Diagram

sequenceDiagram
    participant User
    participant OAPathEndpoint
    participant Clipboard
    
    User->>OAPathEndpoint: Click copy button
    OAPathEndpoint->>Clipboard: Copy endpoint URL
    OAPathEndpoint->>User: Visual feedback (optional)
Loading

Possibly related PRs

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@enzonotario enzonotario changed the title feat(OAPathEndpoint): add copy button endpoint/scroll Dec 28, 2024
Copy link

pkg-pr-new bot commented Dec 28, 2024

Open in Stackblitz

npm i https://pkg.pr.new/vitepress-openapi@143

commit: 5466feb

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2b52947 and 5466feb.

📒 Files selected for processing (6)
  • src/components/Path/OAPath.vue (1 hunks)
  • src/components/Path/OAPathEndpoint.vue (1 hunks)
  • src/lib/utils.ts (1 hunks)
  • src/locales/en.json (1 hunks)
  • src/locales/es.json (1 hunks)
  • src/locales/pt-BR.json (1 hunks)
🔇 Additional comments (7)
src/components/Path/OAPathEndpoint.vue (1)

47-60: Verify accessibility for the horizontal scrolling section.
Using overflow-x-auto whitespace-nowrap is a good approach for horizontal overflow. However, ensure that keyboard users can easily reach and scroll the content, possibly by adding focusable elements or leveraging user agent scrolling.

src/lib/utils.ts (1)

28-31: Check cross-browser compatibility for scrollIntoView.
The scrollIntoView option with smooth behavior may not be fully supported in older browsers. Consider adding a fallback or a conditional check if legacy support is needed.

src/locales/en.json (1)

48-49: No issues found.
The new translation key "Copy endpoint" is consistent with the rest of the file and enhances localization.

src/locales/pt-BR.json (1)

48-49: Translation is accurate.
The new key "Copy endpoint": "Copiar endpoint" aligns well with Brazilian Portuguese usage.

src/locales/es.json (1)

48-49: LGTM! Translation entry added correctly

The new Spanish translation for the copy button feature is properly formatted and grammatically correct.

src/components/Path/OAPath.vue (2)

138-138: Verify visual spacing after gap removal

The removal of gap-4 from the grid class will eliminate the spacing between grid items. Please ensure this change:

  1. Doesn't cause elements to appear too cramped
  2. Maintains proper visual hierarchy
  3. Aligns well with the new copy button addition

Would you like me to help create visual regression tests to verify the layout changes?


137-139: Verify responsive layout behavior

The grid layout changes could have different impacts based on:

  • Screen sizes (mobile vs desktop)
  • Column configuration (1 vs 2 columns)

Please test the layout across different screen sizes and column configurations to ensure proper spacing and alignment.

@enzonotario enzonotario merged commit ce53c11 into develop Dec 28, 2024
8 checks passed
@enzonotario enzonotario deleted the feature/endpoint-scroll branch January 8, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant