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]: Tag issues #505

Closed
2 of 3 tasks
whong1618 opened this issue Apr 3, 2024 · 9 comments
Closed
2 of 3 tasks

[Bug]: Tag issues #505

whong1618 opened this issue Apr 3, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@whong1618
Copy link

Bug Description | BUG 描述

Thino已更新到2.3.57,标签面板多级标签显示NaN问题有改善,但只改善了倒数第二级标签,往上各级标签依然会显示NaN:

截图说明:

【1】新创建一个多级标签的卡片,各级标签都是首次出现

测试的多级标签

【2】倒数第二级标签已经可以正常显示,但是往上各级标签依然显示 NaN

仍有问题的标签面板

【3】目前标签面板存在的显示不佳的地方及修改建议。

  • 【标签前面的 # 号,可以考虑去掉,多余占空间】
  • 【标签层级展开和收缩的开关建议设置在标签名前面】
  • 【长标签,在保持标签层级结构不变的情况下,建议自动换行】
  • 【标签和统计数字之间,至少保持一个空格】

比较完善的标签面板式样,建议参考下图:

完善的标签面板

希望开发者对于以上问题,予以完善,谢谢!

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]: After updating to 2.3.57, the problem of NaN displayed on multi-level labels in the label panel has been improved, but only the second to last level has been improved. Labels at all levels above will still display NaN. In addition, the panel display needs to be improved!

@Quorafind Quorafind changed the title [Bug]: 更新2.3.57后,标签面板多级标签显示NaN问题有改善,但只改善了倒数第二级,往上各级标签依然会显示NaN,另外面板显示有待改善! [Bug]: Tag issues Apr 3, 2024
@juestchaos
Copy link
Collaborator

内容2已经修复了
反击内容1是否有实际案例,看来更像是较为边界的极限情况

@Issues-translate-bot
Copy link

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


Content 2 has been fixed
Is there any actual case for counterattack content 1? It seems more like a borderline extreme situation.

@Quorafind
Copy link
Owner

计数问题已经修复,样式稍作修改,但部分建议不考虑采纳

1、标签如果没有前边的图案,在设计上和筛选器没有统一的设计风格,会显得很怪异;
2、同上,放置在前边的折叠按钮并不是最优解,Obsidian 是因为不需要标签图案作为设计风格,所以其折叠按钮能放在前边
3、4 采纳

@Issues-translate-bot
Copy link

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


The counting problem has been fixed and the style has been slightly modified, but some suggestions will not be considered for adoption.

  1. If the label does not have a pattern in front of it, and the design does not have a unified design style with the filter, it will look weird;
  2. Same as above, placing the fold button in the front is not the optimal solution. Obsidian does not need a label pattern as a design style, so its fold button can be placed in the front.
    3, 4 adopted

@whong1618
Copy link
Author

内容2已经修复了 反击内容1是否有实际案例,看来更像是较为边界的极限情况

我不同意你说的这个属于较为边界的极限情况!
道理很简单:
【当我是一个Thino的新用户,或者我开始记录一些关于新知识的笔记时,会很容易出现使用之前未使用过的多级标签来记新笔记的情况!】

对于用户来说,使用之前未使用过的多级标签的情况是很常见的,不会是极限边界问题。

其实标签右侧的统计数字显示为NaN的原因很简单,就是对于任何首次出现的标签,不管是作为独立标签,还是作为多级标签中的某一级,其对应统计变量正确声明并赋值为1的处理环节不够完善。

如果缺少了对首次出现标签的对应统计变量声明并赋值为数字1的操作,那么标签对应的统计数字变量会是undefined的状态,
那么当该标签后面再次出现时,会对这个 undefined 的变量执行加1的操作,这会导致出现 NaN 的结果,后面不管怎么执行加法操作,结果都是 NaN,在JavaScript里面就会这样嘛。

只要面对任何首次出现的标签的初始化工作做好了,赋予了对应的记录次数的统计变量的正确数值,后续该标签再出现时的统计数字相应增加的计算,才会正常,从而避免出现 NaN的错误显示。

@Issues-translate-bot
Copy link

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


Content 2 has been fixed. Is there any actual case for counterattack content 1? It seems more like a borderline extreme case.

I don't agree with what you said, this is a relatively borderline extreme situation!
The reason is simple:
[When I am a new user of Thino, or I start to record some notes about new knowledge, it is easy to use multi-level tags that have not been used before to record new notes! 】

It is common for users to use multi-level tags that have not been used before and will not be a boundary issue.

In fact, the reason why the statistics on the right side of the label are displayed as NaN is very simple. That is, for any label that appears for the first time, whether as an independent label or as a certain level of multi-level labels, the corresponding statistical variable is correctly declared and assigned a value of 1. The processing links are not perfect enough.

If there is no operation to declare and assign the corresponding statistical variable to the number 1 for the first occurrence of the label, then the statistical variable corresponding to the label will be in an undefined state.
Then when the tag appears again, the undefined variable will be incremented by 1, which will result in a NaN result. No matter how the addition operation is performed later, the result will be NaN. This is what happens in JavaScript.

As long as the initialization work for any label that appears for the first time is done well, and the correct value of the statistical variable of the corresponding number of records is assigned, the subsequent calculation of the corresponding increase in statistics when the label appears again will be normal, thereby avoiding NaN error display.

@whong1618
Copy link
Author

计数问题已经修复,样式稍作修改,但部分建议不考虑采纳

1、标签如果没有前边的图案,在设计上和筛选器没有统一的设计风格,会显得很怪异; 2、同上,放置在前边的折叠按钮并不是最优解,Obsidian 是因为不需要标签图案作为设计风格,所以其折叠按钮能放在前边 3、4 采纳

已经更新到最新的2.3.58,修复速度感人,感谢!

@Issues-translate-bot
Copy link

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


The counting problem has been fixed and the style has been slightly modified, but some suggestions will not be considered for adoption.

  1. If the label does not have a pattern in front, the design will not be consistent with the filter, and it will look weird; 2. Same as above, the fold button placed in the front is not the optimal solution. Obsidian does not need a label pattern. As a design style, the folding button can be placed on the front 3 or 4.

It has been updated to the latest 2.3.58, the repair speed is impressive, thank you!

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

4 participants