8000 docs: fix sider border issue of documentation by afc163 · Pull Request #364 · ant-design/x · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

docs: fix sider border issue of documentation #364

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 2 commits into from
Dec 17, 2024
Merged

Conversation

afc163
Copy link
Member
@afc163 afc163 commented Dec 17, 2024

same as ant-design/ant-design#51925

Summary by CodeRabbit

  • 新特性
    • 优化了侧边栏组件的样式和布局,提高了响应性。
    • 调整了侧边栏的内边距和位置属性,以改善用户体验。

Copy link
Contributor
coderabbitai bot commented Dec 17, 2024
📝 Walkthrough

变更概述

演练

此次更改主要修改了 .dumi/theme/slots/Sidebar/index.tsx 文件中的侧边栏组件样式和布局。通过引入 marginXXLpaddingXXS 标记,调整了侧边栏容器的底部内边距和整体内边距。同时,更新了主菜单的定位,考虑了内容顶部边距,并优化了滚动条行为。

变更

文件路径 变更摘要
.dumi/theme/slots/Sidebar/index.tsx - 添加 marginXXLpaddingXXS 标记
- 修改底部内边距为 ${marginXXL}px
- 更新主菜单 top 属性,加入 token.contentMarginTop
- 调整最大高度计算方式
- 移除 scrollbar-color,添加 scrollbar-gutter: stable

建议的审阅者

  • li-jia-nan
  • YumoImer

诗歌

🐰 侧边栏的舞蹈,
像兔子轻跳的姿态,
像素与空间的交错,
布局如诗般精巧,
代码中的优雅旋律。


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.

Copy link
Contributor
github-actions bot commented Dec 17, 2024

Preview is ready

Copy link

Walkthrough

This pull request addresses a documentation issue by fixing the sider border. It involves adjustments to the styling of the sidebar component, specifically in the padding and positioning of elements to ensure proper layout and appearance.

Changes

File Summary
.dumi/theme/slots/Sidebar/index.tsx Adjusted the sidebar styles by modifying padding and positioning logic, including the use of new token values for margin and padding.


return {
asideContainer: css`
min-height: 100%;
padding-bottom: 48px;
padding-bottom: ${marginXXL}px !important;

Choose a reason for hiding this comment

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

Ensure that marginXXL is defined and has the expected value to avoid unexpected layout issues. Consider adding a default value or a check to handle undefined cases.

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: 0

🧹 Nitpick comments (1)
.dumi/theme/slots/Sidebar/index.tsx (1)

17-17: 内边距调整合理,建议改进命名!

使用 Design Token 替换固定像素值是个很好的改进。不过建议考虑将类名 asideContainer 改为更具语义化的名称,比如 sidebarContainer

-    asideContainer: css`
+    sidebarContainer: css`

Also applies to: 19-19

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f04a8dd and 9bcf3f4.

📒 Files selected for processing (1)
  • .dumi/theme/slots/Sidebar/index.tsx (2 hunks)
🔇 Additional comments (2)
.dumi/theme/slots/Sidebar/index.tsx (2)

12-12: 新增 Design Token 使用正确!

从 token 中解构出 marginXXLpaddingXXS 符合 Ant Design 的设计标准。


96-102: 滚动条和定位逻辑优化,但需要注意浏览器兼容性!

改进:

  • 使用 position: sticky 提升了侧边栏的交互体验
  • 计算高度时考虑了 contentMarginTop,使布局更准确
  • 添加 scrollbar-gutter: stable 防止滚动条出现时的布局抖动

需要注意:

  • 移除了 scrollbar-color 属性可能影响自定义滚动条样式
  • scrollbar-gutter 的浏览器兼容性需要验证

建议添加以下代码以保持滚动条样式的一致性:

    mainMenu: css`
      scrollbar-width: thin;
      scrollbar-gutter: stable;
+     scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
+     &::-webkit-scrollbar {
+       width: 6px;
+     }
+     &::-webkit-scrollbar-thumb {
+       background: rgba(0, 0, 0, 0.3);
+       border-radius: 3px;
+     }
✅ Verification successful

滚动条样式修改是合理的,无需额外更改

代码库分析显示:

  • 其他组件中的滚动条样式都采用了简单的配置,没有复杂的自定义样式
  • 主题中多处使用 scrollbar-color: unset,表明项目倾向于使用浏览器默认的滚动条颜色
  • 移除 scrollbar-color 属性符合项目的整体样式策略

因此,当前的修改是合理的,无需添加建议的自定义滚动条样式。保持简单的 scrollbar-width: thinscrollbar-gutter: stable 配置即可。

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 检查项目中是否有其他地方使用了 scrollbar-color
rg "scrollbar-color" --type css --type typescript

Length of output: 84


Script:

#!/bin/bash
# Search for scrollbar-color usage with correct file types
rg "scrollbar-color" -t css -t tsx -t ts

# Also check for any scrollbar styling patterns
rg "scrollbar" -t css -t tsx -t ts

Length of output: 131


Script:

#!/bin/bash
# Search for any scrollbar related styling in all files
rg "scrollbar"

# Also check for specific scrollbar styling in the theme directory
fd . .dumi/theme -t f -e tsx -e ts -e css --exec cat {} | rg "scrollbar"

Length of output: 759

Copy link
cloudflare-workers-and-pages bot commented Dec 17, 2024

Deploying ant-design-x with  Cloudflare Pages  Cloudflare Pages

Latest commit: e4bcb21
Status: ✅  Deploy successful!
Preview URL: https://ae363cd7.ant-design-x.pages.dev
Branch Preview URL: https://docs-fix-sider-border.ant-design-x.pages.dev

View logs

@afc163 afc163 enabled auto-merge (squash) December 17, 2024 02:31
Copy link
codecov bot commented Dec 17, 2024

Bundle Report

Bundle size has no change ✅

Copy link
Contributor
github-actions bot commented Dec 17, 2024

size-limit report 📦

Path Size
dist/antdx.min.js 40.68 KB

Copy link
codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.36%. Comparing base (f04a8dd) to head (e4bcb21).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #364   +/-   ##
=======================================
  Coverage   91.36%   91.36%           
=======================================
  Files          66       66           
  Lines        1448     1448           
  Branches      383      368   -15     
=======================================
  Hits         1323     1323           
  Misses        125      125           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor
@YumoImer YumoImer left a comment

Choose a reason for hiding this comment

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

+1

@afc163 afc163 merged commit a9cbf94 into main Dec 17, 2024
15 checks passed
@afc163 afc163 deleted the docs/fix-sider-border branch December 17, 2024 02:48
coding-ice pushed a commit to coding-ice/x that referenced this pull request Jun 17, 2025
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.

2 participants
0