Skip to content

The sorting of fields in the database attribute panel is unstable #12043

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

Closed
3 tasks done
QMike0 opened this issue Jul 21, 2024 · 6 comments
Closed
3 tasks done

The sorting of fields in the database attribute panel is unstable #12043

QMike0 opened this issue Jul 21, 2024 · 6 comments
Assignees
Labels
Milestone

Comments

@QMike0
Copy link

QMike0 commented Jul 21, 2024

数据库属性面板存在的一些问题

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

  1. 重复退出/进入数据库属性面板,会发现各数据库属性条目会随机排序,无法按照数据库中的排序固定好
    recording
  2. 数据库属性面板的资源列中,既无法点击已添加好的“链接”,也无法添加更多资源
    recording
  3. 数据库属性面板的链接列中,修改链接后无法立刻切换,点击链接后仍会跳转到修改前的旧链接。必须要关闭属性面板重新打开后才能跳转新链接。
    recording

Expected result

对上述各条的Expected result如下:

  1. 数据库属性面板的各条目固定好排序不要乱动;另外应按照数据库表格视图手动调整的条目顺序自动改变排序,例如手动拖动db中各列顺序从左向右为A, C, E, B, D,那么在链接该数据库的文档/内容块的数据库属性面板中,属性条目从上向下的顺序也应变为A, C, E, B, D,并且是只要db表格各列顺序有变化,相应文档/内容块的数据库属性面板的各条目排序也应随之变化,而非根据初始创建db时各列的顺序就不变了
  2. 数据库属性面板的资源列也应像其他类型列一样,支持添加,也支持资源(例如链接)的点击和跳转
  3. 数据库属性面板的链接列中修改链接后,点击应能跳转到新链接,而非修改前的旧链接。这一点其实在数据库表格视图中可以实现。

总之,应保持数据库属性面板与数据库表格视图交互逻辑的统一,为后续这个issue的实现做准备
PS:催一波编辑器顶部添加数据库属性面板的进程

Screenshot or screen recording presentation

No response

Version environment

- Version: 3.1.1
- Operating System: Windows
- Browser (if used):

Log file

siyuan.log

More information

No response

@TCOTC
Copy link
Contributor

TCOTC commented Jul 21, 2024

只要db表格各列顺序有变化,相应文档/内容块的数据库属性面板的各条目排序也应随之变化,而非根据初始创建db时各列的顺序就不变了

这个方案是有问题的,所以 #11428 将视图和属性面板的排序分离了

重复退出/进入数据库属性面板,会发现各数据库属性条目会随机排序,无法按照数据库中的排序固定好

新建的数据库可以复现这个问题。@88250

而且这样看就很明显是在变的:

default.mp4

数据库属性面板的链接列中,修改链接后无法立刻切换,点击链接后仍会跳转到修改前的旧链接。必须要关闭属性面板重新打开后才能跳转新链接。

确实有这个问题。@88250

修改链接后,点击应能跳转到新链接,而非修改前的旧链接。这一点其实在数据库表格视图中可以实现。

@QMike0 这是指什么?表格视图修改链接是及时生效的

数据库属性面板的资源列也应像其他类型列一样,支持添加,也支持资源(例如链接)的点击和跳转

拆分到 #12044

@QMike0
Copy link
Author

QMike0 commented Jul 21, 2024

@QMike0 这是指什么?表格视图修改链接是及时生效的

就是指“数据库属性面板的链接列中,修改链接后无法立刻切换,点击链接后仍会跳转到修改前的旧链接。必须要关闭属性面板重新打开后才能跳转新链接”,而表格视图的链接列不存在该问题

这个是有问题的,所以 #11428 将视图和属性面板的排序分离了

这一点我的想法是,排序应该支持表格视图-->属性面板单向的变化。也就是表格视图的各列顺序变化要能导致属性面板各条目的排序跟着改变,但属性面板中不应支持手动改变排序,这样就能避免那个issue的问题。
手动改变表格视图各列顺序的目的就是为了更好地查看属性信息,排序的改变应该是统一的,否则需要在属性面板中一个一个单独调各条目顺序太难受了

@TCOTC
Copy link
Contributor

TCOTC commented Jul 21, 2024

数据库是有多个视图的,每个视图的排序都不同(而且还能隐藏字段),所以属性面板也是单独排序

@TCOTC
Copy link
Contributor

TCOTC commented Jul 21, 2024

不过如果要让属性面板跟某个表格视图的排序同步,我觉得也不是不能做。给个下拉菜单切换就行了 #12045

@QMike0
Copy link
Author

QMike0 commented Jul 21, 2024

不过如果要让属性视图跟某个表格视图的排序同步,我觉得也不是不能做。给个下拉菜单切换就行了 #12045

1,好主意

新建的数据库可以复现这个问题。@88250

我又测试了一下,不用新建数据库,只要向已有的数据库中添加新文档,然后打开这个新文档进入它的属性面板,就能复现这个问题,此时进入该数据库其他文档的属性面板也是如此。如果只是打开该数据库早先前添加的文档,属性面板中的各条目排序是固定住的,必须要先打开这个新添加的文档才行

@88250
Copy link
Member

88250 commented Sep 4, 2024

@88250 88250 self-assigned this Sep 4, 2024
@88250 88250 changed the title 数据库属性面板存在的一些问题 The sorting of fields in the database attributes panel is not fixed Sep 4, 2024
@88250 88250 changed the title The sorting of fields in the database attributes panel is not fixed The sorting of fields in the database attribute panel is unstable Sep 4, 2024
@88250 88250 added the Bug label Sep 4, 2024
@88250 88250 added this to the 3.1.6 milestone Sep 4, 2024
88250 added a commit that referenced this issue Sep 4, 2024

Verified

This commit was signed with the committer’s verified signature.
gaborbernat Bernát Gábor
@88250 88250 closed this as completed Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants