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

refactor(tooltip): 重构 tooltip API 命名 #2271

Merged
merged 9 commits into from
Jul 17, 2023
Merged

Conversation

lijinke666
Copy link
Member

@lijinke666 lijinke666 commented Jun 27, 2023

👀 PR includes

🎨 Enhance

  • Code style optimization
  • Refactoring
  • Change the UI
  • Improve the performance
  • Type optimization

📝 Description

配置

api 都在 tooltip 命名空间下, 命名可以简化, 并且修改语义

visible 或者 show, open 之类的命名更适用于 <Modal/>, <Tooltip/> 这种组件的方式, 为 true 就显示, false 就关闭,

而对于我们的 tooltip, showTooltip 实际含义表示是否开启 tooltip 的能力, 而不是是否显示, 不管 true/false 都是默认关闭, 在 hover/click 的时候才会显示, 所以会有歧义

const s2Options = {
  tooltip: {
-    showTooltip: true,
+.   enable: true,

-    renderTooltip: () => new CustomTooltip()
+.   render: () => new CustomTooltip()
  }
}

方法

showSingleTips 和 onlyMenu 命名过于抽象, 和实际做的事情不符, 重命名为更表意的

s2.showTooltip({
  options: {
-   showSingleTips: true,
+   onlyShowCellText: true,

-   onMenu: true,
+   onlyShowOperator: true
  }
})

BUG 修复 - 暗黑主题适配问题

  1. 操作栏背景丢失
  2. tooltip 标题颜色不对

🖼️ Screenshot

Before After
image image
image image

🔗 Related issue link

🔍 Self-Check before the merge

  • Add or update relevant docs.
  • Add or update relevant demos.
  • Add or update test case.
  • Add or update relevant TypeScript definitions.

@vercel
Copy link

vercel bot commented Jun 27, 2023

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

Name Status Preview Comments Updated (UTC)
antvis-s2 ❌ Failed (Inspect) Jul 17, 2023 6:32am

@github-actions
Copy link
Contributor

github-actions bot commented Jun 27, 2023

Size Change: -29 B (0%)

Total Size: 320 kB

Filename Size Change
./packages/s2-core/dist/index.min.js 226 kB -44 B (0%)
./packages/s2-react/dist/index.min.js 67 kB -2 B (0%)
./packages/s2-react/dist/style.min.css 3.91 kB +6 B (0%)
./packages/s2-vue/dist/index.min.js 20.2 kB +2 B (0%)
./packages/s2-vue/dist/style.min.css 1.91 kB +9 B (0%)
ℹ️ View Unchanged
Filename Size
./packages/s2-core/dist/style.min.css 401 B

compressed-size-action

@github-actions
Copy link
Contributor

github-actions bot commented Jun 27, 2023

你好, @lijinke666 CI 执行失败, 请点击 [Details] 按钮查看, 并根据日志修复。

Hello, @lijinke666 CI run failed, please click the [Details] button for detailed log information and fix it.

@github-actions github-actions bot added the 🚨 test failed 单元测试挂了 label Jun 27, 2023
@codecov
Copy link

codecov bot commented Jul 6, 2023

Codecov Report

Patch coverage has no change and project coverage change: +1.00 🎉

Comparison is base (ecdc9c8) 75.77% compared to head (2935c40) 76.77%.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2271      +/-   ##
==========================================
+ Coverage   75.77%   76.77%   +1.00%     
==========================================
  Files         257      268      +11     
  Lines       11994    12202     +208     
  Branches     2464     2484      +20     
==========================================
+ Hits         9088     9368     +280     
+ Misses       1398     1296     -102     
- Partials     1508     1538      +30     
Impacted Files Coverage Δ
packages/s2-core/src/cell/base-cell.ts 83.85% <ø> (-0.36%) ⬇️
packages/s2-core/src/cell/col-cell.ts 88.80% <ø> (+2.04%) ⬆️
packages/s2-core/src/cell/corner-cell.ts 81.00% <ø> (-1.70%) ⬇️
packages/s2-core/src/cell/data-cell.ts 76.12% <ø> (+9.46%) ⬆️
packages/s2-core/src/cell/header-cell.ts 63.01% <ø> (-2.81%) ⬇️
packages/s2-core/src/cell/index.ts 100.00% <ø> (ø)
packages/s2-core/src/cell/merged-cell.ts 91.66% <ø> (+54.16%) ⬆️
packages/s2-core/src/cell/row-cell.ts 71.42% <ø> (+0.62%) ⬆️
packages/s2-core/src/cell/series-number-cell.ts 90.90% <ø> (-2.20%) ⬇️
packages/s2-core/src/cell/table-col-cell.ts 84.61% <ø> (+3.48%) ⬆️
... and 99 more

... and 70 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@wjgogogo wjgogogo merged commit d25cfc6 into next Jul 17, 2023
6 checks passed
@wjgogogo wjgogogo deleted the refactor-tooltip-api branch July 17, 2023 07:27
@lijinke666
Copy link
Member Author

🎉 This PR is included in version @antv/s2-v2.0.0-next.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lijinke666
Copy link
Member Author

🎉 This PR is included in version @antv/s2-react-v2.0.0-next.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lijinke666
Copy link
Member Author

🎉 This PR is included in version @antv/s2-vue-v2.0.0-next.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next 2.0-next 版本的问题 pr(refactor) refactor released on @next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants