buttons icon indicating copy to clipboard operation
buttons copied to clipboard

In editing mode I don't see the code of the buttons but in reading mode the buttons work perfect

Open wardroef opened this issue 1 year ago • 15 comments

Hi. I use 29 plugins and Dataview is for me the most important plugin. But the second place goes to Buttons ☺. It is like having a Stream Deck in Obsidian. Thank you for creating this Awesome plugin.

It works almost perfect but I have a strange problem and I think it is a bug.

The Button code only is visible in Editing mode (Live Preview) after scrolling down with the arrow keys to the end op the page. Otherwise I only see
between the buttons but not the code. It looks likes it is collapsed.

In Reading mode the buttons work perfect.

Before scrolling down with the arrow keys image

After scrolling down with the arrow keys

name 00205_KLA_Daylight
type link
action obsidian://open?vault=00205_KLA_Daylight
color white

wardroef avatar Jul 14 '22 10:07 wardroef

same problem with obsidian 0.15 (not with 0.14)

cvh-obsi avatar Jul 26 '22 06:07 cvh-obsi

Is this the same problem as #126?

shabegom avatar Aug 17 '22 13:08 shabegom

Hi

No it is not the same. In my case the buttons works perfect in Reading mode. In source mode I see the code perfect.

But in Live preview I need to scroll down with the arrow keys to see the code. Very strange. Next time when I open the note it is the same problem again.

Ward

From: Sam @.> Sent: Wednesday, 17 August 2022 15:08 To: shabegom/buttons @.> Cc: Ward Roef @.>; Author @.> Subject: Re: [shabegom/buttons] In editing mode I don't see the code of the buttons but in reading mode the buttons work perfect (Issue #125)

Is this the same problem as #126https://github.com/shabegom/buttons/issues/126?

— Reply to this email directly, view it on GitHubhttps://github.com/shabegom/buttons/issues/125#issuecomment-1217988078, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATANAP2AT3I6MS4OY646NE3VZTP3ZANCNFSM53RYXU7A. You are receiving this because you authored the thread.Message ID: @.@.>>

wardroef avatar Aug 17 '22 14:08 wardroef

Also having this issue. Very annoying since I rely on Live Preview a lot, and use obsidian mobile where I do not have access to arrow keys.

TacticalSauce avatar Aug 18 '22 14:08 TacticalSauce

Same problem. On mobile buttons appears if I backspace lines where button should be then undo it

TaardeT avatar Aug 30 '22 12:08 TaardeT

I can't reproduce this bug. Will keep trying tho

shabegom avatar Sep 02 '22 00:09 shabegom

Hi Sam

I have tested now in the new 0.16.1 insider build. The problem is the same and the workaround also. It works perfect in Reading view and in Source Mode. The problem only appears in Live preview mode. When I scroll down with the arrow key all the code appears. Before that I can only see the hard return code:
This is an example of a button.

name 01584_ICT_Dell
type link
action obsidian://open?vault=01584_ICT_Dell
color white

Ward From: Sam @.> Sent: Friday, 2 September 2022 02:51 To: shabegom/buttons @.> Cc: Ward Roef @.>; Author @.> Subject: Re: [shabegom/buttons] In editing mode I don't see the code of the buttons but in reading mode the buttons work perfect (Issue #125)

I can't reproduce this bug. Will keep trying tho

— Reply to this email directly, view it on GitHubhttps://github.com/shabegom/buttons/issues/125#issuecomment-1234948334, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATANAP4S764U4WAQHJ5PUNTV4FFQLANCNFSM53RYXU7A. You are receiving this because you authored the thread.Message ID: @.@.>>

wardroef avatar Sep 02 '22 06:09 wardroef

@wardroef Could you try seeing if it is a conflict with another plugin or a theme?

Create a test vault and only install buttons. Does the issue still occur?

shabegom avatar Sep 02 '22 11:09 shabegom

Hi Sam

That was a very good idea. I should have thought about myself ☺

I created a new local folder. No sync and no cloud.

I only installed Buttons plugin. I have kept the default theme and all default settings.

I copied my MD file with the buttons.

The problem is the same.

@.***

From: Sam @.> Sent: Friday, 2 September 2022 13:36 To: shabegom/buttons @.> Cc: Ward Roef @.>; Mention @.> Subject: Re: [shabegom/buttons] In editing mode I don't see the code of the buttons but in reading mode the buttons work perfect (Issue #125)

@wardroefhttps://github.com/wardroef Could you try seeing if it is a conflict with another plugin or a theme?

Create a test vault and only install buttons. Does the issue still occur?

— Reply to this email directly, view it on GitHubhttps://github.com/shabegom/buttons/issues/125#issuecomment-1235391099, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATANAP2UY32I6WXXP274LGLV4HRBPANCNFSM53RYXU7A. You are receiving this because you were mentioned.Message ID: @.@.>>

wardroef avatar Sep 02 '22 12:09 wardroef

Also having the same issue. Have tried a test vault with no other plugins. Live preview / arrow on moible makes it hard to use. It's a great plugin, hope this gets sorted.

daxmonson avatar Sep 17 '22 18:09 daxmonson

I'm still not able to reproduce, so it's hard to know why it isn't working...codeblocks in live preview were built to "just work".

I suspect it is a button indexing problem. Do the buttons have IDs under the codeblock: ^button-myButton?

shabegom avatar Sep 17 '22 19:09 shabegom

Yep, mine have assigned button IDs underneath.

daxmonson avatar Sep 18 '22 17:09 daxmonson

I'm encountering this problem too. Here's an example:

bug

I'm running Obsidian 0.15.9

hbarudin avatar Sep 22 '22 16:09 hbarudin

That’s exactly the issue I have. I have tested on mobile, desktop, with a fresh vault and no other plugins, block IDs and no block IDs… it persists regardless.

— Aadam Sherazi On Sep 22, 2022 at 12:19 PM -0400, Hannah Barudin @.***>, wrote:

I'm encountering this problem too. Here's an example: I'm running Obsidian 0.15.9 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

TacticalSauce avatar Sep 22 '22 16:09 TacticalSauce

I have the same issue. As a manual workaround, I would manually select the area where the text of the button would be then click away

Buttons workaround_compressed

My automatic workaround is to automatically refresh the page by using dataview and templater. It selects the entire page then clicks back to where the cursor was initially. Like the gif above but automatically. Just put the codeblock symbols around the below code and add it to a file where it would be visible.

dataviewjs //get editor using templater. Place cursor position at the start and end of the document then remove cursor from the file let intervalToRunInMilliseconds = 500; async function getEditor(){let MarkdownView=app.plugins.plugins['templater-obsidian'].templater.current_functions_object.obsidian.MarkdownView;let activeLeaf=app.workspace.getActiveViewOfType(MarkdownView);if(activeLeaf){let view=activeLeaf;let editor=view.editor;return editor}}function delayTextReturn(textToReturn,delayInMilliseconds){return new Promise((resolve,reject)=>{setTimeout(()=>{resolve(textToReturn)},delayInMilliseconds)})} await delayTextReturn("This waits for a bit before refreshing the page",intervalToRunInMilliseconds);let editor=await getEditor(); let currentCursorPosition = editor.getCursor(); editor.setSelection({line:0,ch:0},{line:editor.lineCount(),ch:editor.lastLine.length});editor.setCursor({line:0,ch:0}); editor.setCursor(currentCursorPosition);

Being a workaround, there are some limitations: It refreshes all other codeblocks so using it on a page with other codeblocks can get performance heavy. Also it will run every time the interval is passed so long as the dataview block is visible on the page (I recommend having it at the top of the page)

It works for my use-case. Hopefully it helps someone else too :)

Mindweave avatar Sep 30 '22 22:09 Mindweave