Clarify active-file events, editing modes, platform flags and file operations
Maintainers usually reply within 4 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- documentation
Research direction
Read the existing Workspace, Editor, Mobile development and Vault guides and find where they describe these API behaviors. Add the five clarifications from the issue, keeping the generated TypeScript API pages unchanged. Done means each behavior is documented in the relevant guide and matches the observations reported for Obsidian 1.15.1.
Written by the indexing model from the issue text.
Description
Several API behaviors could use short clarifications in the existing guides:
file-openfollows changes to the active file, including focus changes between files already open. It doesn't fire again for the same active file.MarkdownView.getMode()returns'source'in both Live Preview and Source mode;getState().sourcedistinguishes them.Platform.isMobileincludes desktop mobile emulation;Platform.isMobileAppdoesn't.Vault.rename()doesn't update links.FileManager.renameFile()handles link updates according to the user's preferences.- Bookmarks can point to missing files or folders, and stay after their target is deleted.
I checked each of these in Obsidian 1.15.1 on desktop (Windows), in a clean vault, by running the API calls and reading the results:
- Registered a
file-openlistener and opened files across split leaves. Opening a file fired once; reopening it in the same leaf, opening it in a second leaf, and switching focus between two leaves showing it fired nothing; switching focus to a leaf with a different file fired with that file; closing every leaf fired withnull.active-leaf-changefired on each of the same-file focus switches. - Set the view state to Live Preview, Source mode and Reading view in turn:
getMode()was'source','source','preview', andgetState().sourcewasfalsein Live Preview andtruein Source mode. - Before and after
app.emulateMobile(true):isMobilewent fromfalsetotrue,isMobileAppstayedfalse, andrequire('fs')andrequire('electron')still loaded. - With Automatically update internal links on,
Vault.rename()left[[one]]pointing at the old name, andFileManager.renameFile()rewrote the link. With it off,renameFile()showed the "Update links" prompt (Always update, Just once, Do not update), and the link followed the choice. - Bookmarked two files, a folder and a path that never existed, then deleted one file and the folder through the vault API and the other file on disk. All four bookmarks were still there.
Would additions to the Workspace, Editor, Mobile development and Vault guides be welcome? I would leave the generated TypeScript API pages unchanged.
- Dominant language
- JavaScript
- Stars
- 532
- Forks
- 174
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from obsidianmd/obsidian-developer-docs
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
obsidianmd/obsidian-developer-docs#270 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
obsidianmd/obsidian-developer-docs#265 · 1 comment ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
obsidianmd/obsidian-developer-docs#262 · 1 comment ·
Maintainers usually reply within 4 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
obsidianmd/obsidian-developer-docs#252 · 1 comment ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
obsidianmd/obsidian-developer-docs#242 · 1 comment ·
Maintainers usually reply within 4 days
All issues in obsidianmd/obsidian-developer-docs
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
guybedford/es-module-lexer#266 ·
-
bug documentation
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
apify/apify-docs#3206 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
anhnt256/cursor-swarm#21 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
zerohourzulu/irontrellis#16 ·