* charQR
* fix
* fix_2
* fix_3
* Fix refresh errors and Implement confirmation dialog logic
* FIX : The character's quick reply set is executed three times during the initial authorization and import.
* Enhance warning dialog content and layout
* refactor: Use local linking for Char QR sets instead of embedding
* Lint fixes
* Clean-up
* Emit CHAT_CHANGED on character deletion
* Remove isVisible filter, I'm sure it was by design
* Revert order of search in executeQuickReplyByName
* fix: Address review comments
* Add private tag to Char Sets
* Add QR rebind on renamed character
* Clean-up diff
* Don't save empty config lists
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
The problem: Auto-scroll is overly sticky. While a generated message is streaming in, it is almost impossible to cancel the auto-scroll behavior by scrolling up, it just snaps back down.
The reason is that the 'wheel' and 'touchmove' events trigger before the scroll position is updated. So the scrollIsAtBottom value never becomes false. That is, unless the user manages to scroll up quick enough to beat the call to scrollChatToBottom() in onProgressStreaming().
The 'scroll' event is better because it fires slightly later in the scroll behavior. This makes canceling auto-scroll by scrolling up much more reliable.
Making auto-scroll cancelling more reliable has the side effect that resuming auto-scroll becomes harder. To even this out, this change slightly increases the tolerance for resuming auto-scroll to 5 pixels. This is small enough to be generally unnoticeable but significantly easier to hit than the previous 1 pixel.
I tested this change in
* Firefox on Linux
* Chrome on Linux
* Firefox on Android
* Chrome on Android
In all cases, the auto-scroll behavior is greatly improved:
* While auto-scrolling, scrolling a little bit up immediately cancels the auto-scroll behavior.
* Scrolling all the way down resumes the auto-scroll behavior.
* TC/AF: Add Story String position
* Update public/scripts/power-user.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add before/after anchors as story string params
* Move autofix story string at settings load
* Substitute in story string wrappers
* Only add an auto-newline after story string if wrap is enabled
* Do not init names_force_groups with default value
* Update default settings
* Auto-delete obsolete fields from instruct templates
* Update default templates
* Remove newline from GLM-4 prefix
* Format as one line
* Remove auto-fix leftovers from renderStoryString
* Remove pointless reassignments in autoFixMissingField
* Update KoboldAI template
* Add info hint for Story String sequences
* Update default templates
* Reformat extractMessageFromData
* Fix condition in autoFixStoryString
* Update tooltip text for Story String Sequences
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fixes#4324: injectedIndices becomes invalidated with a off-by-one index shift when PHI/jailbreak message is added. Could lead to dropped injections/history.
* Run formatter
* Fix pre-allocation of injections in Text Completions prompt builder
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Add generation type triggers to world info
* Simplify includes check
* Refactor getEntryField validation and default value handling
* Remove invalid attribute
* Check for a valid trigger
* Move search bar under buttons
Closes#4275
* Remove horizontal rules from right menu
* Add toggle for search form
* Add container for extension rm buttons
* Be square or be there
* Adjust font sizes
* Square enlargement program
* Adjust margins
* Remove margin from pagination outlet buttons
* Adjust margin on tag controls
* Collapse 1px margins
* Update public/script.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Remove variable assignment
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* CC/PM: Add generation type trigger prompt filter
Closes#4276
* Fix element cast type
* Narrower element types
* Change trigger to multiple select
* Extract class scope function
* Fix control name
* Add 'enabled' property to Prompt class and update type annotations in PromptManager methods
* Clarify placeholder of multiselect
* Added structured output for common APIs
* eslint
* Added frontend impl
* Type name change
* Unprefix json_schema, apply review suggestions
* Add schema to generateQuietPrompt, add comments
* Prettify diff
* Extract JSON from Claude response
* Add structured gen for Mistral
* Hack to support schema for DeepSeek
* Hack JSON schema for AI21
* Add Groq structured gen
* Add JSON mode for pollinations
* Add JSON schema for perplexity
* Add JSON schema for AIML
* Using extractJsonFromData in custom-request, added google rules for flattenSchema
* Fix response parsing
* Fix Google
* Fixed json parse
* Expose generateRaw to getContext
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* adding capability for generateRaw() to specify roles of messages for chat completion
* linting
* additional comments
* Apply review comments, fix type errors
* Fix joiner for non-instruct prompts
* Format joint prompt for novel, fix prefix for non-instruct
* Fix role for string prompts
* Do not trim sysprompt for instruct
* Do not prefix names for CC
* Append newline to systemPrompt in instruct
---------
Co-authored-by: qvink <qvink@users.noreply.github.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Move app events to separate module
* Add event emission for preset changes and deletions
* Remove unnecessary blank line at the beginning of events.js
* Add await to selectPreset call in initTextGenSettings
* Emit events for preset deletion and change in initPresetManager
* Move event emit out of PRESET_CHANGED
* Adding toggle.
* Adding events for the new toggle. Reloading chat when toggled.
* Adding chat reload when tags are added or removed to char.
* Adding main applyCharacterTagsToMessageDivs function to add tags to divs.
* Adding information that the class name is normalized and lowercased to the tooltip.
* Correcting console.traces to console.debug for minimal console printing.
* Lint indentation fix.
* Adding simple cache.
* Adding reload event when a new message is added to chat.
* Changing tags applied from classes to HTML data API.
* Adding guide showing how to select data attributes with CSS.
* Fixing trailing comma pointed out by lint.
* Simplifying re-rendering by deleting previous attributes.
* Adding the feature as default behavior, removing toggles. Will add docs to ST docs.
* Removing code that is no longer needed.
* Re-rendering divs after other tag operations.
* Filtering message ids to only re-render specific divs. Adding suggested changes.
* After testing, it seems to add all messages by one, so it appears it's not needed call this in the printMessages function.
* Lint fixes.
* Cache jquery selector
* Fix local variables assignment
* Move new functions to tags module
* Normalizing tag names before adding them as data-*
* Replace commas with spaces to avoid issues with tag names containing commas.
* Correcting where the comma replacing should go.
* Add error handling for applyCharacterTagsToMessageDivs
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* refactor: ♻️ Replace deprecated code defined within this repository
- Replace ““/public/scripts.js” > `callPopup`” with ““/public/scripts/popup.js” > `callGenericPopup`”.
- Replace ““/public/scripts/tokenizers.js” > `getTokenCount`” with ““/public/scripts/tokenizers.js” > `getTokenCountAsync`”.
- Replace ““/public/scripts/extensions/assets/index.js” > `executeSlashCommands`” with ““/public/scripts/extensions/assets/index.js” > `executeSlashCommandsWithOptions`”.
* refactor: ♻️ Replace deprecated code from standard library
1. Replace set of deprecated `escape` and deprecated `unescape` functions with `encodeURIComponent` and `decodeURIComponent` functions.
2. Replace set of `encodeURIComponent` and deprecated `unescape` functions with a custom `convertTextToBinaryString` function.
* refactor: ♻️ Replace deprecated code imported from external library
All of them is from jQuery.
1. Replace `$(document).ready(() => { ... })` → `jQuery(() => { ... })`.
2. Replace event type direct calls.
1) Change
- `$('...').change(function () { ... })` → `$('...').on('change', function () { ... })`.
2) Click
- `$('...').click(function () { ... })` → `$('...').on('click', function () { ... })`.
- `$('...').click()` → `$('...').trigger('click')`.
3) Focus
- `$('...').focus(function () { ... })` → `$('...').on('focus', function () { ... })`.
- `$('...').focus()` → `$('...').trigger('focus')`.
4) Blur
- `$('...').blur(function () { ... })` → `$('...').on('blur', function () { ... })`.
5) Keyup
- `$('...').keyup(function () { ... })` → `$('...').on('keyup', function () { ... })`.
* refactor(Attachment): ♻️ Merge `convertTextToBinaryString` and `convertTextToBase64`
`convertTextToBase64` function use `Uint8Array.prototype.toBase64` if supported by the Browser and use a combination of `Window.btoa` and `String.fromCharCode` as fallback.
* fix: 🐛 Fix Bind World Info to Character Card
Using the new `Popup` class.
* fix: 🐛 Fix Bind World Info to Character Card
Using the new `Popup` class.
* refactor: 🐛 Refactor and fix Character World Info popup
Add singleton back and some optimization.
- **🛡️ Singleton Pattern:** Implemented a singleton pattern using the `characterWorldPopup` variable. This prevents multiple instances of the popup from being created, ensuring a clean and predictable UI. If the popup is already open, it will be brought into focus instead of creating a duplicate.
- **♻️ Improved Readability:** The event handling logic has been extracted into clearly named functions (`handlePrimaryWorldSelect`, `handleExtrasWorldSelect`), making the `Popup` constructor cleaner and the overall code more readable and maintainable.
- **⚙️ Optimized Performance:** The new implementation caches frequently accessed values and jQuery selectors, reducing redundant DOM lookups and improving performance.
---
* refactor(Chat): ♻️ Modernize chat deletion confirmation
Replaces the deprecated `callPopup` with the modern `callGenericPopup` for the chat deletion confirmation dialog.
* Fix /delchat command
* Remove unused code
* Fix type. Change value to debug log
* Remove value logs
* Remove singleton pattern for openCharacterWorldPopup
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* feature: customizable mappings for presets per chat template
This adds the ability to assign custom context/instruct presets on a per-chat-template(-hash) basis. Users using custom templates may use this feature to auto-enable the preset of their choice, rather than the built-in defaults.
* fix: do not use chat tempate based instruct preset derivation if a preset was auto-selected already
This fixes issues where regex matched presets are overridden.
* reset chat template hash on connect
* handle derive_mappings being null
* unorthodox eslint requirement adherence
* button styling
* un-nest derivation related properties
* Migrate setting
* add bind model to preset button to the miscellaneous section
* switch to unified button for model preset mappings
* fix bind UI
* eslint
* do not include koboldcpp/ggml-model-xxx.gguf in preset saving
* review fixes
* stray console.log / eslint
* Update checkbox state if no model map exists
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>