* Update - Revert connection profile change TC commands load order
This change was made to prevent preset tied samplers from breaking, such thing doesn't exist anymore.
* Update - Unlink preset renaming logic from sampler selection lock
* Update - Link TC sampler selection lock to API Type
* Fix - Clean comments
* Update - Use localforage selectedSamplers and data selectsampler as main sampler selection storage
* Fix - ESLint errors
* Update - Change lock tooltip with correct description
* Fix - Move and await sampler select localforage initializer to finish
Tried to move it to the most reasonable place possible that allowed to make an await.
* Fix - Make loadTextGenSettings async to load API selected samplers
* Preserve media playback state when running appendMediaToMessage
* Better selector specificity
* Fix local variable name
* Move typedef to global.d.ts
* Check for readyState on save/restore
* Only check for currentSrc on restoration callback
* feat: improve multiline input handling in popups
- Added Ctrl+Enter requirement for submission in multiline input popups to prevent accidental sends
- Exported PopupUtils class for external use
* refactor: remove redundant higher/different rows from input popups
- Removed rows: 2 from callGenericPopup calls where default behavior is sufficient
- Increased rows from 2 to 4 in caption extension for better multiline input experience
* Add captioning for video attachments
* Unify error toast titles
* Add MEDIA_SOURCE enum and update media handling to include source information
* Unify attachment handling logic
* Add error handling for auto-captioning failures
* Use string formatting for console error
* Add audio-player component
* Enhance audio player functionality and styles
- Adjust audio player layout and styles in CSS for better spacing and alignment.
- Add audio element to message template in HTML.
- Implement audio attachment handling in JavaScript, including a new AudioPlayer class.
- Update media attachment structure to include titles for audio files.
- Extend supported media file types in constants.
* Add audio inlining control
* Fix file formats list
* Simplify hints
* Add to prompt
* Add progress title hint
* Add to scrollOnMediaLoad
* Add audio size hint
* Add gallery controls
* Delete removed media attachments from server
* Adjust min width
* No-op when swiping a singular media
* Fix clean-up
* Fix silent deletion logic
* More accurate media prompt estimations
* Round durations with ceiling function
* Adjust rounding logic
* you don't have to say it twice
* Export deleteFileFromServer
* Don't reference module from HTML
* Clean-up styles
* Move formatTime to utils
* Add fa-fw to delete
* fix(IME): Prevent Esc from closing editor during composition
When using a Chinese IME, pressing the Escape key during composition should cancel the composition, not close the message editor.
This commit fixes the issue by adding a check for `!e.isComposing` to the 'keyup' event listener for the Escape key in `public/script.js`. This ensures that the editor is only closed when the Escape key is pressed outside of an IME composition session.
* fix(IME): Change the handler of 'Escape' from 'keyup' to 'keydown'
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
* Support multiple images in single API response
* Fix media wrapper clashing with swipe counter
* Return an empty array, add additional filtering
* Add index to inline image filenames in processImageAttachment
* Multiple file uploads
* mes_img_wrapper
* mes_video_wrapper
* Named export instead of function wrapper
* Update public/scripts/chats.js
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* Fix optional chaining for message extra
* Preserve existing files with paste
* Improve swipe message extras clean-up
* Clean-up: Add chat_backgrounds to known images
* Add ensureMessageMediaIsArray to getContext
* Fix compatibility warning
* Update to media array
* Move de-dupe check logic
* Fix comment
* Fix clean-up logic
* Improve typing
* `feat/multi-file` Added a toggle between the old gallery and new image list. (#4722)
* Added "Toggle Gallery" button.
Added `getContainerInfo`.
* Refactor
* Change checkbox toggle to select
* Ensure media_display is set correctly only if any image_swipes were migrated
* Rename function
* Support Date in parseTimestamp
* Add type to main chat array
* Add media display reload prompt
---------
Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Use a single wrapper block for media
* Fix type annotation
* Fix video display in list mode
* Refactor saveImageToMessage to include title in media object
* Use named constants in migrateMediaToArray
* Update img control styles
* Fix error container state
* Refactor onImageSwiped
* Remove redundant event handler
* Refactor expandMessageMedia
* Use shared function for display handling, fix notice logic
* Enhance ChatMessage and ChatMessageExtra types
* Refactor media display reload logic
* Improve styling for media containers
* Adjust spacing in file form styles
* Fix scroll handling in appendMediaToMessage
* Reduce flicker in appendMediaToMessage
* Extract scrollOnMediaLoad func
* Improve scroll behavior in gallery display
* Improve delegation for click events
* Add file d&d handler to #form_sheld
* Improve scroll adjust for slow connections
* Adjust debounce timeout
* Add messageMedia enum provider
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: DeclineThyself <FallenHaze@tutamail.com>
Co-authored-by: user <user@exmaple.com>
* - Removed unneccessary check for swipe info. Swipes are valid and can be read by the chat message UI just fine without the dates and details surrounding generation settings.
* + Swipe info will now be backfilled if it's missing using placeholder data, to improve compatibility.
* + Fix big oopsie.
* + Fix discarding all scenarios aside from the first one, which would cause all chats other than the first one to be lost.
+ Accumulate alternative starting messages from all scenarios, as different scenarios are how Backyard handles having alternative greetings. A scenario with multiple messages in its "firstMessages" array is invalid as per BYAF spec.
+ Return scenarios so that they can be used to populate chats, scenario overrides, and in the future, the other character settings overrides as well.
* + Added support for importing chats (including swipes) from BYAF. This brings the core functionality of BYAF imports mostly in-line with the standard, without the inclusion of any features that are currently missing from ST.
> The only supported feature not yet implemented is scenario overrides per-chat. This will be the the goal of the next commit.
* + Implemented scenario overrides, fully bringing ST's BYAF import as in-line with the BYAF standard as possible without adding new feature functionality to ST.
+ Also added some new chat metadata fields in preparation for example message and system prompt overrides.
* + Added support for pulling alternate icons from the BYAF archive. They are not used yet, but they are safely stored.
+ Added support for pulling backgrounds from the BYAF archive. They are not used yet but they are stored and linked to the chats they originally belonged to.
+ Saved every remaining field that was previously discarded from BYAF that a user actually needs in a way that could be used in the future, and can be accessed by the user if needed after import. Any fields that are not preserved at this point are specfic to either Backyard AI's desktop application, or to the BYAF manifest itself, and therefore have no relevance to a user.
> With this, BYAF import should be fully supported and in-line with the official spec.
* + Updated comments and method names to reflect changes appropriately. First round of touch ups.
* + More comment updates.
* - Removed commented code, that is no longer needed for reference.
* > No longer sanitize for filenames in the character card, as there's no need. The sanitization now happens when generating the filename, which is subsequently used for file operations.
+ Added replacement function for sanitizing filenames which uses visually similar but valid for filenames replacement characters instead of deleting the characters for better data parity.
* + Preserve isNSFW flag as a tag, so it's not lost on import.
* + preserve labels on character alt avatars
* + Deduplicate first messages, so that 5 chats with the same first message don't create 5 identical first messages.
* + Adjusted icon naming logic to produce more sensible results.
* > User path.basename and path.extname for getting the base name and extension of files, respectively.
* > Should use camelCase for local function names.
* > Use a set for greetings instead of explicitly checking for duplicates.
* > Missed a snake case local function name.
* > Updated background import logic to integrate with existing per-chat background system.
* + Updated logic to skip import of chats and backgrounds when a character is being updated/replaced.
* + Added copy of getUniqueName helper function from frontend utils to backend utils.
+ Refactored duplicated logic for getting unique filenames for backgrounds and character alt icons to use the newly available function.
* > fixed adding an extra dot to the filenames for icons after switching to path.extname for getting the extension
* > Updated metadata settings generation in byaf chat so that it doesn't overwrite valid yet 'falsy' values with defaults. Oops
* > Remove variable for configuration that will likely never need to exist.
* > custom_background should be an empty string if chat_background is falsy
* > Make an array empty if chat_background is falsy.
* > Prefer camelCase for local variable names.
* + Added definitions for ByafParseResult and ByafChatBackground.
> Updated overused and unweildy anonymous types to the newly defined types.
* + When importing a character with chats, the character will now no longer open to a new empty chat, but instead will pick the first of the imported chats to open up to.
* Rename prev_paths => paths
* Prettify logs display
* Set fallback chat name if scenario is untitled
* card.data.name => card.name
* Optimize first scenario message access
* + Moved custom replacement function from importFromByaf into util.js as sanitizeSafeCharacterReplacements() so that the replacement logic may be reused anywhere for consistency.
* > Missed a couple. Updated for consistency
* + Preserve character full/display name without it needing to be safe as a filename.
> Change logic for naming the folder the alt images live in to match the logic the sprites endpoint uses to get character sprites for consistency
* > Only add full_name extension if displayName exists.
* full_name => display_name
* - No longer use safe lookalike replacements for filename sanitization to be consistent with how web browsers sanitize invalid characters in filenames before saving to disk.
* Tiny formatting fix
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* + Implemented support for overrides of system prompt and example messages from chat metadata. This is needed for BYAF import parity. No UI for modifying these yet, but they're easily changeable in the chat files already. These metadata settings are already supported by BYAF import as of the last commit so this just enables them.
* + Updated scenario overrides popup to now be a character settings overrides popup.
+ Updated the template to have a new section for example messages and system prompts
+ Updated the logic to handle all three overrides
+ Updated logic to only save when the popup is closed, instead of on every character input.
* Preserve import, allow scrolling
* Add confirmation on override removal. Always save pending changes.
* Update dialog layout, add editor expand buttons
* Fix mes examples override in group chats with Join mode
* Update group chat button title
* Specify that Prefer Char. Prompt is a requirement
* Fix group join mode not replacing macros in overrides
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Add UI elements
* Add support for model configuration
* fix: update API request parameters for improved handling
* Add logo img
* Fix tool calling with negative index
* Include tool calls into 'last in context' calculation
* feat: add support for captioning
* Refactor message edit, show counters on last message
* fix: add warnings for missing message in chat array and DOM during edit
* Export messageEdit function
* Formatting fix
* Fix comment alignment
* Fix off-by-one cases in user prompt filler logic
Fixes#4645
* Skip inject pre-allocation in CC prompts
* Fix filler insert on continuing on user message
* feat: prevent scrolling of containers when using focused number inputs
#4607
* feat: enhance number input wheel behavior with slider sync and Firefox support
* refactor: optimize number input wheel handler with native DOM methods and type checks
* Refactor: Move into dom-handlers folder
* refactor: use optional chaining for slider element selection
* Simplify file paths
* Unlock scroll to edit in misc controls
* refactor: throttle wheel event handler updates
* refactor: Extract value update into a function
* fix: NaN-aware value clamping
* fix: Add sanity checks for input value calculations
---------
Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
* fix: reprint non-tainted group chat on switching personas
* feat: mark chat as tainted when sending user message
* feat: mark chat as tainted when adding custom messages or captions
* feat: export createOrEditCharacter function and integrate it into retriggerFirstMessageOnEmptyChat
* fix: optimize loadPersonaForCurrentChat by storing current chat ID in a variable
* Improve conditions of first message retrigger
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* fix: do not jumo to chat twice on new group chat with delete
* fix: prevent metadata reset when deleting non-active group chat
* Bring back group chat splice call
* Always delete past group metadata on chat delete
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* feat: allow create new world books via /getpersonabook and /getcharbook
Refactor character world info management into dedicated functions
Extract character world assignment logic from UI handlers into reusable functions
Add support for automatic lorebook creation in slash commands
Improve code maintainability by centralizing world info operations
* refactor: update boolean enum provider from onOffToggle to trueFalse in world info commands
* fix: improve world info name uniqueness check using getUniqueName utility
* Unset current persona WI on file deletion
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>