Skip to content

fix(admin): improve comment filter select readability#962

Merged
imaegoo merged 1 commit into
twikoojs:mainfrom
wyf027:fix/admin-comment-filter-style
May 28, 2026
Merged

fix(admin): improve comment filter select readability#962
imaegoo merged 1 commit into
twikoojs:mainfrom
wyf027:fix/admin-comment-filter-style

Conversation

@wyf027

@wyf027 wyf027 commented May 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #156

  • Center the comment search filter row (justify-content: center)
  • Add semi-transparent background to the filter type <select> so white text remains readable on the admin panel

Test plan

  • Open admin → Comment tab
  • Verify filter row is centered and select label text is readable

Summary by Sourcery

改进管理员评论筛选器的界面,以获得更好的对齐和可读性。

增强内容:

  • 将管理员评论筛选器所在的行在其容器内居中对齐。
  • 为评论筛选类型选择框应用半透明深色背景,以确保在管理面板上白色文本仍然清晰可读。
Original summary in English

Summary by Sourcery

Improve the admin comment filter UI for better alignment and readability.

Enhancements:

  • Center the admin comment filter row within its container.
  • Apply a semi-transparent dark background to the comment filter type select to keep white text legible on the admin panel.

Center the comment search filter row and give the type select a
semi-transparent background so white label text stays readable.

Fixes #156

Co-authored-by: Cursor <cursoragent@cursor.com>
@sourcery-ai

sourcery-ai Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor
审阅者指南(在较小的 PR 上折叠显示)

审阅者指南

将后台评论过滤行居中,并将筛选类型的下拉框背景设置为半透明,以提高在深色后台面板上的标签可读性。

更新后的后台评论筛选布局与样式流程图

flowchart LR
  AdminPanel --> CommentTab
  CommentTab --> FilterRow
  FilterRow --> FilterSelect

  classDef centered fill:#eef,stroke:#333,stroke-width:1px
  classDef readable fill:#efe,stroke:#333,stroke-width:1px

  class FilterRow centered
  class FilterSelect readable

  %% Key changes
  %% FilterRow: justify-content set to center
  %% FilterSelect: background-color set to rgba(0,0,0,0.2) for readability
Loading

文件级变更说明

变更 详情 文件
将后台评论视图中的评论筛选控件居中。
  • 将筛选容器的 flexbox 对齐方式从 flex-start 更新为 center,以在水平方向上居中筛选行内容。
src/client/view/components/TkAdminComment.vue
提高评论筛选类型下拉框标签的可读性。
  • 将下拉选择元素的样式从无背景改为半透明深色背景,以便白色文字在后台面板上保持可读。
src/client/view/components/TkAdminComment.vue

与关联 issue 的对照评估

Issue 目标 是否已解决 说明
#156 修复后台面板中评论搜索分类下拉框的字体颜色 / 可读性问题。
#156 按参考图片,在后台面板中将评论搜索筛选行居中。

使用技巧与命令

与 Sourcery 交互

  • 触发新的代码审阅: 在 pull request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub issue: 通过回复某条审阅评论,请求 Sourcery 从该评论创建 issue。你也可以直接回复该评论 @sourcery-ai issue 来从中创建 issue。
  • 生成 pull request 标题: 在 pull request 标题的任意位置写上 @sourcery-ai,即可随时生成标题。你也可以在 pull request 中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成 pull request 摘要: 在 pull request 正文的任意位置写上 @sourcery-ai summary,即可在你想要的位置随时生成 PR 摘要。你也可以在 pull request 中评论 @sourcery-ai summary 来(重新)生成摘要。
  • 生成审阅者指南: 在 pull request 中评论 @sourcery-ai guide,即可随时(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在 pull request 中评论 @sourcery-ai resolve,即可一次性解决所有 Sourcery 评论。如果你已经处理了所有评论且不想再看到它们,这会很有用。
  • 忽略所有 Sourcery 审阅: 在 pull request 中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审阅。若你想从头开始一次新的审阅,这尤其有用——别忘了评论 @sourcery-ai review 来触发新的审阅!

自定义你的使用体验

访问你的 控制面板 来:

  • 启用或禁用审阅功能,例如 Sourcery 自动生成的 pull request 摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、移除或编辑自定义审阅指令。
  • 调整其他审阅相关设置。

获取帮助

Original review guide in English
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Centers the admin comment filter row and makes the filter type select background semi-transparent to improve label readability on the dark admin panel.

Flow diagram for updated admin comment filter layout and styling

flowchart LR
  AdminPanel --> CommentTab
  CommentTab --> FilterRow
  FilterRow --> FilterSelect

  classDef centered fill:#eef,stroke:#333,stroke-width:1px
  classDef readable fill:#efe,stroke:#333,stroke-width:1px

  class FilterRow centered
  class FilterSelect readable

  %% Key changes
  %% FilterRow: justify-content set to center
  %% FilterSelect: background-color set to rgba(0,0,0,0.2) for readability
Loading

File-Level Changes

Change Details Files
Center the comment filter controls in the admin comment view.
  • Update flexbox justification on the filter container from flex-start to center to horizontally center the filter row contents.
src/client/view/components/TkAdminComment.vue
Improve readability of the comment filter type select label.
  • Change the select element styling from no background to a semi-transparent dark background color so white text remains readable against the admin panel.
src/client/view/components/TkAdminComment.vue

Assessment against linked issues

Issue Objective Addressed Explanation
#156 Fix the font color/readability issue of the comment search category select in the admin panel.
#156 Center the comment search filter row in the admin panel as shown in the provided reference image.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - 我给出了一些高层次的反馈:

  • 使用 justify-content: center 来让整个过滤行居中,可能会在较窄视口下减少可用空间或导致对齐不自然;可以考虑只对特定元素进行居中,或者通过设置外边距来实现,这样在不同屏幕尺寸下布局会更好地伸缩。
  • background: none 改为 background-color: rgba(0, 0, 0, 0.2) 时,如果在其他地方使用了与背景相关的简写属性,可能会出现不同行为;请确认这个 select 不依赖背景图像或渐变,并确保这项改动不会意外叠加在已有背景之上。
  • 使用半透明的深色背景配合白色文字可以提升可读性,但建议快速检查一下在管理面板的不同主题或状态(例如 hover/禁用)下的颜色对比度,以确保在所有情况下都保持良好的可访问性。
面向 AI 代理的提示
Please address the comments from this code review:

## Overall Comments
- Centering the entire filter row with `justify-content: center` may reduce usable space or cause awkward alignment on narrow viewports; consider constraining centering to specific elements or using margins so the layout scales better across screen sizes.
- Switching from `background: none` to `background-color: rgba(0, 0, 0, 0.2)` may behave differently if other background-related shorthand properties are applied elsewhere; confirm this select doesn’t rely on background images or gradients and that this change doesn’t inadvertently layer on top of an existing background.
- The semi-transparent dark background with white text improves readability, but you might quickly verify color contrast against the admin panel’s various themes or states (e.g., hover/disabled) to ensure it remains accessible in all cases.

Sourcery 对开源项目是免费的——如果你喜欢我们的审查,请考虑分享 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据这些反馈来改进对你代码审查的质量。
Original comment in English

Hey - I've left some high level feedback:

  • Centering the entire filter row with justify-content: center may reduce usable space or cause awkward alignment on narrow viewports; consider constraining centering to specific elements or using margins so the layout scales better across screen sizes.
  • Switching from background: none to background-color: rgba(0, 0, 0, 0.2) may behave differently if other background-related shorthand properties are applied elsewhere; confirm this select doesn’t rely on background images or gradients and that this change doesn’t inadvertently layer on top of an existing background.
  • The semi-transparent dark background with white text improves readability, but you might quickly verify color contrast against the admin panel’s various themes or states (e.g., hover/disabled) to ensure it remains accessible in all cases.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Centering the entire filter row with `justify-content: center` may reduce usable space or cause awkward alignment on narrow viewports; consider constraining centering to specific elements or using margins so the layout scales better across screen sizes.
- Switching from `background: none` to `background-color: rgba(0, 0, 0, 0.2)` may behave differently if other background-related shorthand properties are applied elsewhere; confirm this select doesn’t rely on background images or gradients and that this change doesn’t inadvertently layer on top of an existing background.
- The semi-transparent dark background with white text improves readability, but you might quickly verify color contrast against the admin panel’s various themes or states (e.g., hover/disabled) to ensure it remains accessible in all cases.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@imaegoo imaegoo merged commit 305864e into twikoojs:main May 28, 2026
1 check passed
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.

[bug] 管理面板的搜索评论类别样式问题

2 participants