sidebar-markdown-notes
sidebar-markdown-notes copied to clipboard
Toggle for welcome text
Currently, the welcome text is added to all pages. A new configuration toggle for this would be nice. Something like:

@AssisrMatheus Working through this, hope you don't mind a couple questions. Trying to mimic your patterns if I can. So, unlike the leftMargin, welcome text is applied in main.js (via initialState or via the nextPage logic).
How do you recommend passing the config for use in in main.js? Any thoughts on the refactoring in general?
@ryanraposo
hope you don't mind a couple questions
Not at all, shoot them! I just might take some time to answer
How do you recommend passing the config for use in in main.js?
The first idea I had is that when generating the HTML content here: https://github.com/AssisrMatheus/sidebar-markdown-notes/blob/50a2d6fc0a3bf39fab317b0b0a6105e83280aba8/src/webviewProvider.ts#L113
A new
But that's because I'm not familiar with the extension API. If we could pass values with postMessage: https://github.com/AssisrMatheus/sidebar-markdown-notes/blob/50a2d6fc0a3bf39fab317b0b0a6105e83280aba8/src/webviewProvider.ts#L67
Like we can on main.js. It could also be a possibility.
@AssisrMatheus for the tag. Does this look alright and does it need to be nested anywhere specific in _getHtmlForWebview()?
<script>var showWelcomeText =${this.config.get<boolean>('showWelcomeText')</script>
PS debugging webviews is so painful how have you been doing it?
See #13. (PS debugging still terrible pls send tips)
Hey @ryanraposo sorry for the late reply. I'm usually taking time off the computer after work, so I'm not having much time to answer your questions.
Does this look alright and does it need to be nested anywhere specific in _getHtmlForWebview()?
Hmm I think that looks good enough to me! I was going to suggest you just giving the entire config object but I just saw you did that in the pr
PS debugging webviews is so painful how have you been doing it?
When in the sandbox environment(when you press F5 in the workspace and it opens a vscode view), and with the webview focused(just click on it), you can press CTRL + SHIFT + P to open the command tooltip(not the exact name for the feature haha), and type "Open webview developer tools". It'll then open a normal chrome/electron developer tools window but for the inner webview. Where you can see logs and put breakpoints in the html/main.js.
Hey @ryanraposo sorry for the late reply. I'm usually taking time off the computer after work, so I'm not having much time to answer your questions.
No rush, its all good.
When in the sandbox environment(when you press F5 in the workspace and it opens a vscode view), and with the webview focused(just click on it), you can press CTRL + SHIFT + P to open the command tooltip(not the exact name for the feature haha), and type "Open webview developer tools". It'll then open a normal chrome/electron developer tools window but for the inner webview. Where you can see logs and put breakpoints in the html/main.js.
Awesome, thanks.