-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Sketch feature #45
base: main
Are you sure you want to change the base?
Sketch feature #45
Conversation
src/resources/META-INF/plugin.xml
Outdated
@@ -53,6 +53,9 @@ | |||
class="org.jetbrains.plugins.d2.action.D2LayoutEngineActionGroup" | |||
popup="true" | |||
icon="AllIcons.General.Layout"/> | |||
<action id="D2.SketchMode" | |||
class="org.jetbrains.plugins.d2.action.D2SketchToggleAction" | |||
icon="AllIcons.Actions.EnableNewUi"/> |
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.
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.
Could you please provide this icon ID? I'm not sure I've seen it within the available IntelliJ options
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.
Sorry, I can't provide you with a specific id. Please, take a look at the existing icons here: https://jetbrains.design/intellij/resources/icons_list/
If there are no suitable icons, consider adding one following the documentation here: https://plugins.jetbrains.com/docs/intellij/icons.html
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.
What do yo think about the options above? It's the best I could find with "hand-drawn", "hand-made", "hand", "pen", "pencil", "painting", "draw", "drawing", "sketch" keywords similar to your proposal.
Your suggested icon doesn't seem to fit right (had to resize it and cannot change color black) and it's licensed (not sure whether you want and how to properly give credits to the creator)
Personally, I don't like the second option and I'd go with the first one. Let me know
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.
Thank you for your research on that! For me, the pencil in the first icon looks like the best option here :)
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.
Uploaded the first one for now
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.
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.
Option 1 looks best for me
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.
Great. All set then. Thanks for your feedback!
@@ -21,6 +21,9 @@ group.D2.ThemeChooser.description=Choose a theme for D2 diagram | |||
group.D2.LayoutChooser.text=Layout Chooser | |||
group.D2.LayoutChooser.description=Choose a layout for D2 diagram | |||
|
|||
action.D2.SketchMode.text=Sketch |
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.
Should it be Sketch Mode
instead?
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.
Ok, sure
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.
Changed
src/src/editor/D2CompilerState.kt
Outdated
@@ -13,6 +13,7 @@ internal class D2CompilerState( | |||
val port: Int, | |||
val theme: String?, | |||
val layout: D2Layout?, | |||
val sketch: Boolean?, |
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.
Can we switch to a nonnull type Boolean
here?
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.
I'll give it a try. This is my first time with Kotlin 😄
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.
Achieved 😄
src/src/editor/D2Viewer.kt
Outdated
internal data class D2FileEditorState(@JvmField var theme: D2Theme?, @JvmField val layout: D2Layout?) : FileEditorState { | ||
internal data class D2FileEditorState(@JvmField var theme: D2Theme?, | ||
@JvmField val layout: D2Layout?, | ||
@JvmField val sketch: Boolean?) : FileEditorState { |
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.
We could specify a default value here with @Default(false)
and make the field not nullable
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.
Couldn't find a suitable @default annotation, set the default with "= false"
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.
I'm not familiar with kotlinx.serialization enough. Sorry for a misleading suggestion :)
The default value looks like the right solution according to the docs.
- Changed Sketch Mode text - Made sketch Boolean non-nullable - Changed Sketch Mode icon (pending review)
Hey! I liked your plugin and really wanted to use the sketch mode, but since D2 parameters are not open to edit through an input field (this might be a nice option that allow people to play with D2 without major efforts) I forked your project and made this little enhancement. Hope it can be included in the original plugin!