-
Notifications
You must be signed in to change notification settings - Fork 20
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
Skate Plugin Settings Checkbox Enhancement #448
Conversation
Co-authored-by: Zac Sweers <[email protected]>
Co-authored-by: Zac Sweers <[email protected]>
…ange_log_parser # Conflicts: # skate-plugin/src/test/kotlin/com/slack/sgp/intellij/ChangeLogParserTest.kt
Co-authored-by: Zac Sweers <[email protected]>
…arkdown_rendering
-intellij {
+intellij {
version.set("2022.2.5")
type.set("IC") // Target IDE Platform
plugins.add("org.intellij.plugins.markdown")
}
.trimEnd()
-
// If the changelog substring is blank, set it as null
// If the previous entry equals to the latest entry, or if no date is found,
// use the previous entry date as the latest date instead of the current date.
toolWindowManager.invokeLater {
val toolWindow =
toolWindowManager.registerToolWindow("skate-whats-new") {
stripeTitle = Supplier { "What's New in Slack!" }
anchor = ToolWindowAnchor.RIGHT
}
- val parentDisposable = Disposer.newDisposable()
+
+ // The Disposable is necessary to prevent a substantial memory leak while working with
+ // MarkdownJCEFHtmlPanel
+ val parentDisposable = Disposer.newDisposable()
+
WhatsNewPanelFactory()
- .createToolWindowContent(toolWindow, project, changeLogString, parentDisposable)
+ .createToolWindowContent(toolWindow, project, changeLogString, parentDisposable)
toolWindow.show()
}
row(SkateBundle.message("skate.configuration.enableWhatsNew.title")) {
- checkBox(SkateBundle.message("skate.configuration.enableWhatsNew.description"))
+ checkBox(
+ "<html>${SkateBundle.message("skate.configuration.enableWhatsNew.description")}</html>"
+ )
.bindSelected(
getter = { settings.isWhatsNewEnabled },
setter = { settings.isWhatsNewEnabled = it }
val file = LightVirtualFile("changelog.md", markdownFileString)
val panel = MarkdownJCEFHtmlPanel(project, file)
- Disposer.register(parentDisposable, panel)
- val html = runReadAction {
- MarkdownUtil.generateMarkdownHtml(file, markdownFileString, project)
- }
+ val html = MarkdownUtil.generateMarkdownHtml(file, markdownFileString, project)
panel.setHtml(html, 0)
return panel.component
<!-- Product and plugin compatibility requirements.
Read more: https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html -->
<depends>com.intellij.modules.platform</depends>
+ <depends>org.intellij.plugins.markdown</depends>
<!-- Extension points defined by the plugin.
Read more: https://plugins.jetbrains.com/docs/intellij/plugin-extension-points.html -->
skate.configuration.enableWhatsNew.description=If enabled, shows the What's New Panel if there are new changes detected <br> in a specified changelog file. Overall, the code looks good and the suggested changes are mainly for improving code readability and removing unused code. |
This is just a simple enhancement for the Skate Plugin Settings UI Panel.
Before, the checkbox text would not wrap and would require users to scroll horizontally:
Now, the text is wrapped:
This is just a simple enhancement for user readability, and I added documentation to the
SkateConfigUI.kt
file as well.