Merge branch 'staging' into hidden-reasoning-tracking

ad845b5fbf3cf275f2cbd8b03212d2c8ad3780bd

Cohee <18619528+Cohee1207@users.noreply.github.com>

7 files changed, +25 -6Ignore whitespace
public/css/mobile-styles.css+0 -2
@@ -216,8 +216,6 @@
216216
217 }217 }
218218
219 #showRawPrompt,
220 #copyPromptToClipboard,
221 #groupCurrentMemberPopoutButton,219 #groupCurrentMemberPopoutButton,
222 #summaryExtensionPopoutButton {220 #summaryExtensionPopoutButton {
223 display: none;221 display: none;
public/css/popup.css+4 -0
@@ -72,6 +72,10 @@ dialog {
72 overflow-x: auto;72 overflow-x: auto;
73}73}
7474
75.popup.left_aligned_dialogue_popup .popup-content {
76 text-align: start;
77}
78
75/* Opening animation */79/* Opening animation */
76.popup[opening] {80.popup[opening] {
77 animation: pop-in var(--popup-animation-speed) ease-in-out;81 animation: pop-in var(--popup-animation-speed) ease-in-out;
public/index.html+1 -1
@@ -730,7 +730,7 @@
730 <input type="range" id="top_k_openai" name="volume" min="0" max="500" step="1">730 <input type="range" id="top_k_openai" name="volume" min="0" max="500" step="1">
731 </div>731 </div>
732 <div class="range-block-counter">732 <div class="range-block-counter">
733 <input type="number" min="0" max="200" step="1" data-for="top_k_openai" id="top_k_counter_openai">733 <input type="number" min="0" max="500" step="1" data-for="top_k_openai" id="top_k_counter_openai">
734 </div>734 </div>
735 </div>735 </div>
736 </div>736 </div>
public/script.js+12 -1
@@ -5514,7 +5514,7 @@ async function promptItemize(itemizedPrompts, requestedMesId) {
5514 toastr.info(t`Copied!`);5514 toastr.info(t`Copied!`);
5515 });5515 });
55165516
5517 popup.dlg.querySelector('#showRawPrompt').addEventListener('click', function () {5517 popup.dlg.querySelector('#showRawPrompt').addEventListener('click', async function () {
5518 //console.log(itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt);5518 //console.log(itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt);
5519 console.log(PromptArrayItemForRawPromptDisplay);5519 console.log(PromptArrayItemForRawPromptDisplay);
5520 console.log(itemizedPrompts);5520 console.log(itemizedPrompts);
@@ -5522,6 +5522,17 @@ async function promptItemize(itemizedPrompts, requestedMesId) {
55225522
5523 const rawPrompt = flatten(itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt);5523 const rawPrompt = flatten(itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt);
55245524
5525 // Mobile needs special handholding. The side-view on the popup wouldn't work,
5526 // so we just show an additional popup for this.
5527 if (isMobile()) {
5528 const content = document.createElement('div');
5529 content.classList.add('tokenItemizingMaintext');
5530 content.innerText = rawPrompt;
5531 const popup = new Popup(content, POPUP_TYPE.TEXT, null, { allowVerticalScrolling: true, leftAlign: true });
5532 await popup.show();
5533 return;
5534 }
5535
5525 //let DisplayStringifiedPrompt = JSON.stringify(itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt).replace(/\n+/g, '<br>');5536 //let DisplayStringifiedPrompt = JSON.stringify(itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt).replace(/\n+/g, '<br>');
5526 const rawPromptWrapper = document.getElementById('rawPromptWrapper');5537 const rawPromptWrapper = document.getElementById('rawPromptWrapper');
5527 rawPromptWrapper.innerText = rawPrompt;5538 rawPromptWrapper.innerText = rawPrompt;
public/scripts/popup.js+3 -1
@@ -46,6 +46,7 @@ export const POPUP_RESULT = {
46 * @property {boolean?} [transparent=false] - Whether to display the popup in transparent mode (no background, border, shadow or anything, only its content)46 * @property {boolean?} [transparent=false] - Whether to display the popup in transparent mode (no background, border, shadow or anything, only its content)
47 * @property {boolean?} [allowHorizontalScrolling=false] - Whether to allow horizontal scrolling in the popup47 * @property {boolean?} [allowHorizontalScrolling=false] - Whether to allow horizontal scrolling in the popup
48 * @property {boolean?} [allowVerticalScrolling=false] - Whether to allow vertical scrolling in the popup48 * @property {boolean?} [allowVerticalScrolling=false] - Whether to allow vertical scrolling in the popup
49 * @property {boolean?} [leftAlign=false] - Whether the popup content should be left-aligned by default
49 * @property {'slow'|'fast'|'none'?} [animation='slow'] - Animation speed for the popup (opening, closing, ...)50 * @property {'slow'|'fast'|'none'?} [animation='slow'] - Animation speed for the popup (opening, closing, ...)
50 * @property {POPUP_RESULT|number?} [defaultResult=POPUP_RESULT.AFFIRMATIVE] - The default result of this popup when Enter is pressed. Can be changed from `POPUP_RESULT.AFFIRMATIVE`.51 * @property {POPUP_RESULT|number?} [defaultResult=POPUP_RESULT.AFFIRMATIVE] - The default result of this popup when Enter is pressed. Can be changed from `POPUP_RESULT.AFFIRMATIVE`.
51 * @property {CustomPopupButton[]|string[]?} [customButtons=null] - Custom buttons to add to the popup. If only strings are provided, the buttons will be added with default options, and their result will be in order from `2` onward.52 * @property {CustomPopupButton[]|string[]?} [customButtons=null] - Custom buttons to add to the popup. If only strings are provided, the buttons will be added with default options, and their result will be in order from `2` onward.
@@ -173,7 +174,7 @@ export class Popup {
173 * @param {string} [inputValue=''] - The initial value of the input field174 * @param {string} [inputValue=''] - The initial value of the input field
174 * @param {PopupOptions} [options={}] - Additional options for the popup175 * @param {PopupOptions} [options={}] - Additional options for the popup
175 */176 */
176 constructor(content, type, inputValue = '', { okButton = null, cancelButton = null, rows = 1, wide = false, wider = false, large = false, transparent = false, allowHorizontalScrolling = false, allowVerticalScrolling = false, animation = 'fast', defaultResult = POPUP_RESULT.AFFIRMATIVE, customButtons = null, customInputs = null, onClosing = null, onClose = null, cropAspect = null, cropImage = null } = {}) {177 constructor(content, type, inputValue = '', { okButton = null, cancelButton = null, rows = 1, wide = false, wider = false, large = false, transparent = false, allowHorizontalScrolling = false, allowVerticalScrolling = false, leftAlign = false, animation = 'fast', defaultResult = POPUP_RESULT.AFFIRMATIVE, customButtons = null, customInputs = null, onClosing = null, onClose = null, cropAspect = null, cropImage = null } = {}) {
177 Popup.util.popups.push(this);178 Popup.util.popups.push(this);
178179
179 // Make this popup uniquely identifiable180 // Make this popup uniquely identifiable
@@ -218,6 +219,7 @@ export class Popup {
218 if (transparent) this.dlg.classList.add('transparent_dialogue_popup');219 if (transparent) this.dlg.classList.add('transparent_dialogue_popup');
219 if (allowHorizontalScrolling) this.dlg.classList.add('horizontal_scrolling_dialogue_popup');220 if (allowHorizontalScrolling) this.dlg.classList.add('horizontal_scrolling_dialogue_popup');
220 if (allowVerticalScrolling) this.dlg.classList.add('vertical_scrolling_dialogue_popup');221 if (allowVerticalScrolling) this.dlg.classList.add('vertical_scrolling_dialogue_popup');
222 if (leftAlign) this.dlg.classList.add('left_aligned_dialogue_popup');
221 if (animation) this.dlg.classList.add('popup--animation-' + animation);223 if (animation) this.dlg.classList.add('popup--animation-' + animation);
222224
223 // If custom button captions are provided, we set them beforehand225 // If custom button captions are provided, we set them beforehand
public/scripts/templates/itemizationChat.html+1 -1
@@ -146,5 +146,5 @@
146</div>146</div>
147<hr>147<hr>
148<div id="rawPromptPopup" class="list-group">148<div id="rawPromptPopup" class="list-group">
149 <div id="rawPromptWrapper" class="tokenItemizingSubclass"></div>149 <div id="rawPromptWrapper" class="tokenItemizingMaintext"></div>
150</div>150</div>
public/style.css+4 -0
@@ -262,6 +262,10 @@ input[type='checkbox']:focus-visible {
262 color: var(--SmartThemeEmColor);262 color: var(--SmartThemeEmColor);
263}263}
264264
265.tokenItemizingMaintext {
266 font-size: calc(var(--mainFontSize) * 0.8);
267}
268
265.tokenGraph {269.tokenGraph {
266 border-radius: 10px;270 border-radius: 10px;
267 border: 1px solid var(--SmartThemeBorderColor);271 border: 1px solid var(--SmartThemeBorderColor);