Spaces:
Running
Running
ai: Use HTML for brain emoji in collapsible block.
Browse files- src/ui/reasoning.py +6 -2
src/ui/reasoning.py
CHANGED
@@ -34,9 +34,13 @@ def styles(reasoning: str, content: str, expanded: bool = False) -> str:
|
|
34 |
# so the block starts expanded when rendered in the browser.
|
35 |
open_attr = "open" if expanded else ""
|
36 |
|
|
|
|
|
|
|
|
|
37 |
# Return the full HTML string with inline CSS styles applied to create an eye-catching, user-friendly collapsible block.
|
38 |
# The <details> element acts as a toggleable container with smooth rounded corners and a dynamic shadow that subtly intensifies on hover.
|
39 |
-
# The <summary> element serves as the clickable header with a brain emoji to visually represent reasoning,
|
40 |
# featuring a color transition on hover to encourage user interaction.
|
41 |
# The reasoning text is enclosed in a <div> with generous spacing, a delicate top border, and crisp white text for excellent readability.
|
42 |
# The entire block uses a clean, modern sans-serif font and avoids any background color override to maintain design flexibility.
|
@@ -58,7 +62,7 @@ def styles(reasoning: str, content: str, expanded: bool = False) -> str:
|
|
58 |
user-select: none; /* Prevent text selection on click for cleaner interaction */
|
59 |
transition: color 0.25s ease-in-out; /* Smooth color transition when hovering */
|
60 |
" onmouseover="this.style.color='#FFD700';" onmouseout="this.style.color='white';">
|
61 |
-
|
62 |
</summary>
|
63 |
<div style="
|
64 |
margin-top: 12px; /* Clear separation between summary and content */
|
|
|
34 |
# so the block starts expanded when rendered in the browser.
|
35 |
open_attr = "open" if expanded else ""
|
36 |
|
37 |
+
# Use the HTML numeric character reference for the brain emoji instead of manual emoji character.
|
38 |
+
# This ensures consistent rendering and avoids direct emoji input.
|
39 |
+
emoji = "🧠" # Unicode code point U+1F9E0 for 🧠 emoji
|
40 |
+
|
41 |
# Return the full HTML string with inline CSS styles applied to create an eye-catching, user-friendly collapsible block.
|
42 |
# The <details> element acts as a toggleable container with smooth rounded corners and a dynamic shadow that subtly intensifies on hover.
|
43 |
+
# The <summary> element serves as the clickable header with a brain emoji represented by its HTML code to visually represent reasoning,
|
44 |
# featuring a color transition on hover to encourage user interaction.
|
45 |
# The reasoning text is enclosed in a <div> with generous spacing, a delicate top border, and crisp white text for excellent readability.
|
46 |
# The entire block uses a clean, modern sans-serif font and avoids any background color override to maintain design flexibility.
|
|
|
62 |
user-select: none; /* Prevent text selection on click for cleaner interaction */
|
63 |
transition: color 0.25s ease-in-out; /* Smooth color transition when hovering */
|
64 |
" onmouseover="this.style.color='#FFD700';" onmouseout="this.style.color='white';">
|
65 |
+
{emoji} Reasoning
|
66 |
</summary>
|
67 |
<div style="
|
68 |
margin-top: 12px; /* Clear separation between summary and content */
|