-
-
Notifications
You must be signed in to change notification settings - Fork 7
Align the look of Startup-Scripts settings with core CSS snippets #34
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
base: master
Are you sure you want to change the base?
Align the look of Startup-Scripts settings with core CSS snippets #34
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some more discussion points
0c9a40e
to
6a92e1c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the one hand this approach is closer to how base Obsidian does things. On the other hand it's a less flexible way of doing things. I am torn.
One other point is the migration of existing settings. I don't really want to break existing user startup scripts.
You might want to consider using Svelte for the UI, as Svelte makes complicated UIs like this easier. |
rebasing onto |
The feature is quite new and not explicitly mentioned anywhere. Mostlike we are the only two knowing about it at the moment. And if anybody actually dug deep enough into the example-vault or the commit history to find this, they would also probably be able to find this update. But I could of course implement a migration function that tries to split exiting Or we deviate from the way obsidian-core handles it and store the full paths and a boolean in the settings instead of only the filename |
0a4632b
to
6808563
Compare
This current version keeps full backwards compatibility in that it will still run all startupscripts that have previously been added BUT it doesn't show them, the user needs to change This may be a decent compromise. Or I could add an additional function which will join the existing files with the detected ones. downside is that the settings now deviate from how obsidian core handles the CSS stuff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks better. But I think there is a bug where changing the startup scripts directory, while having some scripts enabled, makes it impossible to disable those scripts. Same goes for migrated scripts.
A user only has to look at the plugin's settings page to find this feature. With due respect, this mentality does not result in user-friendly plugins. |
I just had an idea on how to handle enabled scripts that are not in the scripts folder. They should be shown below in their own list with small warning that they should be moved to the scripts folder. The enable/disable toggle should be a remove and a move button, the later of which tries to move the file to the scripts folder while keeping the same name. I think that should be not too difficult to program and offer a nice transition for current users of startup scripts. |
Yes and no. With the retention of old scripts I didn't find a good logic of when to throw out scripts without having wird edgcases where old scripts work for a while and then suddenly stop working after the user changes something seemingly unrelated. But yes keeping the old scripts around is "invisible" and not really intuitive |
6808563
to
e365545
Compare
Found another problem, the I will continue to investigate this tomorrow. |
So I did a lot more testing and the whole I tried adding the Should I continue to try to find a way to get the startupscripts indext on the |
I feel like at this point there are too many tradeoffs with using a folder inside of |
5517ff0
to
e2f9117
Compare
e2f9117
to
654c3ed
Compare
You could use the
The best solution would be to show a notice on start-up and an extra section in the settings. Simply removing them on startup would be an easy solution, but I am not sure how well that interacts with sync services if the data file gets synced before the JS files.
There is a separate repo for the docs. |
That works, thanks for the tip. Just need to juggle typescript a bit more, it's currently not happy withe the usage of plain JS stuff (it doesn't know the
Not sure what other services exist, but obsidian desktop only loads the For the case that a second, remote instance starts up after only the The biggest potential problem I see is when the js file is deleted on both sides and both instances start up, try to moddif Just my immediate thought on the matter |
033e246
to
be063b6
Compare
Sorry for the long delay, I had a thesis to write... I have been using the self-compiled version including these changes this howl time during my DnD sessions an have not encountered any issues with syncing (using the _ remotly save_ plugin). |
f0de204
to
ee870be
Compare
Hello again, first of all many thanks for implementing the startup-scripts feature so incredibly quickly.
When I first started on this last year I imagined it beeing much more inline with the "look and feel" of the CSS snippets in obsidian-core. Which is why I took the time to create this proof-of-concept. It currently looks like this:
what I believe are pros of this approach:
.obsidian/snippets
as the default location is much more intuitive IMHOpotental cons:
openWithDefaultApp()
work in proges stuff
I am unsure about some things and would like your opinion on it:
when to reload?
Should hitting the "refresh" button reload the scripts?
Should the scripts be executed when they are toggled on?
or should they only load on startup?
how to reload?
currently the
display()
function just gets called again, removing all elements an rebuilding all settings. Should any effort go into making this more smart, recreating only the script-elements?opening the settings folder, without the folder existing
The implementation for CSS-snippets handles this case by creating the folder first if its missing. But this would required pulling in another undocumented function and creating the folder should be the useres responsibility.
On my (Windows) system the call results in an OS-error message that the path doesn't exists, which is fine I think?
how to handle the default folder
currently the settings field for snippets-folder will be auto-populated with
.obsidian/snippets
for every falsey value.This lead to some wired edgecases in that leaving it empty will re-populate it with the default value upon next load.
The default value of
.obsidian/snippets
will also be written to the settings file after any settings was changed, which is not completely inline with how defaults should work (I belive?), but could also be a feature as it makes the setting stable agains future changes in the default. But it will lead to unexpeted breakage when the user changes his config-folder to somethings else than.obsidian
.Maybe you know a better what to implement a dynamicly constructed default value? I experimented with having the default of
startupScriptsDirectory
beundefined
, but removed that as I had to ad a bounch of??
in places to gobble the never-happeningundefine
case.my shitty TS skills
TypeScript is not my stronges language, so feel free to point out anything that could be improved.
Once we agree on how to proceed I will also get onto documenting this feature