Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug report] Time UI not refresh #6

Closed
Kyle-Ye opened this issue Dec 8, 2021 · 3 comments
Closed

[Bug report] Time UI not refresh #6

Kyle-Ye opened this issue Dec 8, 2021 · 3 comments

Comments

@Kyle-Ye
Copy link

Kyle-Ye commented Dec 8, 2021

Describe the bug
第二天到来时昨天创建的OKJSON 窗口标签仍为"今天 XX:YY"

会导致无法分辨昨天"XX:YY"时刻和今天"XX:YY"时刻创建的窗口

因为调查一个前端数据流问题可能一天无法解决,一般都是问题未解决前长期把这个OKJSON窗口留着

To Reproduce
Steps to reproduce the behavior:

  1. 在某天的XX:YY时刻创建OKJSON窗口
  2. 等待第二天到来
  3. UI显示仍为"今天 XX:YY"

Expected behavior
UI显示为"昨天 XX:YY"或者具体的日期
建议昨天和今天为特殊case,其他时间段直接显示具体的日期即可

Screenshots

11:02分截屏
截屏2021-12-08 11 02 10

Additional context

  1. 感觉代码上肯定是用的"Date()",确实记录了日期,但是没有一个好的时机来刷新窗口,不知道macOS有没有这样一个日期变化的通知
  2. 遍历所有窗口更新时间标签的代价感觉不是很大,可否考虑在新建窗口/标签页时刷新时间标签UI(Model仍为原有记录时间)
@francisfeng
Copy link
Collaborator

原来的窗口名称都是OK JSON,窗口超过一个后就没办法区分,所以最近的新版本使用了创建窗口时的相对时间来区分,实际上窗口不关联任何日期。

这个实现确实没有考虑到隔日后的问题,不过OK JSON也提供了手动更新窗口标题的方法:选中根节点后按下回车键,输入值会成为窗口的新标题。

如果想要更好的区分,应该手动更新标题。

@Kyle-Ye
Copy link
Author

Kyle-Ye commented Dec 8, 2021

原来的窗口名称都是OK JSON,窗口超过一个后就没办法区分,所以最近的新版本使用了创建窗口时的相对时间来区分,实际上窗口不关联任何日期。

这个实现确实没有考虑到隔日后的问题,不过OK JSON也提供了手动更新窗口标题的方法:选中根节点后按下回车键,输入值会成为窗口的新标题。

如果想要更好的区分,应该手动更新标题。

Got到了,之前完全不知道这个功能

不过如果使用的相对时间,那这个"今天 11:26"中的今天感觉是不是就多余了,因为所有都只会是今天,不会出现更新成昨天的case

@francisfeng
Copy link
Collaborator

这里用的是DateFormatter,没去考虑那么多,都是系统处理的。

后续我看看怎么优化吧。

@Kyle-Ye Kyle-Ye closed this as completed Dec 8, 2021
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

No branches or pull requests

2 participants