Skip to content

Dynamic icon use current date as default - #15693

Merged
Vanessa219 merged 2 commits into
siyuan-note:devfrom
Achuan-2:patch-6
Aug 31, 2025
Merged

Dynamic icon use current date as default#15693
Vanessa219 merged 2 commits into
siyuan-note:devfrom
Achuan-2:patch-6

Conversation

@Achuan-2

@Achuan-2 Achuan-2 commented Aug 27, 2025

Copy link
Copy Markdown
Member

#13770

问题:目前动态图标默认不填充日期,很多用户用来做日记图标时很容易没有设置日期,导致动态图标始终为今天日期,使得过去的日记的日期图标丢失

解决:动态图标默认填充当天日期

@TCOTC

TCOTC commented Aug 27, 2025

Copy link
Copy Markdown
Contributor

可能还是有人需要使用动态图标的,我建议实现这个:#15264

@Achuan-2

Copy link
Copy Markdown
Member Author

可能还是有人需要使用动态图标的,我建议实现这个:#15264

清除日期就是动态图标了,每次点击打开都同时显示静态和动态,我觉得没有必要

@TCOTC

TCOTC commented Aug 27, 2025

Copy link
Copy Markdown
Contributor

忘记有清除了,那应该还行

@TCOTC

TCOTC commented Aug 27, 2025

Copy link
Copy Markdown
Contributor

话说默认不是动态图标的话,这里文案是不是改一下比较好:

image

@Achuan-2

Achuan-2 commented Aug 28, 2025

Copy link
Copy Markdown
Member Author

话说默认不是动态图标的话,这里文案是不是改一下比较好:

@TCOTC 通过改变参数就能改变图标的显示,本身也是一种“动态”,根据日期自动改变图标也只是“动态”的一种

@Vanessa219

Vanessa219 commented Aug 29, 2025

Copy link
Copy Markdown
Member

要不在日期下面加一个描述?
太久不用我都不记得为空表示当天的了。

@Achuan-2

Copy link
Copy Markdown
Member Author

要不在日期下面加一个描述? 太久不用我都不记得为空表示当天的了。

可以加一个“日期为空将动态获取当天日期”

@Vanessa219

Copy link
Copy Markdown
Member

加好了一起合并吧

@TCOTC

TCOTC commented Aug 30, 2025

Copy link
Copy Markdown
Contributor

要不在“日期”后面加个 #iconInfo 图标,用 tooltip

如果是直接插一行文本在下面的话,多少有点丑了

@Achuan-2

Achuan-2 commented Aug 31, 2025

Copy link
Copy Markdown
Member Author

@Vanessa219 这样可以吗

PixPin_2025-08-31_09-31-46 PixPin_2025-08-31_09-31-19

@Vanessa219
Vanessa219 merged commit c8a3ec5 into siyuan-note:dev Aug 31, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the dynamic icon feature to use the current date as the default instead of an empty date, addressing user issues where journal entries would lose their date icons when the date wasn't explicitly set.

  • Changes default date behavior from empty string to current date using dayjs formatting
  • Updates language keys from "dynamicEmoji" to "dynamicIcon" for consistency
  • Adds informational UI element and tooltip explaining the empty date behavior

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

File Description
app/src/emoji/index.ts Updates default date to current date and adds info icon with tooltip
app/appearance/langs/*.json Updates language keys and adds new tooltip text across all supported languages

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread app/src/emoji/index.ts
<span class="fn__flex-center ft__on-surface" style="width: 89px">${window.siyuan.languages.date}</span>
<span class="fn__space--small"></span>
<input type="date" max="9999-12-31" class="b3-text-field fn__flex-1" value="${dynamicCurrentObj.date}"/>
<span class="ariaLabel block__icon block__icon--show" aria-label="${window.siyuan.languages.dynamicIconDateEmptyInfo}"><svg><use xlink:href="#iconInfo"></use></svg></span>

Copilot AI Aug 31, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation of this line is inconsistent with the surrounding code. It should align with the other elements in the same container.

Suggested change
<span class="ariaLabel block__icon block__icon--show" aria-label="${window.siyuan.languages.dynamicIconDateEmptyInfo}"><svg><use xlink:href="#iconInfo"></use></svg></span>
<span class="ariaLabel block__icon block__icon--show" aria-label="${window.siyuan.languages.dynamicIconDateEmptyInfo}"><svg><use xlink:href="#iconInfo"></use></svg></span>

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

现在都有人工智能审查代码了,真先进

@Vanessa219 Vanessa219 added this to the 3.3.1 milestone Aug 31, 2025
Vanessa219 added a commit that referenced this pull request Aug 31, 2025
@Vanessa219 Vanessa219 self-assigned this Aug 31, 2025
@TCOTC

This comment was marked as outdated.

@88250 88250 changed the title ✨ dynamic icon use current date as default Dynamic icon use current date as default Sep 1, 2025
@88250 88250 changed the title Dynamic icon use current date as default Dynamic icon use current date as default Sep 1, 2025
EightDoor added a commit to EightDoor/siyuan that referenced this pull request Sep 2, 2025
* commit 'b699675b9726e23a5b7286fdae814016d4713616': (61 commits)
  🔖 Release v3.3.1
  🔖 Release v3.3.1
  🎨 Clean code
  🎨 siyuan-note#15736
  📝 Update changelogs
  📝 Move changelogs v3.2.x
  🎨 siyuan-note#15610
  🎨 Improve database template field grouping siyuan-note#15687
  🎨 Improve database rollup template rendering siyuan-note#15722
  🎨 反链面板移除元素后,文档分屏且为空会重复添加空块
  🎨 Improve database rollup template rendering siyuan-note#15722
  🎨 Improve av
  ⚡ siyuan-note#15734
  🐛 siyuan-note#14269
  🎨 Improve av
  🎨 Block ref search and global search results display reference counts siyuan-note#15721
  🎨 siyuan-note#15693
  🚨
  🚨
  ✨ dynamic icon use current date  as default (siyuan-note#15693)
  ...
@TCOTC TCOTC mentioned this pull request Sep 3, 2025
boyiwan pushed a commit to boyiwan/siyuan that referenced this pull request Sep 10, 2025
* ✨ dynamic icon use current date  as default

* 💄add dynamicIconDateEmptyInfo
boyiwan pushed a commit to boyiwan/siyuan that referenced this pull request Sep 10, 2025
@Achuan-2
Achuan-2 deleted the patch-6 branch September 26, 2025 08:41
leolee9086 pushed a commit to leolee9086/siyuan that referenced this pull request Oct 25, 2025
* ✨ dynamic icon use current date  as default

* 💄add dynamicIconDateEmptyInfo
leolee9086 pushed a commit to leolee9086/siyuan that referenced this pull request Oct 25, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants