Merge branch 'staging' into hidden-reasoning-tracking

This commit is contained in:
Cohee 2025-02-10 21:49:11 +02:00
commit ad845b5fbf
7 changed files with 25 additions and 6 deletions

View File

@ -216,8 +216,6 @@
}
#showRawPrompt,
#copyPromptToClipboard,
#groupCurrentMemberPopoutButton,
#summaryExtensionPopoutButton {
display: none;

View File

@ -72,6 +72,10 @@ dialog {
overflow-x: auto;
}
.popup.left_aligned_dialogue_popup .popup-content {
text-align: start;
}
/* Opening animation */
.popup[opening] {
animation: pop-in var(--popup-animation-speed) ease-in-out;

View File

@ -730,7 +730,7 @@
<input type="range" id="top_k_openai" name="volume" min="0" max="500" step="1">
</div>
<div class="range-block-counter">
<input type="number" min="0" max="200" step="1" data-for="top_k_openai" id="top_k_counter_openai">
<input type="number" min="0" max="500" step="1" data-for="top_k_openai" id="top_k_counter_openai">
</div>
</div>
</div>

View File

@ -5514,7 +5514,7 @@ async function promptItemize(itemizedPrompts, requestedMesId) {
toastr.info(t`Copied!`);
});
popup.dlg.querySelector('#showRawPrompt').addEventListener('click', function () {
popup.dlg.querySelector('#showRawPrompt').addEventListener('click', async function () {
//console.log(itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt);
console.log(PromptArrayItemForRawPromptDisplay);
console.log(itemizedPrompts);
@ -5522,6 +5522,17 @@ async function promptItemize(itemizedPrompts, requestedMesId) {
const rawPrompt = flatten(itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt);
// Mobile needs special handholding. The side-view on the popup wouldn't work,
// so we just show an additional popup for this.
if (isMobile()) {
const content = document.createElement('div');
content.classList.add('tokenItemizingMaintext');
content.innerText = rawPrompt;
const popup = new Popup(content, POPUP_TYPE.TEXT, null, { allowVerticalScrolling: true, leftAlign: true });
await popup.show();
return;
}
//let DisplayStringifiedPrompt = JSON.stringify(itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt).replace(/\n+/g, '<br>');
const rawPromptWrapper = document.getElementById('rawPromptWrapper');
rawPromptWrapper.innerText = rawPrompt;

View File

@ -46,6 +46,7 @@ export const POPUP_RESULT = {
* @property {boolean?} [transparent=false] - Whether to display the popup in transparent mode (no background, border, shadow or anything, only its content)
* @property {boolean?} [allowHorizontalScrolling=false] - Whether to allow horizontal scrolling in the popup
* @property {boolean?} [allowVerticalScrolling=false] - Whether to allow vertical scrolling in the popup
* @property {boolean?} [leftAlign=false] - Whether the popup content should be left-aligned by default
* @property {'slow'|'fast'|'none'?} [animation='slow'] - Animation speed for the popup (opening, closing, ...)
* @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`.
* @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 {
* @param {string} [inputValue=''] - The initial value of the input field
* @param {PopupOptions} [options={}] - Additional options for the popup
*/
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 } = {}) {
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 } = {}) {
Popup.util.popups.push(this);
// Make this popup uniquely identifiable
@ -218,6 +219,7 @@ export class Popup {
if (transparent) this.dlg.classList.add('transparent_dialogue_popup');
if (allowHorizontalScrolling) this.dlg.classList.add('horizontal_scrolling_dialogue_popup');
if (allowVerticalScrolling) this.dlg.classList.add('vertical_scrolling_dialogue_popup');
if (leftAlign) this.dlg.classList.add('left_aligned_dialogue_popup');
if (animation) this.dlg.classList.add('popup--animation-' + animation);
// If custom button captions are provided, we set them beforehand

View File

@ -146,5 +146,5 @@
</div>
<hr>
<div id="rawPromptPopup" class="list-group">
<div id="rawPromptWrapper" class="tokenItemizingSubclass"></div>
<div id="rawPromptWrapper" class="tokenItemizingMaintext"></div>
</div>

View File

@ -262,6 +262,10 @@ input[type='checkbox']:focus-visible {
color: var(--SmartThemeEmColor);
}
.tokenItemizingMaintext {
font-size: calc(var(--mainFontSize) * 0.8);
}
.tokenGraph {
border-radius: 10px;
border: 1px solid var(--SmartThemeBorderColor);