Commit Graph
101 Commits
Author SHA1 Message Date
8372e7bf9d "gradually replacing property access with a dot operator" (#4965)
* "gradually replacing property access with a dot operator"
https://github.com/SillyTavern/SillyTavern/pull/4963#discussion_r2663003561

(?<=\w|\])\['([a-zA-Z]\w+)'\]
My regex found 593 matches across 47 files.
Also, two typos.

* Fixed chat[0].chat_metadata type error.
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664275854

* Fixed `swipedElementsDiv[0]?.getAnimations().filter((a) => a.animationName` type error.
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664274593

* Fixed config.MESSAGE_SANITIZE and config.MESSAGE_ALLOW_SYSTEM_UI type errors.
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664266271

* Fixed group.date_last_chat type error.
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664295652

* Reverted SlashCommandParser dot property access.
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664310931

* LLM fixed canUseNegativeLookbehind.result; type error.
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664314288

* Reverted chat-completions.js bodyParams and headers dot property access.

https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664317848
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664320088
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664324438

* Reverted openai.js data dot property access.

https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664326244

* Reverted tests/frontend/MacroEnvBuilder.e2e.js env.dynamicMacros dot property access.

https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664330990

* Partially reverted `window` dot property access.

* Reverted result.json() and settings dot property access.

* Reverted google.js headers dot property access.

* Fixed regex: `(?<=\w|\])\['([a-zA-Z]\w*)'\]`

* Swapped window to globalThis with dot property access.

* LLM fixed canUseNegativeLookbehind type.

* Refactor property access

* Consistency

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-08 23:58:21 +02:00
Cohee f26a672811 Omit content type in POST request if no body 2025-12-07 23:26:47 +02:00
WolfsblvtandCohee 9463d1a152 Reprint non-tainted group chat on switching personas (#4603)
* 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>
2025-10-06 22:45:26 +03:00
WolfsblvtandCohee a65f708fd8 Allow create new world books via /getpersonabook and /getcharbook (#4597)
* 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>
2025-10-05 16:41:54 +03:00
Wolfsblvt 06f5cea402 Fix group chat on new chat not respecting saved persona connections (#4594)
* fix: (new) group chat doesn't respect persona connections

Fixes #3876

* refactor: simplify persona connection filtering with destructuring and type comparison

* fix: remove redundant type check in persona connection filtering logic

(char avatar and group key *should* always be unique and different anyway, no need to check on type. Makes this more flexible)
2025-10-04 13:24:49 +03:00
Cohee 334a5409a0 Persona description editor expand (#4591)
* Enhance persona description section with expandable editor icon

* Fix selector for persona description update to use data attribute
2025-10-04 13:15:32 +03:00
Cohee 7b67769c92 Fix convert to persona with unusual names (#4319)
* Fix convert to persona with unusual names

* Fix picking new persona on current persona deletion

* Prefer actual path on page reload
2025-07-27 14:16:15 +03:00
Cohee 96bdc13937 Replace ajax with fetch (#4241)
* Replace ajax with fetch
Fix type errors in power-user / group-chats modules

* Fix single sprite upload

* Return empty object on failed upload
2025-07-06 23:27:53 +03:00
Cohee 51904c2f10 Add persona titles (#4224)
* Add persona titles

* Refactor persona title editing
2025-07-03 19:28:09 +03:00
Cohee cdefddef6c Implement persona thumbnails (#4210)
* Implement persona thumbnails

* Dear Firefox, fix your overzealous image cache

* Add cache busting for avatar uploads when overwriting existing files
2025-06-28 21:39:32 +03:00
Cohee 51431b1a75 Include persona name in delete confirmation
Closes #4119
2025-06-15 23:09:09 +03:00
omahs d7d20a67fa Fix typos 2025-05-29 11:56:59 +02:00
Cohee 637e9d5469 Set any char as assistant. Rework welcome prompt 2025-05-12 20:50:17 +03:00
Yokayo 1822c4f91b More work on tl 2025-05-03 18:12:18 +07:00
Yokayo f0d01d35a6 eslint fixes 2025-04-28 18:55:10 +07:00
Yokayo 11908f7363 Work on tl 2025-04-28 18:45:16 +07:00
Wolfsblvt d95524032e Centralize first message retrigger on persona changes
Moves retrigger logic to setUserAvatar entry point
to avoid duplicate calls when updating personas
Removes redundant triggers from name/avatar handlers

Fixes #3774
2025-03-28 01:28:36 +01:00
Wolfsblvt 6dc33e9637 Cast this_chid to number in personas.js
Ensure numeric type for character ID comparisons
Explicitly converts this_chid to Number in multiple functions
to prevent type mismatch issues when checking character connections
and persona states
2025-03-28 01:25:13 +01:00
Yokayo 40c3674da1 Update tl 2025-03-17 16:09:36 +07:00
Wolfsblvt 67699d9cfa Fix persona auto-lock to chat not working
- When auto lock was enabled, it didn't auto-lock to chat when the persona was already selected (like choosing the same persona you have used before)
2025-03-09 15:27:48 +01:00
Cohee 90be2eee71 Only navigate to persona if switched by connection 2025-02-26 00:13:55 +02:00
Cohee 6541dcbc66 Comment out persona preservation on character swap with personas open 2025-02-26 00:03:46 +02:00
Cohee 0274d800f9 Navigate to current persona on switching chats 2025-02-25 23:50:49 +02:00
Cohee cf792c8195 Don't choose chat persona if it's already chosen 2025-02-25 23:37:02 +02:00
Wolfsblvt fec0e248c5 Fix persona UI states sometimes not updating 2025-02-25 21:57:25 +01:00
Wolfsblvt e27e045054 Update persona.js code documentation for exported 2025-02-23 04:58:48 +01:00
Wolfsblvt 76fa90ed9e Switch to char from persona panel decision tree 2025-02-23 02:33:51 +01:00
Cohee 7f9960fa7a Clickable char personas 2025-02-22 22:48:51 +02:00
Wolfsblvt e0f3a22b80 Refactor: move persona slash commands 2025-02-22 21:45:35 +01:00
Cohee ac8c2799b8 Add missing personas on load 2025-02-22 22:26:34 +02:00
Cohee 2194bdfd56 Rerender the list if migrated persona 2025-02-22 22:20:45 +02:00
Wolfsblvt bb03c60c39 Refactor: move showCharConnections 2025-02-22 21:17:56 +01:00
Wolfsblvt 8f38298f90 fix linting errors 2025-02-22 20:48:41 +01:00
Wolfsblvt 9e7f485b65 Merge branch 'persona-improvements' of https://github.com/SillyTavern/SillyTavern into persona-improvements 2025-02-22 20:47:10 +01:00
Cohee 4a9503c056 Align message block baseline 2025-02-22 21:43:16 +02:00
Wolfsblvt f37541d629 Remove unused old username functions 2025-02-22 20:42:35 +01:00
Wolfsblvt 8bd4fd76ae Merge branch 'staging' into persona-improvements 2025-02-22 19:23:59 +01:00
Cohee d5bdf1cb90 Add settings.json-backed KV string storage
Fixes #3461, #3443
2025-02-11 20:17:48 +02:00
Cohee cbeb7ddcec Update persona upload methods to fetch 2025-01-30 02:30:51 +02:00
Wolfsblvt 3d817352ec Add rename personas functionality 2025-01-30 01:17:43 +01:00
Wolfsblvt f9324c74cd Streamline persona toasts, infos and states
- Added "info" block to persona description panel to show when a temporary persona is in use. Hide the long text behind a tooltip
- Reduce toast spam even further, not showing toasts when persona panel is open
- Restyle connection state buttons a bit
- Designed common 'info-block' utility to show markdown-like info blocks, with CSS styling
2025-01-30 00:50:48 +01:00
Wolfsblvt e5db40cf2d Add persona connection states to persona list
- Show persona connection/lock states in persona list (chat & char lock)
- Refactor persona images url to 'data-avatar-id' attribute
- Try make persona blocks' height consistent
- Fix persona list not correctly updating selected persona on navigating pages
- Fix group/char difference not correctly working
- Create common style template for hover-able images buttons/tags where the label only appears on hover
2025-01-29 22:54:22 +01:00
Wolfsblvt 2344d98e20 Move persona buttons to right panel
- Move all buttons from the persona list to the right panel, to the already existing ones
- Common CSS class/style for '.buttons_block'
- Common CSS style for a red button
- Refactored a few persona buttons' functionalities
2025-01-28 20:53:55 +01:00
Wolfsblvt 913509f887 Don't look at this 2025-01-26 22:27:59 +01:00
Wolfsblvt 1f116d9afe Reduce persona toast spam 2025-01-26 22:13:32 +01:00
Wolfsblvt 2cfb9e8dab Fix lock icon state on auto-lock to chat 2025-01-26 20:50:10 +01:00
Wolfsblvt 9a79c6b1a4 Remove all connections button for the popups 2025-01-25 19:54:45 +01:00
Wolfsblvt 3fc4207cdb Temporary persona toast respects setting 2025-01-25 19:27:29 +01:00
Wolfsblvt 0141a60eb8 Add hint on how to use persona connections 2025-01-25 19:20:21 +01:00
Wolfsblvt 2253990898 Highlight personas from current chat in popup 2025-01-25 18:47:53 +01:00