Skip to content

修复 My Usage 日期范围筛选多余分隔符#813

Merged
ding113 merged 2 commits intoding113:devfrom
tesgth032:fix/my-usage-date-range-separator
Feb 22, 2026
Merged

修复 My Usage 日期范围筛选多余分隔符#813
ding113 merged 2 commits intoding113:devfrom
tesgth032:fix/my-usage-date-range-separator

Conversation

@tesgth032
Copy link
Contributor

@tesgth032 tesgth032 commented Feb 21, 2026

Summary

Remove the redundant vertical separator between quick period buttons and date navigation in LogsDateRangePicker component to fix visual layout issues when the component wraps to multiple lines.

Problem

In the My Usage page, non-admin users experience a visual layout issue with the date range picker:

  • When the date range picker component wraps to two lines due to limited horizontal space, the vertical separator (<div className="h-6 w-px bg-border mx-1" />) between the quick period buttons and the date navigation section appears as an orphaned vertical line
  • This creates poor visual appearance and confused UI structure

Related Issues:

  • Related to 页面优化建议 #766 - Page optimization suggestions (general UI compactness improvements for logs page)

Solution

Remove the separator element entirely. The spacing between the two sections is maintained by the parent container's gap-2 class, so the separator is purely decorative and unnecessary.

Changes Made

  • File: src/app/[locale]/dashboard/logs/_components/logs-date-range-picker.tsx
  • Change: Removed 3 lines (the separator div and its comment)

Impact Assessment

Aspect Change
Visual appearance Cleaner layout when component wraps
Functionality No change
Accessibility No change
Breaking changes None

Testing

Manual Testing Checklist

  • Verify date range picker displays correctly on desktop (single row)
  • Verify date range picker displays correctly on smaller screens (wrapped layout)
  • Verify no visual regression in quick period button spacing
  • Verify no visual regression in date navigation spacing
  • Verify all functionality (period selection, date navigation, calendar popup) works correctly

Screenshots

Before: The separator line appears between quick buttons and navigation, creating an orphaned vertical line when wrapped.

After: Clean separation without the orphaned separator line.

Related Work


Description enhanced by Claude AI

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @tesgth032, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求旨在通过移除一个不必要的 UI 元素来优化用户界面,从而提升用户体验。具体来说,它修复了日期范围选择器在特定布局下显示多余分隔符的视觉缺陷,确保了界面的整洁和一致性,而没有引入任何业务逻辑上的变更。

Highlights

  • UI 问题修复: 解决了非管理员权限的个人用户在 My Usage 页面使用日期范围筛选时,组件换行后出现多余垂直分隔符的问题。
  • 代码修改: 移除了 LogsDateRangePicker 组件中快捷选择区与日期导航区之间的分隔符,以避免在换行布局下出现视觉上的“孤立”分隔线。
Changelog
  • src/app/[locale]/dashboard/logs/_components/logs-date-range-picker.tsx
    • 移除了一个多余的 UI 分隔符,以解决在特定布局下出现的视觉问题。
Activity
  • 此拉取请求尚未有任何评论或审查活动。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link

coderabbitai bot commented Feb 21, 2026

📝 Walkthrough

Walkthrough

从日志日期范围选择器组件中删除了快速周期按钮与导航/日期显示之间的竖直分隔符元素。仅移除了UI视觉元素,无功能行为变化。

Changes

Cohort / File(s) Summary
UI 分隔符移除
src/app/[locale]/dashboard/logs/_components/logs-date-range-picker.tsx
删除了一个竖直分隔符 div 元素及相关注释,该元素位于快速周期按钮和日期导航区域之间。无状态、事件处理或控制流变化。

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed 拉取请求的描述清楚地说明了问题(换行时多余分隔符的布局问题)、解决方案(移除分隔符元素)和影响范围。
Title check ✅ Passed 标题准确反映了主要变更内容,清晰描述了移除多余分隔符这一核心改动。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size/XS Extra Small PR (< 50 lines) bug Something isn't working area:UI labels Feb 21, 2026
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code Review Summary

No significant issues identified in this PR. The change is a clean, focused UI fix that removes an isolated separator line causing visual issues when the component wraps on smaller screens.

PR Size: XS

  • Lines changed: 3 (deletions only)
  • Files changed: 1

Review Coverage

Perspective 1: Comment Analyzer (Documentation Police)

  • Comments reviewed - The removed // Separator comment accurately described the removed element. Remaining comments ("Quick period buttons", "Navigation and date display") remain accurate.

Perspective 2: Test Analyzer (Coverage Guardian)

  • Test coverage adequate - Pure UI/layout change with no functional impact. No new tests required for visual-only modifications.

Perspective 3: Silent Failure Hunter (Error Expert)

  • Error handling reviewed - No error handling code present in the diff. The removed element was purely presentational (a visual separator div) with no associated logic.

Perspective 4: Type Design Auditor (Structure Architect)

  • Type safety verified - No TypeScript types were modified in this change.

Perspective 5: General Code Reviewer (Standard Keeper)

  • Logic and correctness - No logic changes. The fix correctly addresses the UI issue where the separator appears isolated when wrapping.
  • Security (OWASP Top 10) - No security implications. Removed element had no user-input handling.
  • Standards compliance - Change aligns with CLAUDE.md guidelines. No emoji, follows existing patterns.
  • Performance - Removing a DOM element slightly improves performance (negligible but positive).

Perspective 6: Code Simplifier (Refactoring Coach)

  • Code clarity - The removal simplifies the component structure. The parent container's gap-2 class already provides appropriate spacing between sections.

Detailed Analysis

Change: Removed a vertical separator (<div className="h-6 w-px bg-border mx-1" />) between quick period buttons and date navigation controls.

Rationale: When the component wraps to multiple lines on smaller screens (particularly for non-admin users on the My Usage page), the separator would appear isolated on its own line, creating a poor visual experience.

Impact:

  • Visual spacing maintained through the parent container's gap-2 utility class
  • No functional changes to date range selection or navigation
  • Cleaner responsive behavior

Validation Checklist

  • Issue exists in NEW code (not pre-existing) - N/A, this is a fix
  • Can point to exact problematic line - Lines 182-184 removed
  • Can quote violated guideline/principle - N/A, no violations
  • Issue is not over-engineering - Simple, focused fix
  • Not a pre-existing issue - Change addresses current UI problem
  • Not linter-catchable - Visual/layout issue
  • Not outside diff scope - All changes within diff

Automated review by Claude AI

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

这个 PR 旨在解决 My Usage 页面在日期范围筛选组件换行时出现的多余分隔符问题。通过移除 LogsDateRangePicker 组件中的分隔符 div 来实现。这是一个直接有效的修复。我有一个建议,可以在保留桌面端视图的分隔符的同时,修复换行问题,请查看具体评论。

</div>

{/* Separator */}
<div className="h-6 w-px bg-border mx-1" />
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

直接移除分隔符虽然解决了换行时的布局问题,但也失去了在桌面端视图中的视觉分组效果。考虑到此 PR 尚未完成,建议采用响应式设计,在小屏幕上隐藏分隔符,从而两全其美。这样可以在修复布局问题的同时,保留在桌面视图下的 UI 设计。

更进一步,为了与项目 UI 组件保持一致,可以考虑使用 Separator 组件并应用相同的响应式类,例如:

<Separator orientation="vertical" className="h-6 mx-1 hidden sm:block" />

这需要从 @/components/ui/separator 导入。我提供的代码建议是直接修改 div,这是一个侵入性更小的改动。

Suggested change
<div className="h-6 w-px bg-border mx-1" />
<div className="h-6 w-px bg-border mx-1 hidden sm:block" />

@tesgth032 tesgth032 changed the title 修复 My Usage 日期范围筛选多余分隔符 [未完成] 修复 My Usage 日期范围筛选多余分隔符 Feb 21, 2026
@ding113 ding113 merged commit bd78861 into ding113:dev Feb 22, 2026
13 of 17 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in Claude Code Hub Roadmap Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI bug Something isn't working size/XS Extra Small PR (< 50 lines)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants