Merge branch 'staging' into hidden-reasoning-tracking
| @@ -216,8 +216,6 @@ | ||
| 216 | 216 | |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | - #showRawPrompt, | |
| 220 | - #copyPromptToClipboard, | |
| 221 | 219 | #groupCurrentMemberPopoutButton, |
| 222 | 220 | #summaryExtensionPopoutButton { |
| 223 | 221 | display: none; |
| @@ -72,6 +72,10 @@ dialog { | ||
| 72 | 72 | overflow-x: auto; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | +.popup.left_aligned_dialogue_popup .popup-content { | |
| 76 | + text-align: start; | |
| 77 | +} | |
| 78 | + | |
| 75 | 79 | /* Opening animation */ |
| 76 | 80 | .popup[opening] { |
| 77 | 81 | animation: pop-in var(--popup-animation-speed) ease-in-out; |
| @@ -730,7 +730,7 @@ | ||
| 730 | 730 | <input type="range" id="top_k_openai" name="volume" min="0" max="500" step="1"> |
| 731 | 731 | </div> |
| 732 | 732 | <div class="range-block-counter"> |
| 733 | 733 | <input type="number" min="0" max="200500" step="1" data-for="top_k_openai" id="top_k_counter_openai"> |
| 734 | 734 | </div> |
| 735 | 735 | </div> |
| 736 | 736 | </div> |
| @@ -5514,7 +5514,7 @@ async function promptItemize(itemizedPrompts, requestedMesId) { | ||
| 5514 | 5514 | toastr.info(t`Copied!`); |
| 5515 | 5515 | }); |
| 5516 | 5516 | |
| 5517 | 5517 | popup.dlg.querySelector('#showRawPrompt').addEventListener('click', async function () { |
| 5518 | 5518 | //console.log(itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt); |
| 5519 | 5519 | console.log(PromptArrayItemForRawPromptDisplay); |
| 5520 | 5520 | console.log(itemizedPrompts); |
| @@ -5522,6 +5522,17 @@ async function promptItemize(itemizedPrompts, requestedMesId) { | ||
| 5522 | 5522 | |
| 5523 | 5523 | const rawPrompt = flatten(itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt); |
| 5524 | 5524 | |
| 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 | 5536 | //let DisplayStringifiedPrompt = JSON.stringify(itemizedPrompts[PromptArrayItemForRawPromptDisplay].rawPrompt).replace(/\n+/g, '<br>'); |
| 5526 | 5537 | const rawPromptWrapper = document.getElementById('rawPromptWrapper'); |
| 5527 | 5538 | rawPromptWrapper.innerText = rawPrompt; |
| @@ -46,6 +46,7 @@ export const POPUP_RESULT = { | ||
| 46 | 46 | * @property {boolean?} [transparent=false] - Whether to display the popup in transparent mode (no background, border, shadow or anything, only its content) |
| 47 | 47 | * @property {boolean?} [allowHorizontalScrolling=false] - Whether to allow horizontal scrolling in the popup |
| 48 | 48 | * @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 | 50 | * @property {'slow'|'fast'|'none'?} [animation='slow'] - Animation speed for the popup (opening, closing, ...) |
| 50 | 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 | 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 | 174 | * @param {string} [inputValue=''] - The initial value of the input field |
| 174 | 175 | * @param {PopupOptions} [options={}] - Additional options for the popup |
| 175 | 176 | */ |
| 176 | 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 | 178 | Popup.util.popups.push(this); |
| 178 | 179 | |
| 179 | 180 | // Make this popup uniquely identifiable |
| @@ -218,6 +219,7 @@ export class Popup { | ||
| 218 | 219 | if (transparent) this.dlg.classList.add('transparent_dialogue_popup'); |
| 219 | 220 | if (allowHorizontalScrolling) this.dlg.classList.add('horizontal_scrolling_dialogue_popup'); |
| 220 | 221 | if (allowVerticalScrolling) this.dlg.classList.add('vertical_scrolling_dialogue_popup'); |
| 222 | + if (leftAlign) this.dlg.classList.add('left_aligned_dialogue_popup'); | |
| 221 | 223 | if (animation) this.dlg.classList.add('popup--animation-' + animation); |
| 222 | 224 | |
| 223 | 225 | // If custom button captions are provided, we set them beforehand |
| @@ -146,5 +146,5 @@ | ||
| 146 | 146 | </div> |
| 147 | 147 | <hr> |
| 148 | 148 | <div id="rawPromptPopup" class="list-group"> |
| 149 | 149 | <div id="rawPromptWrapper" class="tokenItemizingSubclasstokenItemizingMaintext"></div> |
| 150 | 150 | </div> |
| @@ -262,6 +262,10 @@ input[type='checkbox']:focus-visible { | ||
| 262 | 262 | color: var(--SmartThemeEmColor); |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | +.tokenItemizingMaintext { | |
| 266 | + font-size: calc(var(--mainFontSize) * 0.8); | |
| 267 | +} | |
| 268 | + | |
| 265 | 269 | .tokenGraph { |
| 266 | 270 | border-radius: 10px; |
| 267 | 271 | border: 1px solid var(--SmartThemeBorderColor); |