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

Database-bound block primary key supports setting static anchor text #10049

Closed
Achuan-2 opened this issue Jan 2, 2024 · 31 comments
Closed

Database-bound block primary key supports setting static anchor text #10049

Achuan-2 opened this issue Jan 2, 2024 · 31 comments
Assignees
Milestone

Comments

@Achuan-2
Copy link
Member

Achuan-2 commented Jan 2, 2024

希望数据库的块引支持静态锚文本

In what scenarios do you need this feature?

比如我搞了一个TODO数据库,我先前已经建立了一个以文献标题命名的文档,我现在想要建立一个待办,阅读xx文献
但是目前的话,即使手动更改了数据库主键的块引锚文本,刷新之后,又会变为原来的文档标题
image
image

Describe the optimal solution

希望数据库的主键块引支持静态锚文本

Describe the candidate solution

No response

Other information

No response

@88250
Copy link
Member

88250 commented Jan 12, 2024

最新版已经屏蔽绑定块主键的右键菜单,暂时不考虑支持“静态锚文本”了,感谢提议。

@88250 88250 closed this as completed Jan 12, 2024
@88250
Copy link
Member

88250 commented Jan 12, 2024

补充一下:绑定块的主键渲染遵循动态锚文本渲染规则,即可以考虑使用块命名来改变此处的渲染。

@Achuan-2
Copy link
Member Author

Achuan-2 commented Jun 2, 2024

由于思源笔记的一个块可以属于多个数据库,有的时候就有一个需求——希望在不同数据库,这个块的命名是不同的
不支持修改锚文本的话其实挺难受的。
比如TODO这个数据库,我添加了一个todo《写一篇关于熬夜危害的博客》,将其转化为文档后,我可能就要对这个文档的标题设置为《熬夜的危害》。现在思源的机制,数据库里的这个块主键自动变为《熬夜的危害》,就不像一个TODO名称了,如果我把这个文档的命名设置为《写一篇关于熬夜危害的博客》,那之后我把这个文档又想添加到《博客》这个数据库里,想显示为《熬夜的危害》就会冲突

可以的话,还是非常希望数据库的块引也是支持静态锚文本的,这样会更加灵活

@Achuan-2
Copy link
Member Author

Achuan-2 commented Jun 2, 2024

建议

  1. 能否在绑定块的整个行的右键菜单添加「修改绑定块标题」呢?这个菜单里也有「取消绑定块」
    Clip_2024-06-02_17-06-28
  2. 能否支持静态锚文本的块引链接直接粘贴,绑定块主键显示为静态锚文本内容,不随着文档标题、命名而更改

@88250
Copy link
Member

88250 commented Jun 2, 2024

正如前面所说,绑定块后显示的是块的动态锚文本,无法支持单独设置内容。

@Achuan-2
Copy link
Member Author

Achuan-2 commented Jun 2, 2024

没办法兼容静态锚文本显示吗

@88250
Copy link
Member

88250 commented Jun 2, 2024

目前没有办法,我们先打开,后续有空再看看能否实现。

@88250 88250 reopened this Jun 2, 2024
@Achuan-2
Copy link
Member Author

Achuan-2 commented Jun 3, 2024

谢谢,辛苦🙇‍♂️

@Achuan-2
Copy link
Member Author

Achuan-2 commented Nov 3, 2024

发了一个投票帖子:https://ld246.com/article/1730621536283

@TCOTC
Copy link
Contributor

TCOTC commented Nov 8, 2024

@88250
Copy link
Member

88250 commented Dec 17, 2024

正如前面所说,绑定块后显示的是块的动态锚文本,无法支持单独设置内容。

现在已经单独实现了主键内容构建 getNodeAvBlockText,应该可以类似 icon 一样通过自定义属性实现静态锚文本存取。

@88250 88250 added this to the 3.1.17 milestone Dec 17, 2024
@TCOTC
Copy link
Contributor

TCOTC commented Dec 18, 2024

修改主键锚文本的交互应该怎么做?

@88250
Copy link
Member

88250 commented Dec 18, 2024

估计是右键弹菜单吧

@88250 88250 changed the title 希望数据库的块引支持静态锚文本 Database-bound block primary key supports setting static anchor text Dec 19, 2024
@TCOTC
Copy link
Contributor

TCOTC commented Dec 19, 2024

我感觉可以这样:如果在绑定块的条目的主键上右键,就在弹出的菜单顶上多加个锚文本输入框。

这样不会干扰到在其他字段右键,也很方便编辑

image

@SaXz2
Copy link

SaXz2 commented Dec 19, 2024

我觉得楼上的方案更好一点,右键菜单选项会多三四步,修改内容多了就有点繁琐了,如果可以像notion一样也行,不过考虑现在的文档块不支持链接或者块引用,不太好实现

@88250
Copy link
Member

88250 commented Dec 21, 2024

图标就不支持设置静态锚文本了,只有文档标题支持为不同的库设置不同的静态锚文本。

@88250
Copy link
Member

88250 commented Dec 22, 2024

还是直接编辑单元格吧,不用菜单了。

Vanessa219 added a commit that referenced this issue Dec 23, 2024
Vanessa219 added a commit that referenced this issue Dec 23, 2024
@TCOTC
Copy link
Contributor

TCOTC commented Dec 24, 2024

我这里好像还不行,控制台会报错

@88250
Copy link
Member

88250 commented Dec 24, 2024

开发环境下?贴一下报错

@TCOTC
Copy link
Contributor

TCOTC commented Dec 24, 2024

点击主键之后整个界面都动不了:

video.webm

image

@88250
Copy link
Member

88250 commented Dec 24, 2024

确实有问题,稍后解决。

Vanessa219 added a commit that referenced this issue Dec 24, 2024
@TCOTC
Copy link
Contributor

TCOTC commented Dec 24, 2024

主键锚文本能不能支持换行?

还有条目的复制块引用和复制 Markdown 链接时需要用静态锚文本(如果有的话)

@88250
Copy link
Member

88250 commented Dec 24, 2024

不支持换行;复制锚文本的问题稍后改进 @Vanessa219

@TCOTC
Copy link
Contributor

TCOTC commented Dec 24, 2024

不支持换行的原因是什么?

@TCOTC
Copy link
Contributor

TCOTC commented Dec 24, 2024

这里的逻辑还有点问题,用户只要误触一下就会变成静态锚文本了:

video.webm

@88250
Copy link
Member

88250 commented Dec 24, 2024

不支持换行的原因是什么?

属性里用换行可能有问题

@88250
Copy link
Member

88250 commented Dec 24, 2024

误触一下就会变成静态锚文本

@Vanessa219

@TCOTC
Copy link
Contributor

TCOTC commented Dec 24, 2024

属性里用换行可能有问题

我感觉这就跟纯文本主键一样,应该不会有啥问题

@88250
Copy link
Member

88250 commented Dec 24, 2024

等继续看看需求

Vanessa219 added a commit that referenced this issue Dec 24, 2024
EightDoor added a commit to EightDoor/siyuan that referenced this issue Dec 24, 2024
* commit '914c7659388e645395e70224f0d831950275eb05': (70 commits)
  🎨 Database-bound block primary key supports setting static anchor text siyuan-note#10049
  🚨
  🎨 siyuan-note#10049
  🎨 Improve net img convert to local siyuan-note#13600
  📝 Improve the user guide
  🎨 Improve notebook sorting siyuan-note#13598
  🐛 siyuan-note#10049
  🔖 Release v3.1.17
  🚨
  ⚡ Reduce startup time when sync is enabled siyuan-note#13589
  ♻️ Upgrade to Electron v32.2.7 siyuan-note#13566
  🎨 Database-bound block primary key supports setting static anchor text siyuan-note#10049
  🎨 siyuan-note#10049
  🎨 Database-bound block primary key supports setting static anchor text siyuan-note#10049
  🎨 siyuan-note#10049
  🎨 Database-bound block primary key supports setting static anchor text siyuan-note#10049
  📝 Update changelogs
  🎨 Database-bound block primary key supports setting static anchor text siyuan-note#10049
  🎨 Database-bound block primary key supports setting static anchor text siyuan-note#10049
  🎨 Database-bound block primary key supports setting static anchor text siyuan-note#10049
  ...

# Conflicts:
#	app/electron-builder.yml
@HibernalGlow
Copy link

为啥搜索替换后文本不能自动更新啊 手动改是可以的

@TCOTC
Copy link
Contributor

TCOTC commented Jan 7, 2025

先记录 #13746

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants