| nav_order | 28 |
|---|---|
| parent | Decision Records |
This decision record concerns the UI component that is used for rendering the content of chat messages.
- Looks good (renders Markdown)
- Can select and copy text
- Have good performance
- Use TextArea
- Use a third-party package
- Use a Markdown parser and convert AST nodes to JavaFX TextFlow elements
- Use a Markdown parser to convert content into HTML and use a WebView for one message
- Use a Markdown parser and WebView for the whole chat history
Chosen option: "Use TextArea". All other options require some time to implement. Some of the options doesn't support text selection and copying, which for now we value better than Markdown rendering.
- Good, because it is easy to implement
- Good, because it supports text selection and copying
- Bad, because it cannot render Markdown
- Bad, because default JavaFX's
TextAreashrinks
There seems to be only one package for JavaFX that provides a ready-to-use UI node for Markdown rendering.
- Good, because it is easy to implement
- Good, because it renders Markdown
- Good, because it renders Markdown to JavaFX nodes (does not use a
WebView) - Good, because complex elements from Markdown are supported (tables, code blocks, etc.)
- Bad, because it has very strange issues and architectural flaws with styling
- Bad, because it does not support text selection and copying (because of underlying JavaFX
Textnodes)
- Good, because we will support Markdown
- Good, because no need to write a Markdown parser from scratch
- Good, because does not use a WebView
- Good, because easy styling
- Bad, because we need some time to implement Markdown AST -> JavaFX nodes converter
- Bad, because rendering tables and code blocks may be hard
- Bad, because it will not support text selection and copying
- Good, because there are libraries to convert Markdown to HTML
- Good, because may be easier to implement than other choices (except
TextArea) - Good, because it supports text selection and copying
- Bad, because it may be a problem to connect JavaFX CSS to
WebView - Bad, because one
WebViewfor one message is resourceful
- Good, because there are libraries to convert Markdown to HTML
- Good, because it supports text selection and copying
- Bad, because it may be a problem to connect JavaFX CSS to
WebView - Bad, because it may be a problem to correctly communicate with Java code and
WebViewto add new messages
Actually we used an ExpandingTextArea from GemsFX package so the content can occupy
as much space as it needs in the ScrollPane.
About the selection and copying, this goes down to fundamental issue from JavaFX.
Text and Label cannot be selected by any means.