Skip to content

Commit

Permalink
Add ADR-0042
Browse files Browse the repository at this point in the history
  • Loading branch information
InAnYan committed Dec 6, 2024
1 parent 0dad3e1 commit 3f82f9b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/decisions/0036-use-textarea-for-chat-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ nav_order: 0036
parent: Decision Records
---

# Use TextArea for Chat Message Content
# Use `TextArea` for Chat Message Content

## Context and Problem Statement

Expand Down Expand Up @@ -41,7 +41,7 @@ which for now we value more than Markdown rendering.

### Use a third-party package

There seems to be only one package for JavaFX that provides a ready-to-use UI node for Markdown rendering.
There seems to be [only one package](https://github.com/JPro-one/markdown-javafx-renderer) 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
Expand Down Expand Up @@ -81,4 +81,4 @@ Actually we used an `ExpandingTextArea` from `GemsFX` package so the content can
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.
`Text` and `Label` as a whole or a part [cannot be selected and/or copied](https://bugs.openjdk.org/browse/JDK-8091644).
38 changes: 38 additions & 0 deletions docs/decisions/0042-use-webview-for-summarization-content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
nav_order: 0042
parent: Decision Records
---

# Use `WebView` for Chat Message Content

## Context and Problem Statement

This decision record concerns the UI component that is used for rendering the content of AI summaries.

## Decision Drivers

Same as in [ADR-0036](./0036-use-textarea-for-chat-content.md).

## Considered Options

Same as in [ADR-0036](./0036-use-textarea-for-chat-content.md).

## Decision Outcome

Chosen option: "Use `WebView`".

Some of the options does not support selecting and copying of text. Some options do not render Markdown.

However, in contrary to [ADR-0036](./0036-use-textarea-for-chat-content.md), we chose here a `WebView`, instead of `TextArea`, because there is only one summary content in UI (when user switches entries, no new components are added, rather old ones are *rebinding* to new entry). It would hurt the performance if we used `WebView` for messages, as there could be a lot of messages in one chat.

## Pros and Cons of the Options

Same as in [ADR-0036](./0036-use-textarea-for-chat-content.md).

## More Information

This ADR is highly linked to [ADR-0036](./0036-use-textarea-for-chat-content.md).

About the selection and copying, this goes down to fundamental issue from JavaFX.
`Text` and `Label` as a whole or a part [cannot be selected and/or copied](https://bugs.openjdk.org/browse/JDK-8091644).

0 comments on commit 3f82f9b

Please sign in to comment.