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]: 标签右侧的数字显示存在错误,会显示NaN;标签面板显示待完善,各级长标签建议都可换行显示,部分标签和统计数字没有空格间隔 #504

Closed
2 of 3 tasks
whong1618 opened this issue Apr 3, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@whong1618
Copy link

whong1618 commented Apr 3, 2024

Bug Description | BUG 描述

Thino版本已更新到最新的2.3.56,然后发现标签右侧的数字显示,存在错误:

父级标签很多显示 NaN,

另外,我刚才尝试了一下,好像知道问题的原因了:

如果父级标签,最开始以独立标签出现过,独立标签的处理逻辑是可行的,那么这个标签就拥有了数字类型的计数记录,后面如果子标签使用这个父级标签,会给这个父级标签增1,父级标签的统计就不会出现问题。

如果父级标签之前从来没有作为独立标签出现过,那么后期,当该父级标签在多级标签中首次出现时,统计时会因为出现在多级标签中而执行增加计数的操作,但是由于之前该父级标签的统计计数变量没有赋值过,所以是undefined,那么对undefined与数字相加,结果会是NaN,之后再将对这个NaN执行加1操作,结果都仍然会是NaN,也就导致没有一开始就以独立标签出现过的父级标签的标签计数统计结果都显示为NaN。

增加一个逻辑,给所有第一次出现的标签,不管是作为独立标签,还是作为多级标签中的各级标签,都给一个初始值1,这样也许可以解决问题,当然开发者也许有更好的处理办法。以上只是浅见,仅供参考。

标签面板显示待完善,各级长标签建议都可换行显示,
部分标签和统计数字之间会出现没有空格间隔,建议在实现各级标签都可以支持换行显示(同时保持层级关系)后,设置标签和统计数字之间至少保留一个空格来区隔。

希望开发者核实后,给与修复,谢谢!

Relevant Screenshot | 相关截图

No response

To Reproduce | 重现问题

No response

Obsidian Version | Obsidian 版本

1.5.11

Which editor are you using? (If applicable)

  • New Editor (WYSIWYG) | 新编辑器
  • Legacy Editor (Markdown) | 旧编辑器

Checklist

  • I updated to the latest version of the plugin. 我更新到了插件的最新版本。
@whong1618 whong1618 added the bug Something isn't working label Apr 3, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically...


Title: [Bug]: There is an error in the number display on the right side of the label: either NAN is displayed, or there is an error in the counting. The number of the parent label of the two sub-labels is actually 3.

@whong1618 whong1618 changed the title [Bug]: 标签右侧的数字显示,存在错误:不是显示 NAN,就是计数上存在错误,两个子标签的父级标签的数字显示居然时3 [Bug]: 标签右侧的数字显示,存在错误:不是显示 NaN,就是计数上存在错误,两个子标签的父级标签的数字显示居然时3 Apr 3, 2024
@whong1618 whong1618 changed the title [Bug]: 标签右侧的数字显示,存在错误:不是显示 NaN,就是计数上存在错误,两个子标签的父级标签的数字显示居然时3 [Bug]: 标签右侧的数字显示,存在错误:不是显示 NaN,就是计数上存在错误,两个子标签的父级标签的数字显示居然是3 Apr 3, 2024
@whong1618 whong1618 changed the title [Bug]: 标签右侧的数字显示,存在错误:不是显示 NaN,就是计数上存在错误,两个子标签的父级标签的数字显示居然是3 [Bug]: 标签右侧的数字显示存在错误,会显示NaN Apr 3, 2024
@whong1618 whong1618 changed the title [Bug]: 标签右侧的数字显示存在错误,会显示NaN [Bug]: 标签右侧的数字显示存在错误,会显示NaN;标签面板显示待完善,各级长标签建议都可换行显示,部分标签和统计数字没有空格间隔 Apr 3, 2024
@Quorafind
Copy link
Owner

已修复

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically...


It has been fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants