wnr icon indicating copy to clipboard operation
wnr copied to clipboard

Add preset time dropdowns for work, rest, and loop durations

Open mingzhi2004 opened this issue 8 months ago • 4 comments

Add preset time dropdowns for work, rest, and loop durations

截屏2025-04-20 21 00 33

Overview

This PR introduces a new user interface improvement to wnr that allows users to quickly select common time durations through dropdown menus with a scrollable interface, rather than manually typing values each time.

Features

  • Added preset time dropdowns for work sessions, rest sessions, and loop counts
  • Implemented a scrollable dropdown menu for better UX when many presets are available
  • Styled dropdowns to match the existing application design language
  • Color-coded dropdowns to match their respective functions (work=red, rest=blue, onlyRest=purple)
  • Added hover effects for better visual feedback

UI Changes

  • Small dropdown toggle buttons next to time input fields
  • Dropdown menus appear on click with preset time values
  • Scrollable dropdown menus that can accommodate multiple options
  • Consistent styling with the rest of the application

mingzhi2004 avatar Apr 20 '25 13:04 mingzhi2004

Two issues to mention:

  1. Must fix: it does not support multi-languages.
  2. Shall better fix: the scroll-down list does not support dark mode.

RoderickQiu avatar Apr 21 '25 03:04 RoderickQiu

Quality Gate Failed Quality Gate failed

Failed conditions
7.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

sonarqubecloud[bot] avatar Apr 21 '25 04:04 sonarqubecloud[bot]

I have fixed the problem and it could now support multi-language.

mingzhi2004 avatar Apr 21 '25 06:04 mingzhi2004

Feedbacks:

  1. Now your new commits introduce new bugs. If you click option+command+i will see bugs happening.
  2. And your way of localization is not preferred, that it hard-coded strings inside the code. All strings referred must only be located in locales/*.json and you must have no redundant strings inside it. And although that is not the case right now, but let's imagine we are having the fourth type of localization support and your current code will not work in this way.
  3. In theme.js, you just created new darkmode support, which is redundant. Look at the code below you will find that. If you use AI, you must recheck that you are not introducing unnecessary changes and revert them using your git.

RoderickQiu avatar Apr 21 '25 11:04 RoderickQiu