Skip to content

fix(web): click anywhere on datetime input to open picker#330

Open
Molly-3000 wants to merge 2 commits into
mainfrom
fix/web-log-timepicker
Open

fix(web): click anywhere on datetime input to open picker#330
Molly-3000 wants to merge 2 commits into
mainfrom
fix/web-log-timepicker

Conversation

@Molly-3000

Copy link
Copy Markdown
Collaborator

Safari only opens the native date picker when clicking the calendar icon. Add onClick showPicker() so the entire input area is clickable.

Safari only opens the native date picker when clicking the calendar icon.
Add onClick showPicker() so the entire input area is clickable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

👋 感谢提交 PR @Molly-3000!维护者会尽快 review。

提交前请确认:

  • CI 全绿(test / lint / build)
  • 改动聚焦单一主题,便于审阅
  • 若改动了依赖(lockfile / pyproject.toml / package.json),需维护者评论 /allow-dependencies-change <当前 head SHA> 放行(之后再 push 需重新放行)

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

PR #330: fix(web): click anywhere on datetime input to open picker

作者: Molly-3000
范围: fix/web-log-timepicker → main

修改方案

ActivityFeed 的时间范围筛选器用了两个原生 <input type="datetime-local">(since 起点、before 终点)。原生 datetime 输入默认只有点右侧那个小日历图标才弹系统选择器,点输入框其它区域不弹,用户很容易点空。本 PR 给两个输入框各加一个 onClick,点击时主动调浏览器原生的 showPicker() 强制弹出,于是点输入框任意位置都能打开(ActivityFeed.tsx#L405#L435)。

相比上一轮 review 的版本,作者新增了第二个 commit ed7090f,把上一轮 ci-bot 提的两条 🔵 建议都修了:

  1. 旧浏览器降级守卫showPicker 调用改用可选链 e.currentTarget.showPicker?.()——旧内核上 showPickerundefined 时短路跳过,不再抛 TypeError(日历图标仍可弹)。
  2. 恢复无关注释删除:上一版顺手删掉的 before 输入框 onChange/onBlur 两条 UX 意图注释(// 清空后回到"至现在"按钮// 失焦时如果还是空值,退回按钮态...)已恢复,scope 重新聚焦到单一主题。

净 diff 仅 2 行新增。fmt 格式化、parseNaN 当清空、onBlur 退回按钮态等既有行为全部保持不变。

上一轮 ci-bot 问题核对

上轮问题 状态
🔵 showPicker() 在旧浏览器抛 TypeError ✅ 已修复(改用 showPicker?.() 可选链守卫)
🔵 顺手删掉两条无关注释(scope creep) ✅ 已修复(注释已恢复,见 L433 / L437)

问题

无新问题。

结论

LGTM — 改动小而聚焦,核心交互正确;上一轮 ci-bot 的两条 🔵 建议均已在 commit ed7090f 中修复,既有的格式化/解析/状态退回逻辑未受影响。


由 review-pr skill v1.6 生成

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@CLAassistant

CLAassistant commented Jun 23, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@yangbaofu007

Copy link
Copy Markdown
Collaborator

@Molly-3000 Please sign CLA

@HCl8 HCl8 requested a review from yangbaofu007 June 24, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants