Skip to content

Commit

Permalink
Add ADR-0042 and fix ADR-0036 (#12277)
Browse files Browse the repository at this point in the history
* Add ADR-0042

* Fix Markdown lint error

* Add link to 0036 to 0042
  • Loading branch information
InAnYan authored Dec 9, 2024
1 parent 2780c05 commit d7191c5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 3 deletions.
8 changes: 5 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 @@ -77,8 +77,10 @@ There seems to be only one package for JavaFX that provides a ready-to-use UI no

## More Information

This ADR is highly linked to [ADR-0042](./0042-use-webview-for-summarization-content.md).

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.
`Text` and `Label` as a whole or a part [cannot be selected and/or copied](https://bugs.openjdk.org/browse/JDK-8091644).
37 changes: 37 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,37 @@
---
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 d7191c5

Please sign in to comment.