Skip to content

Empty Button templates window in settings #431

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

Closed
4 of 8 tasks
sanyam opened this issue Oct 8, 2024 · 6 comments
Closed
4 of 8 tasks

Empty Button templates window in settings #431

sanyam opened this issue Oct 8, 2024 · 6 comments
Labels
bug Undesired behavior caused by this plugin

Comments

@sanyam
Copy link

sanyam commented Oct 8, 2024

Please fill out these Check-boxes

  • I checked for existing similar issues
  • I checked that the plugin is up to date
  • The issue persists with all other plugins and themes disabled

Plugin Version

1.2.1

This Issue Occurs on

  • Windows
  • Linux
  • macOS
  • Android
  • iOS

Debug Info

SYSTEM INFO:
	Obsidian version: v1.6.7
	Installer version: v1.5.12
	Operating system: Windows 10 Pro 10.0.19045
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Base theme: light
	Community theme: none
	Snippets enabled: 1
	Restricted mode: off
	Plugins installed: 15
	Plugins enabled: 15
		1: Meta Bind v1.2.1
		2: Advanced Tables v0.22.0
		3: Calendar v1.5.10
		4: CustomJS v1.0.21
		5: Dataview v0.5.67
		6: Excalidraw v2.5.1
		7: Homepage v4.0.6
		8: Image Converter v1.1.7
		9: Metadata Menu v0.8.7
		10: Minimal Theme Settings v8.1.1
		11: Outliner v4.8.1
		12: Projects v1.17.4
		13: Style Settings v1.0.9
		14: Telegram Sync v3.2.0
		15: Templater v2.8.0

RECOMMENDATIONS:
	Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Describe the Issue

I can't see anything and edit button templates in plugin settings.
First step - it was possible to view not empty window with button templates, but i can normally add or edit edit template. Only one option works - add it from clipboard. So added the template from clipboard and it seems it was successfully added (because inline button is working as i wanted). But since then i see only empty window with Button templates. Nothing there.
And i looked in console log, there is a error:
node:internal/structured_clone:23
Uncaught DOMException {stack: 'DataCloneError: [object Array] could not be cloned…. (app://obsidian.md/app.js:1:1484574)'}

Steps to Reproduce

  1. Go to setting and try to edit Button Templates. You can't do it normally, you can only add it from clipboard
  2. Add button template from clipboard
    Result: Nothing is showing in Button Template windows
Obsidian_Sk0P0TAbTK

Expected Behavior

I expect to be able edit button templates

@sanyam sanyam added the bug Undesired behavior caused by this plugin label Oct 8, 2024
@mProjectsCode
Copy link
Owner

can you navigate to .obsidian/plugins/obsidian-meta-bind-plugin, open the data.json file and send me it's content?

@sanyam
Copy link
Author

sanyam commented Oct 9, 2024

yes, here it is:

{
"devMode": false,
"ignoreCodeBlockRestrictions": false,
"preferredDateFormat": "YYYY-MM-DD",
"firstWeekday": {
"index": 1,
"name": "Monday",
"shortName": "Mo"
},
"syncInterval": 200,
"minSyncInterval": 50,
"maxSyncInterval": 1000,
"enableJs": true,
"viewFieldDisplayNullAsEmpty": false,
"enableSyntaxHighlighting": true,
"enableEditorRightClickMenu": true,
"inputFieldTemplates": [],
"buttonTemplates": [
{
"label": "TS +1",
"hidden": false,
"id": "time-spent-increment",
"style": "default",
"actions": [
{
"type": "updateMetadata",
"bindTarget": "time_spent",
"evaluate": true,
"value": "x + 1"
}
]
}
],
"excludedFolders": [
"templates"
]
}

@mProjectsCode
Copy link
Owner

Note to self: the same underlying issue probably causes #433 and #434.

Most likely this has to do with the svelte 5 proxies not being structuredClone-able. I should use $state.snapshot as it de-proxies and already clones the objects.

@mProjectsCode
Copy link
Owner

The good thing about this is that there doesn't seem to be any data file corruption.

@mProjectsCode
Copy link
Owner

Should be fixed in 1.2.2

@sanyam
Copy link
Author

sanyam commented Oct 10, 2024

I have temporary configured all the buttons via data.json for now
It works great, thank you very much for the plugin, it's super.

Yhere is only one question, is it possible to somehow show/hide buttons depending on the current value in the properties?
I am trying to make something like the workflow in Jira. So that depending on the status of the current tasks, buttons with the possible next statuses are shown.
Something like:

  • property status = Backlog -> the InProgress button is shown
  • property status = InProgress -> the Backlog and Done buttons are shown
    , etc.

somekind of conditional show/hide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Undesired behavior caused by this plugin
Projects
None yet
Development

No branches or pull requests

2 participants