I’ve stumbled upon something a bit strange in the behavior of the Add alias
command on the latest Insider/Catalyst release: Obsidian 1.7.0
.
It appears that if I create an aliases
key in Live Preview
(so in Properties
) using the command Add alias
available in the command palette but leave its value blank/empty the brand new aliases
key showing up in Properties
isn’t actually saved/written on file in Source
unless I add an alias as a value to the key and then remove it or another property/key to Properties
.
Steps to reproduce
- Open the
Sandbox vault
Split right
the noteStart Here.md
so you can see the same note side by side (whether both tabs arelinked
or not doesn’t matter).- Leave the one on the left in
Live Preview
- Set the one on the right in
Source Mode
- Leave the one on the left in
- Focus on the note in the
left pane
(the note inLive Preview
) by placing your cursor anywhere in the content of the note (e.g.: on line 1) - Hit
Cmd
+p
to trigger the command palette, look for theAdd alias
command and select it. - Once the
aliases
key appears (seemingly creatingProperties
inStart Here.md
at the same time), reset the focus on the content of the note (e.g.: by putting the cursor after the sentenceHi, welcome to Obsidian!
or by hitting theTab
key until you’re out ofProperties
) - Observe the result on
Start Here.md
previously set toSource Mode
in the right pane: NoYAML
block containing an emptyaliases
key has been created
Notes:
- Having the same note opened in a split view doesn’t really matter to repro this
: It also happens when using the
Add alias
command on a note inLP
and then simply switching toSource
.
- This also seems to happen if there are already some
Properties
inLP
(YAML
block inSource
) and if one adds analiases
key using the command but leaves its value empty: thealiases
key is only saved if one interact with it (adding a value) or interact withProperties
(adding another key).
Did you follow the troubleshooting guide? [Y/N]
Yes ! This has been tested and reproduced in the Sandbox vault.
Expected result
Adding an aliases
key to Properties
in Live Preview
using the command Add alias
should write that key in the YAML
block in Source Mode
regardless of the value of the key (empty or not) imho .
Especially since this doesn’t happen if one uses the command Add file property
and then select aliases
in the dropdown once Properties
is focused on . In that case, regardless of the value of the brand new
aliases
key, the key is saved/written on file (in Source Mode
)
Actual result
The aliases
key shows up in Properties
in Live Preview
but doesn’t actually exists as it’s not written on file in Source
… and as it doesn’t exist, the command Clear files properties
doesn’t work (at least, if the aliases
key is the only key appearing in Properties
and if that key was added to the note using the command Add alias
but its value was left empty).
The only way to get rid of the “ghost” aliases
key in Properties
in that specific case is to close and re-open the note .
(Hitting cmd
+ z
trying to undo the effect of using the add alias
command doesn’t seem to work either… I can only guess this is also happening because the empty aliases
key doesn’t actually exist anywhere while still being visually present in Properties
in LP
)
Screen-recordings:
From the Sandbox vault
Test 1:
Using the Add alias
command on a note without any Properties
and leaving the value of the seemingly created aliases
key empty (then hitting Tab
to get back to the content of the note) → the empty aliases
key isn’t created in Source
(same for the whole YAML
block)
Test 2:
Using the Add alias
command on a note without any Properties
and leaving the value of the seemingly created aliases
key empty then clicking on the + Add property
to add a test
key → the empty aliases
key is created in YAML
in Source
as soon as the new test
key is added to Properties
(in LP
)
Test 3:
Using the Add alias
command on a note with at least a key already present in Properties
and leaving the value of the seemingly created aliases
key empty (then hitting Tab
to get back to the content of the note) → the empty aliases
key isn’t created in Source
Test 4:
Using the Add file property
command to add an empty aliases
key to a note without any Properties
→ the empty aliases
key is created in Source
.
Environment
MacBook Pro (M2 Pro) + MacOS Sonoma 14.6.1 (23G93) + Obsidian 1.7.0 (Installer 1.6.7)
SYSTEM INFO:
Obsidian version: v1.7.0
Installer version: v1.6.7
Operating system: Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6020 23.6.0
Login status: logged in
Catalyst license: supporter
Insider build toggle: on
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on
RECOMMENDATIONS:
none
Additional information
- There’s no error showing up in the
console
in the Dev Tool - The “ghost” empty
aliases
key also doesn’t show up inReading view
(as far as I could see) - I hope the gifs are big enough to show the results I get
(if not, I still can try other sizes
)
- I first saw this on my iPad Pro (iPadOS 17.6.1) + the latest Catalyst/Insider release of Obsidian Mobile (
Obsidian 1.7.0 (153)
) and somewhat reported it on the dedicated Discord channel here… As it also happens on desktop, I was asked to open a BR so, here I am
…
- Sorry for the length though
!