* Add customizable name builder and max tries to getUniqueName utility
- Add optional `nameBuilder` parameter to allow custom name formatting
- Add `maxTries` parameter to client-side version to prevent infinite loops
- Update JSDoc with new optional parameters
- Use nullish coalescing to set default name builder function
- Default name builder maintains existing "${baseName} (${i})" format
* Add startIndex option to getUniqueName utility for flexible name generation
* Enhance branch creation to use current chat name and ensure unique names
- Import `getCurrentChatDetails` from script.js
- Replace hardcoded branch name format with current chat name as base
- Add custom `buildBranchName` function to format branch names with suffix
- Strip existing " - Branch #N" suffixes before generating new branch name
- Use `getUniqueName` utility with `nameBuilder` to ensure unique branch names
- Remove unused `mainChat` variable and replace with `mainChatName`
* Enhance checkpoint creation to use current chat name and suggest unique names
- Import `getCurrentChatDetails` from script.js to get current chat name
- Add custom `buildCheckpointName` function to format checkpoint names with suffix
- Strip existing " - Checkpoint #N" suffixes before generating new checkpoint name
- Use `getUniqueName` utility with `nameBuilder` to ensure unique checkpoint names
- Pass `suggestedName` to template and popup input for better UX
- Replace manual loop with `getUniqueName`
* Remove automatic timestamp suffix from bookmark names
* Fix getUniqueName utility to correctly handle maxTries and return null on failure
* shut up copilot
* Strip legacy bookmark and branch name prefixes when generating unique names
- Add removal of old "Checkpoint #N - " prefix format in `buildCheckpointName`
- Add removal of old "Branch #N - " prefix format in `buildBranchName`
- Change `cleanName` from const to let to allow multiple replacements
- Ensures clean base names regardless of legacy or current naming format
* Unify chat timestamps format
* Handle ISO timestamps in stats.js
* Refactor timestamp parsing on server
* Switch to ISO timestamps for character/messages creation dates
* Fix type error
* Early exist in saveGroupChat if group not found
* Remove redundant fields from temp.chat export header
* Auto-fix char creation date format on edit
* Add name to fallback chat file names
* Rename parseTimestamp server side function
* Migrate group metadata to group chat files
* Skip migration if chat already has metadata
* Fix active group not being set on group conversion
* Improve types in createGroup
* Fix padding in hotswap group avatars
* Fix centering of empty hotswap avatar
* Added automatic backups of migrated data
* Fix 'OVERWRITE' for GC
* Fix metadata parsing order in migration
* Remove color accents from regular migration logs
* Always set gen_id in converted message
* Clone messages before conversion
* Reduce size of add/remove buttons
* Fix group chat file size calculation
* TC: Allow setting empty JSON schema
* Fix check for llamacpp schema
* Handle grammar/schema for Aphrodite
* Conditional include for guided_json
* Update default presets with null value
* Conditional include into payload for grammar/schema
* 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
* 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>
* 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: 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>
* refactor: allow popup okButton and cancelButton to be set to false to hide them, even if visible by default
* feat: add character replacement from online source URL
- add utility function to import anything from external URL (refactored from existing function)
- fix character replace toast showing "Created"
- fix thumbnails not refreshing for replaced char
- fix accidentally creating new chat on replace, instead of reloading the open chat
* fix: refresh avatar thumbnail only after successful character import and when character exists
* chore: fix lint, unused import
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* add first and last buttons to pagination
* Add i18n support
* Update pagination buttons font
---------
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>
* Add support for characterFilter to getEntryField and setEntryField
* No more conflicts between lint and autoformat
* Fix array type default values hint
* Properly capitalize name
* Fix search by name
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Secret manager (now for real)
* Refactor secret manager dialog
* Add error handling to secrets migration
* Adjust default value
* Add secret-id slash command
* Add secret management slash commands
* Improve type definitions
* Improve compatibility of UUID generator
* Add copy buttons to manager view
* Improve compatibility with Vertex AI service account
- Changed to input since textarea can't be used with datalist
- Unblock regular key placeholder
- Save email as a key label
- Interrupt validation if the input is a UUID (autocompleted)
* Add optional label input for secret values in key manager dialog
* Update masking rules
* /secret-id: make the arg "required" (it's not)