From e9411f9677ddcac7a38f6f5aa7c706669232fc3a Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Fri, 3 Oct 2025 15:35:48 +0800 Subject: [PATCH] :art: API `getTag` add an optional parameter `ignoreMaxListHint` https://github.com/siyuan-note/siyuan/issues/16000 Signed-off-by: Daniel <845765@qq.com> --- kernel/api/tag.go | 9 ++++++++- kernel/model/tag.go | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/kernel/api/tag.go b/kernel/api/tag.go index e844aed29..da2ebf701 100644 --- a/kernel/api/tag.go +++ b/kernel/api/tag.go @@ -43,7 +43,14 @@ func getTag(c *gin.Context) { model.Conf.Tag.Sort = sortMode model.Conf.Save() - ret.Data = model.BuildTags() + // API `getTag` add an optional parameter `ignoreMaxListHint` https://github.com/siyuan-note/siyuan/issues/16000 + ignoreMaxListHint := false + ignoreMaxListHintArg := arg["ignoreMaxListHint"] + if nil != ignoreMaxListHintArg { + ignoreMaxListHint = ignoreMaxListHintArg.(bool) + } + + ret.Data = model.BuildTags(ignoreMaxListHint) } func renameTag(c *gin.Context) { diff --git a/kernel/model/tag.go b/kernel/model/tag.go index d0d652ce6..a44d7c0f0 100644 --- a/kernel/model/tag.go +++ b/kernel/model/tag.go @@ -236,7 +236,7 @@ type Tag struct { type Tags []*Tag -func BuildTags() (ret *Tags) { +func BuildTags(ignoreMaxListHintArg bool) (ret *Tags) { FlushTxQueue() sql.FlushQueue() @@ -254,7 +254,7 @@ func BuildTags() (ret *Tags) { for _, tag := range tags { *tmp = append(*tmp, tag) countTag(tag, &total) - if Conf.FileTree.MaxListCount < total { + if Conf.FileTree.MaxListCount < total && !ignoreMaxListHintArg { util.PushMsg(fmt.Sprintf(Conf.Language(243), Conf.FileTree.MaxListCount), 7000) break }