Skip to content

Slice 4: 自定义时长输入 1-120 分钟数字输入框 #5

Description

@Znfooe

Parent

#1 feat: 睡眠定时器 (Sleep Timer)

What to build

在 Popover 中增加自定义时长输入框,允许用户输入 1-120 分钟之间的任意数值。

端到端路径:

  1. 主进程 — SleepTimerService 参数校验:

    • start() 校验 durationMinutes 范围:1 ≤ n ≤ 120
    • 超出范围时 reject / throw 错误,IPC 层返回错误信息给 UI
  2. UI — 自定义输入组件:

    • 预设按钮组下方增加一行:[ 数字输入框 ] 分钟
    • 输入框 placeholder 显示 "自定义(1-120)"
    • 输入框旁边有"分钟"单位标签
    • 输入范围限制(HTML min/max 或 onChange 校验)
    • 输入后回车或点击确认按钮启动定时器
    • 已有运行中的定时器时输入框禁用或提示先取消

Acceptance criteria

  • 能输入 1-120 之间的任意整数作为定时器时长
  • 输入超出范围时有明确提示(不接受无效值)
  • 自定义输入和预设按钮互斥(选一种方式启动即可)
  • 启动后输入框状态正确更新(禁用/重置)

Blocked by

#2 (Slice 1: MVP 核心定时器)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, AFK-ready an agent can pick it up with no human context

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions