-
-
Notifications
You must be signed in to change notification settings - Fork 10k
refactor: improve entity component layout for better device responsiveness #7383
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
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@halo-dev/api-client
@halo-dev/components
@halo-dev/richtext-editor
@halo-dev/console-shared
@halo-dev/ui-plugin-bundler-kit
commit: |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7383 +/- ##
============================================
- Coverage 59.52% 59.47% -0.05%
+ Complexity 3804 3803 -1
============================================
Files 677 677
Lines 23225 23225
Branches 1496 1496
============================================
- Hits 13825 13814 -11
- Misses 8762 8771 +9
- Partials 638 640 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…eness Signed-off-by: Ryan Wang <i@ryanc.cc>
58e99b0
to
58cead9
Compare
Signed-off-by: Ryan Wang <i@ryanc.cc>
Signed-off-by: Ryan Wang <i@ryanc.cc>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors various Entity-related components to improve device responsiveness, with several style and structural updates that affect how data lists are rendered. Key changes include replacing traditional HTML list elements (ul/li) with the VEntityContainer component, updating unique keys for v-for iterations, and minor style adjustments (e.g. scoped styles and additional attributes).
Reviewed Changes
Copilot reviewed 47 out of 47 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
ui/console-src/modules/system/backup/tabs/List.vue | Replaced the ul/li list with VEntityContainer for rendering backup items. |
ui/console-src/modules/system/auth-providers/components/AuthProvidersSection.vue | Updated the draggable list structure by removing the li wrapper and using VEntityContainer. |
ui/console-src/modules/interface/themes/components/preview/ThemePreviewModal.vue | Switched from an unordered list to VEntityContainer for theme previews. |
ui/console-src/modules/interface/menus/components/MenuList.vue | Modified the menu list rendering to use VEntityContainer instead of ul/li. |
ui/console-src/modules/interface/menus/Menus.vue | Changed style encapsulation to scoped styles with :deep selectors. |
ui/console-src/modules/contents/posts/widgets/RecentPublishedWidget.vue | Updated the list rendering from ul/li to VEntityContainer for recent posts. |
ui/console-src/modules/contents/posts/tags/TagList.vue | Replaced traditional list markup with VEntityContainer in the tag list. |
ui/console-src/modules/contents/posts/components/entity-fields/TitleField.vue | Removed margin classes from VSpace, affecting spacing in the title field. |
Others | Similar list refactoring and style updates across categories, deleted lists, pages, comments, attachments, etc. |
Comments suppressed due to low confidence (3)
ui/console-src/modules/system/auth-providers/components/AuthProvidersSection.vue:42
- Removing the
- wrapper in the draggable list may alter the DOM structure expected by VueDraggable, potentially affecting drag functionality. Verify that the updated structure functions as intended with the draggable component.
<AuthProviderListItem v-for="authProvider in modelValue" :key="authProvider.name" :auth-provider="authProvider" @reload="onReload" />
ui/console-src/modules/system/backup/tabs/List.vue:29
- Replacing the
- element with VEntityContainer removes the explicit 'role="list"' attribute, which may negatively impact screen reader behavior. Please ensure that VEntityContainer provides appropriate list semantics if accessibility is a requirement.
<VEntityContainer>
ui/console-src/modules/contents/posts/components/entity-fields/TitleField.vue:39
- [nitpick] The removal of margin classes (e.g. 'mt-1 sm:mt-0') from VSpace may alter the intended spacing of the title field. Confirm that this change is deliberate to maintain layout consistency across devices.
<VSpace>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
目前,仍然无法切换至 console 或者 uc,且没有登出按钮。
此 PR 仅优化使用 VEntity 实现的各种数据列表。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works very well.
/approve
Refactor data list using VEntityContainer to optimize display across devices of various sizes. See halo-dev/halo#7383 Note: Updating to this version requires Halo >= 2.21.0. ```release-note 适配 Halo 2.21.0 的数据列表样式 ```
Refactor data list using VEntityContainer to optimize display across devices of various sizes. See halo-dev/halo#7383 Note: Updating to this version requires Halo >= 2.21.0. ```release-note 适配 Halo 2.21.0 的数据列表样式 ```
Refactor data list using VEntityContainer to optimize display across devices of various sizes. See halo-dev/halo#7383 Note: Updating to this version requires Halo >= 2.21.0. ```release-note 适配 Halo 2.21.0 的数据列表样式 ```
#### What type of PR is this? /area ui /kind bug /milestone 2.21.x #### What this PR does / why we need it: Resolve ui issue of global search component cause by #7383 #### Which issue(s) this PR fixes: Fixes #7478 #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? ```release-note 修复 2.21.0-alpha.1 中 Console 的全局搜索样式问题。 ```
What type of PR is this?
/area ui
/kind improvement
What this PR does / why we need it:
Refactor Entity-related components to better adapt to different devices.
Note: It should be noted that the current solution includes breaking updates, and if the plugin uses this component, it needs to be adapted. Although this change will not cause functional problems, it will only affect the style.
This is just an attempt at the moment, I will also try other solutions to ensure compatibilitybefore:
after:
Screen.Recording.2025-04-24.at.16.52.26.mov
Which issue(s) this PR fixes:
Fixes #7360
Fixes #7357
Fixes #5483
Fixes #2699
Fixes #7130
Fixes #7393
Special notes for your reviewer:
All data lists need to be tested.
Adaptation for plugin
If this component is used in a plugin, the plugin needs to actively adapt to it. Although it will not cause functional issues, it may result in style problems.
Adaptation method:
Before adapting, make sure that the
@halo-dev/components
package has been upgraded to version 2.21.0.The adaptation is very simple: just wrap the VEntity component(s) with a VEntityContainer component, for example:
Finally, please make sure to update the requires field in
plugin.yaml
to >=2.21.0
.Does this PR introduce a user-facing change?