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

[Bug Report] NTB + Notes in Split View: impact on Workspaces and Obsidian Start Up #94

Open
FelipeRearden opened this issue Jul 6, 2024 · 5 comments
Assignees
Labels
bug Something isn't working the way it should, and the problem is reproducible

Comments

@FelipeRearden
Copy link

Hello @chrisgurney !!!!!!

Description of the bug

I think I found a bug :)

ℹ️ Notes are in split view
ℹ️ Both notes has NTB enable
ℹ️ NTB is Top (fixed)

This issue happens in 2 scenarios:
🅰️ On Obsidian Startup
🅱️ When switching from Workspace A to Workspace B

Let me explain in details…

The issue is that NTB is not been exposed/calculated/showed in the NOT FOCUSED note in the screen.

This only happens on Obsidian Startup and switching workspaces.

📽️ I reproduced the issue in a test vault with 0% CSS (below)

RPReplay_Final1720196437.mp4

When we focus on the broken Note, NTB is calculated correctly.

Steps to reproduce
0. Setup a NTB with Top:fixed

  1. Create a Workspace with split notes where both has a NTB;
  2. Create a second Worksapce with split notes where both has a NTB;
  3. Switch between these two workspaces;
  4. See the NTB is hidden in the unfocused note
  5. Quit Obsidian
  6. Start Obsidian
  7. See the NTB is hidden in the unfocused note

Expected behavior

Screenshots (if you think it will help)

Above

Theme links and CSS snippets (if applicable):
No CSS was used in this test

Plugin links (if applicable):

Mobile environment (if applicable to the issue):

  • Device: iPad
  • OS: 17.5.1
  • Obsidian version: 1.6.5
  • Note Toolbar version: 1.8.6

Additional context

I don't know if can do something to avoid this 🙏

Let me know if you need more information or tests.

I wish you a fantastic day ☀️

@FelipeRearden FelipeRearden changed the title Bug Report NTB + Notes in Split View: impact on Workspaces and Obsidian Start Up [Bug Report] NTB + Notes in Split View: impact on Workspaces and Obsidian Start Up Jul 6, 2024
@chrisgurney chrisgurney added the bug Something isn't working the way it should, and the problem is reproducible label Jul 6, 2024
@chrisgurney
Copy link
Owner

@FelipeRearden Thanks for this one! I was able to duplicate the problem.

This one will take some investigation to work out, as it touches the fundamental way I'm using to detect what file is open to render the toolbar.

@FelipeRearden
Copy link
Author

FelipeRearden commented Jul 6, 2024

Thank you very much @chrisgurney for the reply!

This one will take some investigation to work out, as it touches the fundamental way I'm using to detect what file is open to render the toolbar.

I hope you find a solution, I am gonna reflect on this to see if I found some idea to share 🙏

ℹ️ What I can say from my templater scripts is that is possible to get all notes open in the screen instead of just the active note

ℹ️ It is possible to apply a commands/rules when obsidian starts

@chrisgurney
Copy link
Owner

@FelipeRearden Can you please share how you do this in your Templater script?

What I can say from my templater scripts is that is possible to get all notes open in the screen instead of just the active note

@FelipeRearden
Copy link
Author

FelipeRearden commented Jul 30, 2024

@FelipeRearden Can you please share how you do this in your Templater script?

Sure @chrisgurney !!!

const thisLeaf = app.workspace.activeLeaf;
let thisFile = thisLeaf.view.file;
let leafNextLeft = app.workspace.getAdjacentLeafInDirection(thisLeaf, "left");
let leafNextRight = app.workspace.getAdjacentLeafInDirection(thisLeaf, "right");
var list = [];
this.app.workspace.iterateRootLeaves((pin) => {
	list.push(`"` + pin.view.file.basename + `"`);
})

All open files in the workspace, even pinned notes and notes that are in the sidebars

Based on Hotkeys for Files code plugin,

this.app.workspace.revealLeaf(leaf);
if (leaf.view instanceof MarkdownView) {
leaf.view.editor.focus();
}

Will focus on the open notes instead of replace the active note. I dont know how to use this in my templater snippets, but might be useful for you 🙏

Vinzent03/obsidian-hotkeys-for-specific-files@0541bcb

@chrisgurney
Copy link
Owner

Thank you @FelipeRearden!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working the way it should, and the problem is reproducible
Projects
None yet
Development

No branches or pull requests

2 participants