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: use lit element to refactor comment component #80

Merged
merged 36 commits into from
Mar 4, 2024

Conversation

ruibaby
Copy link
Member

@ruibaby ruibaby commented Feb 25, 2024

使用 Lit 重写评论组件,可以获得更小的体积,并且提高可移植性,用于任何 JS 框架。

可测试插件:plugin-comment-widget-2.0.0-SNAPSHOT.jar.zip

/kind improvement

Fixes #79

此外,重写之后也解决了以下遗留问题:

  1. Fixes 评论区域大小问题 #78
  2. Fixes 评论组件字体样式会覆盖主题默认的字体样式 #72
  3. Fixes 评论区在白天/黑夜模式切换后的样式问题 #56
  4. Fixes 手机端样式问题 #74
  5. Fixes Halo2.12.4环境Earth主题1.7.1下评论链接错误问题 #81
  6. Emoji 选择器的配色切换问题。

TODO:

  • 完成 Emoji 选择组件的适配
  • 完善基础样式(按钮、分页等)
  • 整理 CSS,抽取部分 CSS 规则为变量
  • 完善默认的暗黑样式
  • 完善操作提示(比如评论成功后的提示)
  • 完善文档
使用 Lit Element 重构评论组件,以获得更小的体积,以及解决若干遗留问题。

@f2c-ci-robot f2c-ci-robot bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/improvement Categorizes issue or PR as related to a improvement. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Feb 25, 2024
@f2c-ci-robot f2c-ci-robot bot requested review from guqing and JohnNiang February 25, 2024 13:51
@ruibaby ruibaby changed the title WIP: refactor: use lit element to refactor widget component WIP: refactor: use lit element to refactor comment component Feb 25, 2024
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
ruibaby added 7 commits March 2, 2024 22:55
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
ruibaby added 10 commits March 3, 2024 14:54
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
@ruibaby ruibaby changed the title WIP: refactor: use lit element to refactor comment component refactor: use lit element to refactor comment component Mar 4, 2024
@f2c-ci-robot f2c-ci-robot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 4, 2024
Signed-off-by: Ryan Wang <[email protected]>
Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

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

Awesome!

/approve

Copy link

f2c-ci-robot bot commented Mar 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnNiang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 4, 2024
ruibaby added 2 commits March 4, 2024 16:47
Signed-off-by: Ryan Wang <[email protected]>
Signed-off-by: Ryan Wang <[email protected]>
Copy link
Member

@guqing guqing left a comment

Choose a reason for hiding this comment

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

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Mar 4, 2024
@f2c-ci-robot f2c-ci-robot bot merged commit 5bc1867 into halo-dev:main Mar 4, 2024
4 checks passed
@ruibaby ruibaby deleted the refactor/use-lit branch March 4, 2024 10:55
f2c-ci-robot bot pushed a commit to halo-dev/plugin-search-widget that referenced this pull request Mar 5, 2024
移除在 #25 中提供的字体和行高变量,改为和 halo-dev/plugin-comment-widget#80 中一致的字体设置方案。

添加了三个 CSS 变量:

```
--halo-search-widget-base-font-size: ;			全局字体大小
--halo-search-widget-base-border-radius: ;	边框圆角
--halo-search-widget-base-font-family: ;			字体
```

/kind feature

```release-note
添加和字体相关的 CSS 变量
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/improvement Categorizes issue or PR as related to a improvement. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
3 participants