Skip to content

Commit

Permalink
Improved "thinking" to use bubble and better formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jukofyork committed Nov 20, 2024
1 parent 0e2a9db commit 3589ed0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
23 changes: 17 additions & 6 deletions eclipse.plugin.aiassistant/css/main-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
--blockquote-text-color: #bbb;
--blockquote-nested-text-color: #999;
--blockquote-line-color: #333;
--thinking-header-color: #ddd;
--selected-shadow-blur-radius: 15px;
--default-margin: 0.5rem;
--top-margin: 1rem;
Expand Down Expand Up @@ -178,14 +177,26 @@ blockquote blockquote {
margin-left: 0em;
}

.thinking {
background-color: var(--user-bubble-bg-color);
border-radius: var(--bubble-radius);
padding: var(--small-padding);
}

.thinking summary {
color: var(--thinking-header-color);
color: var(--text-color);
opacity: 0.8;
cursor: pointer;
padding: 0 var(--small-padding);
margin-left: calc(-1 * var(--default-margin));
}

/* Adjust spacing inside thinking blocks */
.thinking blockquote {
margin-top: 0.5em;
margin-bottom: 0;
.thinking details {
margin-left: var(--default-margin);
}

.thinking summary:hover {
opacity: 1;
}

/* The default margins are too large */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ enum BlockType { NONE, CODE, LATEX }
* @return HTML string containing the opening structure for a thinking block
*/
private static String getThinkingBlockOpeningHtml() {
return "<div class=\"thinking\"><details><summary>Thinking...</summary><blockquote>";
return "<div class=\"thinking\"><details><summary>Thinking...</summary>";
}

/**
Expand All @@ -197,7 +197,7 @@ private static String getThinkingBlockOpeningHtml() {
* @return HTML string containing closing tags for blockquote, details, and div elements
*/
private static String getThinkingBlockClosingHtml() {
return "</blockquote></details></div>";
return "</details></div>";
}

/**
Expand All @@ -211,7 +211,7 @@ private static String getThinkingBlockClosingHtml() {
*/
private static String trimThinkingyBlock(String html) {
return html
.replaceAll("</summary>\\s*<blockquote>(?:\\s|<br/>)+", "</summary><blockquote>")
.replaceAll("</summary>(?:\\s|<br/>)+", "</summary><br/>")
.replaceAll("</details>\\s*</div>(?:\\s|<br/>)+", "</details></div><br/>");
}

Expand Down

0 comments on commit 3589ed0

Please sign in to comment.