Skip to content

fix(grid): Modify the spacing between the sorting buttons in saas mode. #3603

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 1 commit into from
Jul 24, 2025

Conversation

discreted66
Copy link
Collaborator

@discreted66 discreted66 commented Jul 22, 2025

PR

fix:修改saas模式表格排序按钮间距

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Introduced a new "Triangle Up" icon, now available in the icon library.
    • Grid table sorting indicators now use the new "Triangle Up" and "Triangle Down" icons for a refreshed appearance.
  • Style

    • Increased the font size of sort button icons in the grid table header for improved visibility.
    • Standardized SVG icon sizes in grid toolbar buttons for consistent display.

Copy link

coderabbitai bot commented Jul 22, 2025

Walkthrough

A new "IconTriangleUp" SVG icon component is introduced and integrated across several packages. References to sorting icons in the grid are updated to use the new triangle icons, and the corresponding style for the sort button is adjusted to use a medium text size. The icon is also added to demo icon groups. Additionally, fixed sizing is applied to certain toolbar SVG icons.

Changes

File(s) Change Summary
examples/sites/demos/pc/app/icon/iconGroups.js Added 'IconTriangleUp' to the Upward icon group array.
packages/design/saas/src/grid/index.ts Updated sort icon imports and assignments to use IconTriangleUp/IconTriangleDown instead of chevrons.
packages/theme-saas/src/grid/table.less Changed .tiny-grid-sort__btn font size utility from text-xs to text-md.
packages/theme-saas/src/grid/toolbar.less Added fixed height and width (1.25rem) to SVG icons in toolbar buttons for consistent sizing.
packages/vue-icon-saas/index.ts, packages/vue-icon/index.ts Added IconTriangleUp import, named exports, and default export object entry.
packages/vue-icon/src/triangle-up/index.ts Introduced new IconTriangleUp SVG icon component module.

Estimated code review effort

2 (~15 minutes)

Poem

A triangle points up, so crisp and so neat,
Now in our grid, it’s a visual treat!
The icons align, the styles are refined,
With medium-sized flair, the changes combined.
Fixed sizes set, the toolbar shines bright,
The rabbit hops by, with a twinkle and light—
“New icons for all, the triangle is here!”
▲🐇

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

examples/sites/demos/pc/app/icon/iconGroups.js

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-vue".

(The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-vue@latest --save-dev

The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

packages/design/saas/src/grid/index.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-vue".

(The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-vue@latest --save-dev

The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

packages/vue-icon-saas/index.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-vue".

(The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-vue@latest --save-dev

The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

  • 2 others

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5825314 and 57f6d0d.

⛔ Files ignored due to path filters (4)
  • packages/theme-saas/src/svgs/triangle-down.svg is excluded by !**/*.svg
  • packages/theme-saas/src/svgs/triangle-up.svg is excluded by !**/*.svg
  • packages/theme/src/svgs/triangle-down.svg is excluded by !**/*.svg
  • packages/theme/src/svgs/triangle-up.svg is excluded by !**/*.svg
📒 Files selected for processing (7)
  • examples/sites/demos/pc/app/icon/iconGroups.js (1 hunks)
  • packages/design/saas/src/grid/index.ts (2 hunks)
  • packages/theme-saas/src/grid/table.less (1 hunks)
  • packages/theme-saas/src/grid/toolbar.less (1 hunks)
  • packages/vue-icon-saas/index.ts (3 hunks)
  • packages/vue-icon/index.ts (3 hunks)
  • packages/vue-icon/src/triangle-up/index.ts (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • packages/theme-saas/src/grid/toolbar.less
  • packages/design/saas/src/grid/index.ts
  • packages/vue-icon/index.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • examples/sites/demos/pc/app/icon/iconGroups.js
  • packages/theme-saas/src/grid/table.less
  • packages/vue-icon/src/triangle-up/index.ts
  • packages/vue-icon-saas/index.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: PR E2E Test (pnpm test:e2e3)
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

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.

@github-actions github-actions bot added the bug Something isn't working label Jul 22, 2025
Copy link

@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

🔭 Outside diff range comments (1)
packages/theme-saas/src/grid/table.less (1)

687-693: Font size now exceeds the fixed button box – risk of vertical clipping

@apply text-md bumps the font-size to 14 px/16 px (depending on Tailwind config) while the element height/line-height are locked at 14 px (~'h-3.5' ; line-height: 14px).
On some zoom levels the glyph will be taller than the box, causing clipping / baseline shift.

 .@{grid-prefix-cls}-sort__btn {
   @apply ~'h-3.5';
   line-height: 14px;
   @apply block;
-  @apply text-md;
+  /* keep visual size while increasing spacing */
+  @apply text-xs;      /* revert font-size                   */
+  @apply mx-0.5;       /* add horizontal gap instead         */
   @apply fill-color-icon-secondary;
   transform: scale(0.8);
   @apply cursor-pointer;
 }

Alternatively, remove the explicit height/line-height and rely on flex/gap for spacing.
Please verify in all supported browsers, especially when the page is zoomed.

🧹 Nitpick comments (2)
examples/sites/demos/pc/app/icon/iconGroups.js (1)

74-76: Group ordering drift

'IconTriangleUp' is appended but the list is roughly alphabetical.
Consider inserting after 'IconTriangleDown' to keep predictable ordering and avoid merge-conflicts later.

packages/vue-icon-saas/index.ts (1)

383-384: Index file keeps growing – consider auto-generation

The manual addition of IconTriangleUp works, but this flat file is already >2 k lines.
Long-term maintainability and tree-shaking suffer.

Suggestion: switch to a build-time script that:

  1. Scans src/**/index.ts for default exports.
  2. Generates this barrel module with consistent ordering and both camelCase aliases.

This avoids human error and keeps bundle size in check.

Also applies to: 1458-1460, 2069-2070

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 80a5340 and 5825314.

⛔ Files ignored due to path filters (4)
  • packages/theme-saas/src/svgs/triangle-down.svg is excluded by !**/*.svg
  • packages/theme-saas/src/svgs/triangle-up.svg is excluded by !**/*.svg
  • packages/theme/src/svgs/triangle-down.svg is excluded by !**/*.svg
  • packages/theme/src/svgs/triangle-up.svg is excluded by !**/*.svg
📒 Files selected for processing (6)
  • examples/sites/demos/pc/app/icon/iconGroups.js (1 hunks)
  • packages/design/saas/src/grid/index.ts (2 hunks)
  • packages/theme-saas/src/grid/table.less (1 hunks)
  • packages/vue-icon-saas/index.ts (3 hunks)
  • packages/vue-icon/index.ts (3 hunks)
  • packages/vue-icon/src/triangle-up/index.ts (1 hunks)
🧠 Learnings (2)
packages/design/saas/src/grid/index.ts (2)

Learnt from: Davont
PR: #2513
File: packages/vue/src/huicharts/huicharts-histogram/src/chart-histogram.vue:33-36
Timestamp: 2024-11-25T03:43:05.285Z
Learning: 在 Tiny Vue 代码库中,使用 chart-core 中的 huiChartOption 的组件,不应在其 data 中定义 huiChartOptionoption,而是应该依赖 chart-core 提供的 huiChartOption

Learnt from: Davont
PR: #2513
File: packages/vue/src/huicharts/huicharts-sunburst/src/chart-sunburst.vue:30-32
Timestamp: 2024-11-25T03:24:05.740Z
Learning: 在位于packages/vue/src/huicharts/huicharts-sunburst/src/chart-sunburst.vue的组件中,当使用chart-core时,应删除错误的option定义,使用chart-core中的huiChartOption

packages/vue-icon/src/triangle-up/index.ts (1)

Learnt from: Davont
PR: #2513
File: packages/vue/src/huicharts/huicharts-histogram/src/chart-histogram.vue:33-36
Timestamp: 2024-11-25T03:43:05.285Z
Learning: 在 Tiny Vue 代码库中,使用 chart-core 中的 huiChartOption 的组件,不应在其 data 中定义 huiChartOptionoption,而是应该依赖 chart-core 提供的 huiChartOption

🧰 Additional context used
🧠 Learnings (2)
packages/design/saas/src/grid/index.ts (2)

Learnt from: Davont
PR: #2513
File: packages/vue/src/huicharts/huicharts-histogram/src/chart-histogram.vue:33-36
Timestamp: 2024-11-25T03:43:05.285Z
Learning: 在 Tiny Vue 代码库中,使用 chart-core 中的 huiChartOption 的组件,不应在其 data 中定义 huiChartOptionoption,而是应该依赖 chart-core 提供的 huiChartOption

Learnt from: Davont
PR: #2513
File: packages/vue/src/huicharts/huicharts-sunburst/src/chart-sunburst.vue:30-32
Timestamp: 2024-11-25T03:24:05.740Z
Learning: 在位于packages/vue/src/huicharts/huicharts-sunburst/src/chart-sunburst.vue的组件中,当使用chart-core时,应删除错误的option定义,使用chart-core中的huiChartOption

packages/vue-icon/src/triangle-up/index.ts (1)

Learnt from: Davont
PR: #2513
File: packages/vue/src/huicharts/huicharts-histogram/src/chart-histogram.vue:33-36
Timestamp: 2024-11-25T03:43:05.285Z
Learning: 在 Tiny Vue 代码库中,使用 chart-core 中的 huiChartOption 的组件,不应在其 data 中定义 huiChartOptionoption,而是应该依赖 chart-core 提供的 huiChartOption

🔇 Additional comments (5)
packages/vue-icon/index.ts (3)

383-384: Addition is consistent and alphabetically-placed – no action required.

IconTriangleUp is imported right after IconTriangleDown, preserving the existing alphabetical order and mirroring the down-triangle pattern.


1457-1460: Good: camelCase alias included.

Both the PascalCase export and its iconTriangleUp alias are declared, matching the convention used for every other icon pair.


2068-2070: Default export list updated correctly.

IconTriangleUp is added to the giant default export object, keeping the icon available for tree-shaking consumers.

packages/design/saas/src/grid/index.ts (1)

1-1: Icon swap looks correct – verify build size only.

Replacing chevrons with triangles aligns with the new visual spec and keeps the invocation pattern (IconFoo()) unchanged.
The only follow-up worth checking is the resulting bundle size; if the chevrons are now unused elsewhere, they can eventually be dropped to save a few bytes.

Also applies to: 14-15

packages/vue-icon/src/triangle-up/index.ts (1)

12-15: Implementation mirrors existing icon pattern.

Uses the common svg helper with the correct asset and name; nothing else to flag.

@zzcr zzcr merged commit 532c8a7 into opentiny:dev Jul 24, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants