Commit Graph

86 Commits

Author SHA1 Message Date
Cohee 5512473b29 Extension management improvements (#5552)
* feat: enhance asset management with extension categories

Co-authored-by: Copilot <copilot@github.com>

* fix: enhance extension name validation in server endpoints

* feat: display extension author in the extensions list

* fix: unify server error response format

Co-authored-by: Copilot <copilot@github.com>

* feat: add splash on installing third-party for the first time

* fix: add URL format validation, unify validation error messages

Co-authored-by: Copilot <copilot@github.com>

* fix: apply object freeze to EMPTY_AUTHOR value

Co-authored-by: Copilot <copilot@github.com>

* fix: typecheck extensionName in API requests

Co-authored-by: Copilot <copilot@github.com>

* feat: add feature flag guard to extensions endpoints

Co-authored-by: Copilot <copilot@github.com>

* fix: parse URL before checking

Co-authored-by: Copilot <copilot@github.com>

* fix: use case insensitive regex check

* fix: make debug log more useful

Co-authored-by: Copilot <copilot@github.com>

* fix: add pre-validation of URL format and protocol

Co-authored-by: Copilot <copilot@github.com>

* fix: leaner installation success toast

* fix: settings data loss when extensions are disabled

* fix: don't try to auto-focus elements that don't exist

Co-authored-by: Copilot <copilot@github.com>

* fix: set Popup.defaultResult to negative

Co-authored-by: Copilot <copilot@github.com>

* revert: restore undefined default result

---------

Co-authored-by: Copilot <copilot@github.com>
2026-04-30 23:31:50 +03:00
Wolfsblvt 6a325d2b22 Add disabled property support to all popup input types (#5441)
Adds optional `disabled` boolean property to PopupInputConfiguration JSDoc and implements it across all input types (checkbox, text, textarea, number). When set to true, the input element will be rendered in a disabled state.
2026-04-13 19:39:16 +03:00
Copilot ff10249ab5 Add configurable welcome screen recent chats, fix pin loss on rename, and add popup number input validation (#5436)
* Add configurable recent chats settings and fix pin loss on chat rename

- Add gear icon button to welcome screen header for settings
- Settings popup with Max recent chats (default: 15) and Collapsed recent chats (default: 3) options
- Settings stored in accountStorage as 'recentChatsSettings'
- Add PinnedChatsManager.rename() to migrate pin state when chats are renamed
- Call rename() from both character and group chat rename functions

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/99fa84c4-a82b-4253-96ff-a0621fb63f5c

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Fix pin rename: use file_name with .jsonl extension to match stored pin keys

The data-file attribute contains chat_name (without .jsonl), but PinnedChatsManager
stores keys using file_name (with .jsonl). Append .jsonl to both old and new names
when calling PinnedChatsManager.rename() in character and group chat rename functions.

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/c8e4f720-1d0b-49ef-b57b-ba9d85c42d4f

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Refactor to support number inputs

* Restore package-lock

* Use clamp() from utils.js instead of manual Math.min/Math.max

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/1669884c-1bd3-4b60-808d-5610f24838e6

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Revert unintended package-lock.json changes

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/1669884c-1bd3-4b60-808d-5610f24838e6

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Use input values instead of magic numbers

* Add auto-clamping on number inputs in popups and range placeholders in welcome-screen settings

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/9af8ad07-77bc-46db-9ec6-0030fecf0f8d

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Use constants for min/max chat limits to avoid hardcoded duplication in tooltips

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/9af8ad07-77bc-46db-9ec6-0030fecf0f8d

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Improve input validation by using Number.isFinite for min/max values in Popup class

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-04-10 21:30:43 +03:00
Wolfsblvt e52c035fcd Add allowEscapeClose option to popup class for Escape key behavior override (#5340)
* feat(popup): add allowEscapeClose option to override default escape key behavior

Add `allowEscapeClose` parameter to PopupOptions to explicitly control whether Escape key closes the popup, overriding the default logic that checks for visible cancel/close buttons. When null (default), uses existing behavior; when true, allows escape even without buttons; when false, prevents escape even with buttons present.

* feat(popup): enable Escape key closing for informational popups

Add `allowEscapeClose: true` option to TEXT-type popups in export preset, persona lore, sampler select, stats, and world info assignment dialogs to allow users to dismiss these informational popups with the Escape key.

* Improve Escape key interaction in popups

* Adjust jsdoc for allowEscapeClose

* Always return CANCELLED on Escape

* fix(popup): correct jsdoc for allowEscapeClose property description

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-24 01:11:38 +02:00
Wolfsblvt 7766d41c42 Fix: Prevent Escape Key from Closing Non-Dismissable Popups (#5327)
* fix(popup): prevent Escape key from closing popups when both cancel and close buttons are hidden

Add validation in cancel listener to check visibility of cancel and close buttons before allowing Escape key to close popup. Set isClosingPrevented flag to block subsequent close events when neither button is visible.

* feat(popup): add double-escape force-close mechanism for blocking popups

Add double-escape detection (within 500ms) to allow force-closing blocking popups that have both cancel and close buttons hidden. Show confirmation dialog warning about potential inconsistent state before allowing force-close. Track last escape press timestamp and confirmation popup state to prevent duplicate dialogs. Gracefully cancel force-close confirmation if main popup closes naturally.
2026-03-22 00:09:17 +02:00
Wolfsblvt 240e9ca907 Extend Popup System with Placeholder, Tooltip, and Icon Support (+ those in slash commands) (#5322)
* feat: add placeholder and tooltip support to popup system with icon buttons

Add `placeholder` and `tooltip` options to main popup configuration. For INPUT type popups, placeholder applies to input field; for other types, tooltip applies to content area. Enhance custom buttons with optional `icon` parameter for Font Awesome icons and `tooltip` for hover text. Add tooltip support to custom inputs (placeholder for text/textarea, tooltip icon for checkboxes).

* fix: preserve default toastClass when applying custom cssClass in /echo command

Modify cssClass argument handling in echoCallback to append custom class to existing toastClass instead of replacing it. Use filter(Boolean).join(' ') to combine default and custom classes while handling undefined values.

* feat: add placeholder, tooltip, and icon support to popup system slash commands

Add `placeholder` and `tooltip` named arguments to /input command for input field customization. Add `tooltip` argument to /popup command for content area hover text. Enhance /buttons command to support button objects with `text`, `tooltip`, and `icon` (Font Awesome) properties alongside simple string labels. Update help text and examples for all three commands. Normalize button labels to ButtonLabel format internally

* Fix jsdoc wording

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fix: add validation for button labels in /buttons command

Add validation check to ensure each button entry is either a string or an object with a non-empty string `text` property. Return empty string and log warning if validation fails. Fix capitalization of 'Popup' in /popup command return value description.

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-20 01:14:49 +02:00
Wolfsblvt 87a0ac7cd1 Add textarea support to popup custom inputs (#5167)
- Add 'textarea' as a valid input type alongside 'checkbox' and 'text'
- Add optional `rows` property to control textarea height (default: 1)
- Implement textarea rendering with proper label, placeholder, and styling
- Update result collection logic to handle textarea values like text inputs
- Update warning message to include textarea in supported types
2026-02-15 23:55:20 +02:00
Cohee 357da3219b Chore: Add code formatting conventions as eslint rules (#5158)
* Add code formatting conventions as eslint rules

* Improve formatting in addQuickReply
2026-02-15 01:16:34 +02:00
Wolfsblvt 81367629fe Feat: Improve multiline input handling in popups (#4756)
* 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
2025-11-12 21:20:13 +02:00
Wolfsblvt 7bedaed92c Extend Update/Replace character function to replace directly from URL + Fixes on cached thumbnail (#4581)
* 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>
2025-10-02 23:05:19 +03:00
Cohee 51904c2f10 Add persona titles (#4224)
* Add persona titles

* Refactor persona title editing
2025-07-03 19:28:09 +03:00
Cohee 8d2b9d2dab Secrets manager (#4131)
* 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)
2025-06-11 21:26:19 +03:00
omahs d7d20a67fa Fix typos 2025-05-29 11:56:59 +02:00
Cohee 8b6e2a0fe1 Return set toast position on container init 2025-05-21 20:55:11 +03:00
Cohee 34490c9614 Display loader earlier, init toast classes in power-user 2025-05-21 20:35:03 +03:00
RossAscends da16c551f0 more toasty edge case fixes 2025-05-21 19:03:26 +09:00
RossAscends f145dfcb2d fix edge cases, put toastr on a diet 2025-05-21 15:35:12 +09:00
Cohee 63b48b9211 Log a warning on an unknown input type 2025-04-30 22:58:43 +03:00
Cohee 310b0f30cd Add branch selection on extension installer
Closes #3865
2025-04-28 22:53:22 +03:00
Wolfsblvt aee8441fc4 Mobile prompt itemization - duh
- Make it into a popup. There is no space
2025-02-10 15:07:57 +01:00
Cohee a2cfcd4ca6 feat: Delete image swipes at once or one by one 2025-02-08 22:55:38 +02:00
Cohee 569f9a2091 Popup: do not require body text on input/confirm 2024-12-31 22:59:08 +02:00
QuantumEntangledAndy b05d5e12fe Use a resize observer to center the popup after an image is loaded when polyfilled 2024-10-10 10:41:40 +07:00
Cohee 441465f08b [chore] Run eslint 2024-10-04 16:37:56 +03:00
QuantumEntangledAndy bd48c2445a Make dialog css edits dependant on polyfil 2024-10-04 16:57:59 +07:00
QuantumEntangledAndy 3e465d155c Include polyfill css 2024-10-04 15:26:48 +07:00
Wolfsblvt 73c14711e1 Fix checkpoint create auto generate (and more)
- Fix empty checkpoint name on mes click to auto generate
- Change /checkpoint-create to not require name and auto generate
- Fix popup input type returning empty string instead of null on empty input field
2024-09-12 23:34:37 +02:00
Wolfsblvt 2385c5a59a Change popup cancel result in command to empty str 2024-09-07 01:21:04 +02:00
Cohee a4176ae00d Allow hiding cancel on input popup 2024-09-02 00:12:20 +03:00
Cohee a4ee73a3a7 Make onClose async too 2024-08-19 23:58:36 +03:00
Cohee bc7660bba6 Require to save settings before reloading. 2024-08-19 23:49:15 +03:00
Wolfsblvt cfb40cae0b Only count popups as open which are "open" 2024-08-18 16:42:10 +02:00
Wolfsblvt c139222aee Merge branch 'staging' into pr/2415 2024-07-30 21:46:08 +02:00
Wolfsblvt 7bb94732dd mark popup complete functions as async 2024-07-30 21:45:19 +02:00
Wolfsblvt 0dfd31430c Add Popup.show.text 2024-07-28 22:39:11 +02:00
LenAnderson 2470f775e2 Merge branch 'staging' into parser-followup-2 2024-07-28 08:32:25 -04:00
Wolfsblvt 63512c208f Fix popup not respecting <null> for text 2024-07-26 18:17:32 +02:00
LenAnderson bfd05e4866 Merge branch 'staging' into parser-followup-2 2024-07-14 19:18:52 -04:00
Wolfsblvt 6f936bc997 I can't spell. Don't look at it. 2024-07-15 00:46:45 +02:00
Wolfsblvt 367da588cd Move closingPrevented to a property 2024-07-14 22:37:22 +02:00
Wolfsblvt 7b7c1121bb Fix popup onClosing handling not working correctly
- Reset value/result on canceled closing
- Fix close event still firing and closing the popup on multiple close/cancel calls, even though it *shouldn't* have happened
- Remove manual removal of popup event listeners. Not needed, if they are only subscribed to controls inside the dialog or the dialog itself. That's cleaned up automatically. Is confusing otherwise anyway.
2024-07-14 02:39:57 +02:00
LenAnderson 3327be5468 Merge branch 'staging' into parser-followup-2 2024-07-12 08:33:28 -04:00
Wolfsblvt 4c7e5fbd60 Allow popup buttons returning 'null' for cancelled 2024-07-12 00:29:16 +02:00
LenAnderson 32ec6aac1c Merge branch 'staging' into parser-followup-2 2024-07-04 11:37:35 -04:00
Wolfsblvt 1f6a91ab5d Make input popups respect "Enter to Send" setting 2024-07-01 15:32:24 +02:00
Wolfsblvt 5d74749fd0 Fix toasts misaligning on popup hiding 2024-06-30 23:23:39 +02:00
Cohee de79cf74c6 Default to fast animation 2024-06-30 23:30:15 +03:00
Wolfsblvt e7e8ff06d0 Optional popup animation speed (via popup styles) 2024-06-30 20:49:16 +02:00
Wolfsblvt da968e127b Refactor Popup.complete to async 2024-06-30 20:44:29 +02:00
LenAnderson a08ab79181 Merge branch 'staging' into parser-followup-2 2024-06-28 16:19:27 -04:00