mirnovov / obsidian-homepage

An Obsidian plugin that opens a specified note, canvas, or workspace on startup, instead of the most recent one.
MIT License
406 stars 19 forks source link

Homepage plugin changing view on some pages #55

Closed reagle closed 1 year ago

reagle commented 1 year ago

Details

Thank you for this great plugin! When I use it, though, I get an odd behavior that some pages (not all) always open in source view. I have my default view set to live mode, so I'd think everything should stay in that view unless I toggle explicitly.

In Obsidian settings I have "Default view" set to "Editing view" and "Default editing mode" set to "Live Preview".

In Homepage settings: "Homepage view" is set to "Default view", and "Revert view on close" is enabled, but as the Obsidian's default view is "live". I'm going to try playing with this setting to see if that changes anything, but I still think the current behavior is weird/buggy because why does this happen only on some pages (consistently the same pages)?

Steps to reproduce

  1. Install plugin.
  2. Open Obsidian.
  3. Open my "Shopping" page -- rather long/complicated.
  4. See that it is in source view and mode.

Debug information

{"version":3,"homepages":{"Main Homepage":{"value":"Home","kind":"File","openOnStartup":true,"hasRibbonIcon":false,"openMode":"Keep open notes","manualOpenMode":"Keep open notes","view":"Default view","revertView":true,"refreshDataview":false,"autoCreate":false,"autoScroll":false,"pin":false,"commands":[],"openWhenEmpty":true}},"separateMobile":false,"_defaultViewMode":"default","_livePreview":"default","_focusNewTab":"default","_plugins":["homepage","table-editor-obsidian","obsidian-another-quick-switcher","obsidian-task-archiver","obsidian-auto-link-title","obsidian-file-link","calendar","obsidian-editor-shortcuts","hotkey-helper","nldates-obsidian","numerals","omnisearch","obsidian-outliner","url-into-selection","obsidian-plugin-update-tracker","quickadd","settings-search","obsidian-tasks-plugin"],"_internalPlugins":["file-explorer","global-search","graph","backlink","canvas","outgoing-link","tag-pane","page-preview","daily-notes","templates","note-composer","command-palette","editor-status","bookmarks","outline","word-count","file-recovery","sync"],"_obsidianVersion":"1.3.5"}

Checklist

mirnovov commented 1 year ago

It seems that this is caused by it attempting to revert the view when it's already default. Obsidian view behaviour can be a bit finicky sometimes so let me know if this doesn't fix your issue.

reagle commented 1 year ago

Thank you, but I've experienced the problem again. I've simply disabled the revert view on close since that creates the behavior I want anyway and the revert option seems buggy.

mirnovov commented 1 year ago

I haven’t incorporated the change into an update yet, which is why the behaviour is the same.