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

Add support for merging metadata in metadata table #937

Conversation

sunyatasattva
Copy link
Contributor

My last PR for today, I swear! 😅
This PR adds a feature I'd love to have, hence it's a bit larger.

What does this PR do?

This PR introduces a new setting option in the “Move inline metadata to card footer” that allows inline metadata to be displayed (and merged) within the Metadata table at the bottom of the card. This makes it easier to achieve a consistent look between cards whose metadata comes from linked pages and those which have it inline (in my case, I sometimes want to create a card without an attached note, but have the same metadata I'd use within my note YAML).

Because of this change, I renamed the setting to “Inline metadata position” and changed the help text. Also changed the toggle to a dropdown with three options:

  1. “Card body” – same as previous setting when it was off.
  2. “Card footer” – same as previous setting when it was on.
  3. “Merge with linked page metadata” – the new setting, achieving this behavior.

Warning

I also renamed the setting id to match its new function and I did not include any backwards compatibility. This may be fine since this setting was introduced in beta and is not currently published. If required, I can include some backwards compatibility by either: (a) changing the id back to what it was (b) checking both settings every time.
I believe this is cumbersome and probably unnecessary.

More notes on the behavior

  1. Task metadata are excluded as the setting is only aimed at Dataview inline data. As such, Task metadata behavior has not been changed.
  2. If multiple metadata with the same key are found, only one is displayed in the table.
  3. If an inline metadata conflicts with a linked page metadata, the inline data takes priority (same philosophy as local settings override global settings).

If the user selects this option, and a linked page metadata exists, the inline
metadata value takes precedence.
@mgmeyers mgmeyers merged commit 09b500c into mgmeyers:main May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants