Skip to content

fix long names being clipped#342

Merged
ingoau merged 4 commits intomainfrom
bug-long-names-are-clipped
Jun 7, 2025
Merged

fix long names being clipped#342
ingoau merged 4 commits intomainfrom
bug-long-names-are-clipped

Conversation

@ingoau
Copy link
Member

@ingoau ingoau commented Jun 7, 2025

Summary by CodeRabbit

  • Style
    • Improved submenu link appearance with visible overflow and enhanced hover effects, including a gradient overlay that fades on hover for better visual clarity.

@ingoau ingoau linked an issue Jun 7, 2025 that may be closed by this pull request
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jun 7, 2025

Deploying edutools-testing with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7a6086a
Status: ✅  Deploy successful!
Preview URL: https://e62285a3.edutools-testing.pages.dev
Branch Preview URL: https://bug-long-names-are-clipped.edutools-testing.pages.dev

View logs

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 7, 2025

Warning

Rate limit exceeded

@Inglan has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 58 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 833dcd4 and 7a6086a.

📒 Files selected for processing (1)
  • src/lib/components/app-sidebar.svelte (2 hunks)

Walkthrough

The update modifies the sidebar component to enhance its submenu link styling and behavior. It adds an overflow-visible class to the sidebar content, updates submenu link classes using clsx, and introduces a gradient overlay div for submenu links, which fades out on hover to improve visual feedback.

Changes

File(s) Change Summary
src/lib/components/app-sidebar.svelte Added overflow-visible to sidebar content, updated submenu link classes with clsx, and added a gradient overlay div to submenu links for enhanced hover effects.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Sidebar
    participant SubmenuLink

    User->>Sidebar: Hover over sidebar
    Sidebar->>SubmenuLink: Display submenu link
    SubmenuLink->>SubmenuLink: Apply gradient overlay (default visible)
    User->>SubmenuLink: Hover over submenu link
    SubmenuLink->>SubmenuLink: Fade out gradient overlay
Loading

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.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @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.

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.

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.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a52c02c and 833dcd4.

📒 Files selected for processing (1)
  • src/lib/components/app-sidebar.svelte (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.*`: Do not correct spelling errors or grammar mistakes.

**/*.*: Do not correct spelling errors or grammar mistakes.

  • src/lib/components/app-sidebar.svelte
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (2)
src/lib/components/app-sidebar.svelte (2)

166-166: Good approach to enable overflow for clipped content.

Adding overflow-visible to the sidebar content is the correct foundation for allowing long names to extend beyond the container when needed.


212-215: Well-implemented class merging with appropriate hover behavior.

The use of clsx to combine the overflow management classes with existing props is clean and follows best practices. The class combination effectively implements the hover-to-reveal mechanism.

Comment on lines +222 to +224
<div
class="absolute right-0 h-full w-[25%] bg-gradient-to-r from-transparent to-sidebar group-hover/link:opacity-0"
></div>
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Creative gradient overlay solution with accessibility considerations.

The gradient overlay that fades on hover is an elegant approach to indicate clipped content. However, consider these accessibility improvements:

  1. Touch device compatibility: Users on touch devices can't hover to reveal full text
  2. Keyboard navigation: Ensure focus states also reveal the full text
  3. Discoverability: The hover behavior might not be obvious to users

Consider adding focus state support:

-class="absolute right-0 h-full w-[25%] bg-gradient-to-r from-transparent to-sidebar group-hover/link:opacity-0"
+class="absolute right-0 h-full w-[25%] bg-gradient-to-r from-transparent to-sidebar group-hover/link:opacity-0 group-focus-within/link:opacity-0"

Also consider adding title attributes to the links for better accessibility when text is clipped.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div
class="absolute right-0 h-full w-[25%] bg-gradient-to-r from-transparent to-sidebar group-hover/link:opacity-0"
></div>
<div
class="absolute right-0 h-full w-[25%] bg-gradient-to-r from-transparent to-sidebar group-hover/link:opacity-0 group-focus-within/link:opacity-0"
></div>
🤖 Prompt for AI Agents
In src/lib/components/app-sidebar.svelte around lines 222 to 224, the gradient
overlay that fades on hover does not support touch devices or keyboard
navigation and lacks discoverability. To fix this, add CSS styles to also
trigger the gradient fade on focus states for keyboard users, ensuring the full
text is revealed when links receive focus. Additionally, add descriptive title
attributes to the links whose text might be clipped to improve accessibility and
provide context for screen readers and touch users.

@ingoau ingoau merged commit d6f0cc0 into main Jun 7, 2025
5 checks passed
@delete-merged-branch delete-merged-branch bot deleted the bug-long-names-are-clipped branch June 7, 2025 13:37
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.

[Bug] Long names are clipped

1 participant