File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -75,14 +75,16 @@ function addMessage(role, text) {
7575 const wrap = document . createElement ( "div" ) ;
7676 wrap . className = `msg ${ role } ` ;
7777 wrap . innerHTML = `
78- <div class="role ${ role } ">${ role } </div>
78+ <div class="role ${ role } ">${ role } ${ role === "tool" ? '<span class="chevron">▶</span>' : '' } </div>
7979 <div class="bubble"></div>` ;
8080 const bubble = wrap . querySelector ( ".bubble" ) ;
8181 bubble . textContent = text ;
8282 bubble . onclick = function ( ) {
8383 if ( bubble . scrollHeight > 100 && role === "tool" ) {
84- bubble . style . maxHeight = bubble . style . maxHeight == 'none' ? '' : 'none' ;
85- bubble . style . borderBottom = bubble . style . borderBottom == '' ? 'dotted 2px gray' : '' ;
84+ const expanded = bubble . style . maxHeight === 'none' ;
85+ bubble . style . maxHeight = expanded ? '' : 'none' ;
86+ bubble . style . borderBottom = expanded ? '' : 'dotted 2px gray' ;
87+ wrap . querySelector ( ".chevron" ) . style . transform = expanded ? '' : 'rotate(90deg)' ;
8688 }
8789 }
8890 msgsEl . appendChild ( wrap ) ;
Original file line number Diff line number Diff line change @@ -82,6 +82,15 @@ main {
8282 font-size : 60% ;
8383 max-height : 100px ;
8484 overflow : hidden;
85+ cursor : pointer;
86+ }
87+
88+ .chevron {
89+ display : inline-block;
90+ font-size : 10px ;
91+ margin-left : 6px ;
92+ transition : transform 0.2s ;
93+ vertical-align : middle;
8594}
8695
8796.composer {
You can’t perform that action at this time.
0 commit comments