639 Commits

Author SHA1 Message Date
DeathStalker471 7201d87f2e feat: Add NanoGPT credit stats UI (#5537)
* Add NanoGPT credit stats UI

* fix lint

* fix: type check

* fix: migrate inline styles to css

* feat: add sub active date display

* feat: add link to balance page

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-27 00:13:06 +03:00
Wolfsblvt 53f251c52a Fix: Prevent "Show More Messages" Button from Triggering Message Edit Mode (#5486)
* fix: prevent event bubbling on show more messages button

Replace mouseup/touchend with click event and add stopPropagation/preventDefault to prevent unintended event bubbling when loading more messages.

* Add hover style to "show more messages"

* add button role to show_more_messages

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-20 01:44:33 +03:00
Wolfsblvt 64c96e895c Add Streaming Display Utility and New Generation Slash Commands (/genstream, /reasoning-format) (#5438)
* Add StreamingDisplay class for live LLM generation output with floating toast panel

- Add StreamingDisplay class to show streaming reasoning and content in a floating toast panel
- Extract createModelIcon() helper from insertSVGIcon() for reusable API/model icon creation
- StreamingDisplay automatically appends inside topmost open dialog (same pattern as fixToastrForDialogs)
- Add CSS with fade-in animation, pulsating activity indicator, and separate reasoning/content sections
- Support optional model icon in header

* Add ConnectionManagerRequestService.getProfileIcon() method for retrieving profile API icons

- Add static getProfileIcon() method to ConnectionManagerRequestService
- Returns HTMLImageElement created via createModelIcon() for a given profile's API/model
- Accepts optional profileId parameter, defaults to currently selected profile
- Returns null if Connection Manager is disabled, profile not found, or profile has no API
- Import createModelIcon from script.js

* Use animation_duration directly in hide() and CSS transition instead of constant

- Remove ANIMATION_DURATION_MS constant and use animation_duration directly in hide() method
- Replace hardcoded 0.3s CSS transitions with CSS variable var(--animation-duration, 125ms)
- Read animation_duration value inline in hide() for accurate timing

* Add /genstream slash command with live streaming display and reasoning support

- Add /genstream slash command that generates text via Connection Manager with live streaming UI
- Add formatReasoning() helper function (inverse of parseReasoningFromString) to format reasoning/content into template-wrapped strings
- Add connectionProfiles enum provider for profile selection in slash commands
- StreamingDisplay: add delay parameter to hide() method (default 1000ms) to show final result before dismiss

* Add /reasoning-format slash command to format reasoning and content into template-wrapped strings

- Add /reasoning-format (alias: /format-reasoning) slash command that wraps reasoning/content using Reasoning Formatting settings
- Accept required 'reasoning' named argument and optional unnamed 'content' argument
- Validate that prefix/suffix are configured before formatting
- Return formatted string via formatReasoning() helper for use with /reasoning-parse
- Show warning toasts if prefix/suffix missing

* Rename /genstream command to /profile-genstream and move to appropriate module

* Apply messageFormatting to StreamingDisplay reasoning and content text for proper rendering

- Import messageFormatting from script.js
- Replace textContent with innerHTML using messageFormatting() in updateReasoning() and updateText()
- Pass isSystem=true for reasoning, isSystem=false for content to match formatting expectations
- Update css to utilize pre-formatted paragraphs correctly

* Strip auto-added quotes from <q> tags in StreamingDisplay and add 'mes_text' class for consistent chat message formatting

- Add CSS rules to remove browser-default quotes from <q> tags in reasoning and content sections
- Add 'mes_text' class to textContent div to match chat message formatting behavior
- Prevents double quotes when messageFormatting already adds them via <q> tags

* Add minimize/close buttons and complete state to StreamingDisplay with configurable auto-hide

- Add minimize button to collapse/restore content sections while keeping header visible
- Add close button to manually dismiss display (generation continues in background)
- Replace CSS pseudo-element with explicit LED indicator element for better state control
- Add complete() method to mark generation done: changes LED from pulsing orange to solid green
- Add configurable auto-hide delay after completion

* Add stop button to StreamingDisplay with abort support and onStop/onComplete closures for /profile-genstream

- Add stop button to StreamingDisplay when onStop handler is provided
- Add markStopped() method with solid red LED state indicator
- Add AbortController integration to /profile-genstream for request cancellation
- Add onStop and onComplete closure arguments to /profile-genstream command
- Update complete() method signature to use options object with label and delay
- Disable stop button immediately

* Position StreamingDisplay above bottom form block using CSS variable with fallback

- Change bottom positioning from fixed 20px to dynamic calculation
- Use max() to position above --bottomFormBlockSize + 5px or minimum 20px
- Ensures StreamingDisplay doesn't overlap with bottom UI elements

* Rename /profile-genstream arguments for clarity: label→generating, completedLabel→completed, hideDelay→delay

- Rename `label` argument to `generating` to better reflect its purpose as the in-progress state label
- Rename `completedLabel` to `completed` for consistency and brevity
- Rename `hideDelay` to `delay` for simpler naming
- Update all internal references and variable names to match new argument names
- Update argument descriptions and default values accordingly

* Remove variable resolution from /profile-genstream arguments: system, length, and delay

- Remove ARGUMENT_TYPE.VARIABLE_NAME from typeList for system, length, and delay arguments
- Replace resolveVariable() calls with direct argument access for system, length, and delay
- Simplify type checking to use typeof directly on args properties
- Maintain existing default values and validation logic

* Add warning toast and early return when connection profile not found in /profile-genstream

- Display toastr warning when fuzzy search fails to find matching profile
- Return empty string to prevent execution with invalid profile
- Improves user feedback for incorrect profile names or IDs

* Extract buildResultText() helper in /profile-genstream to return partial results when stopped

- Add buildResultText() helper function to centralize result formatting logic
- Return partial generated text when user stops generation instead of empty string
- Reuse buildResultText() for both stopped and completed states
- Maintains consistent reasoning formatting in both cases

* fix lint

* Update documentation to reflect argument name change from hideDelay to delay

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-15 21:38:13 +03:00
Copilot 63feac9423 feat: swipe picker expand/collapse, copy button, and left-align text (#5380)
* Initial plan

* feat: add expand/collapse, copy button, and left-align text in swipe picker

Addresses user feedback for swipe picker (added in 1.17.0):
1. Left-align swipe text (was inheriting centered alignment)
2. Add expand/collapse toggle using hidden checkbox + CSS :has
3. Add copy-to-clipboard button using shared copyText utility

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/90892f1c-3c75-404b-a93b-2abe672cc0e3

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

* revert unintended package-lock.json changes from npm install

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/90892f1c-3c75-404b-a93b-2abe672cc0e3

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

* fix: address review feedback - hide checkbox, use chevron icons, align buttons with fa-fw

- Fix checkbox visibility by using !important to override input[type=checkbox] grid display
- Change expand icon to fa-chevron-down and collapse to fa-chevron-up
- Add fa-fw class to all action buttons (copy, expand/collapse, branch, delete) for even sizing
- Add align-items: baseline to the actions container

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/c8ca349f-3579-442a-baa1-fc138ba1d7a6

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/c8ca349f-3579-442a-baa1-fc138ba1d7a6

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

* fix: update class names for chat action elements in swipe picker

* fix: prevent chevron layout shift and swap button order

- Use single label element as icon (fa-chevron-down) instead of two
  child <i> elements toggling visibility, preventing layout shift
- Override ::before content to chevron-up when expanded via CSS
- Swap chevron and copy button order (chevron first, then copy)

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/284283b1-6c7f-4371-bc4a-94d841513879

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

* style: add comment for FA unicode value in CSS

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/284283b1-6c7f-4371-bc4a-94d841513879

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

* Rotate the chevron instead of changing content

* Make the ui full height

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-03-31 00:41:03 +03:00
awaae b04c974407 feat(ui): add interface to manage message swipe history (#5304)
* feat(ui): add popup to jump to a specific swipe

Adds a new "Jump to swipe history" button to message actions and makes
the swipe counter clickable on the latest message. This opens a
searchable popup allowing users to quickly find and jump to a
specific alternate swipe without having to click through them
sequentially.

- Adds a searchable swipe picker popup menu
- Makes the swipe counter interactive when multiple swipes exist
- Adds a dedicated swipe picker button to message controls

* fix(ui): hide swipe picker when there are no swipes

Ensures the newly added swipe picker button is only shown when a
message has multiple swipes available. It explicitly hides the
button for non-swipeable messages or messages with a single swipe.

* feat(ui): redesign swipe picker with direct id input

Replace text-based search with a numeric input for direct swipe navigation.
Update popup layout with a sticky header and improved scrolling behavior.
Sync input value with the currently selected swipe in the list.
Refactor styling to align with chat selection components.

* feat(ui): allow branching from specific swipes via picker

- Enable swipe picker for historical messages to inspect alternate swipes
- Add branch button to picker entries to create new chats from specific swipes
- Update saveChat and createBranch to accept chat snapshots
- Restrict swipe jumping to the active message only

* refactor(logic): consolidate swipe sync logic and simplify helpers

Update `syncSwipeToMes` to accept a target message object, enabling its
use in the bookmarks module and removing the duplicate
`applySwipeToSnapshot` function.

Also simplify `canOpenSwipePickerForMessage` and
`canJumpToSwipeForMessage` signatures by removing the redundant message
parameter.

* refactor(a11y): support dynamic roles via classes

Introduce a managed role system in the accessibility script to handle
elements that dynamically gain or lose interactive states. The mutation
observer now watches for class attribute changes and automatically
applies or clears roles (e.g., `role="button"`) using active selectors.

Updated the swipe counter to rely on this centralized system by toggling
an `.interactable` class instead of manually modifying tabindex and role
attributes. Removed the redundant 'Enter' keydown handler for the swipe
counter to prevent duplicate trigger events.

* fix(ui): compute missing token counts in swipe picker

Update renderSwipeList to asynchronously calculate token counts when
missing from swipe metadata. Introduce SWIPE_SOURCE.SWIPE_PICKER to
correctly identify swipes triggered from the picker and bypass
generation checks.

* feat(ui): enable deleting specific swipes via swipe picker

- Adds a delete button to swipe picker entries, allowing removal of specific message versions.
- Refactors deletion logic to handle removing non-current swipes without triggering animations and correctly updates indices.
- Includes confirmation dialogs and improves input focus behavior.

* refactor:Delete process inline to button click processor

* feat: universal swipe inspection and picker improvements

- Permit opening the swipe browser on any chat entry to review past generations.
- Parallelize the retrieval of token statistics to speed up list rendering.
- Format message metrics (length and tokens) into a single, concise string.
- Update the `getBranchChatSnapshot` API to accept an options object.
- Register swipe list items as interactable elements for keyboard control.
- Apply styling to prevent text highlighting on picker entries.

* fix:remove unused CSS

* fix: fix disabled styling for swipe delete button

Remove tooltips and prevent hover animations or glow effects when the
delete button is disabled in the swipe picker. Update CSS to enforce
default cursor and fixed opacity on hover for the disabled state.

* remove: Unused CSS

* Extract swipe-picker.js module

* Revert to manual ARIA role management

* Avoid scrollIntoView and scroll on open

* Fix keyboard interaction in past chats menu

* Fix a11y attribute

* fix: call refreshSwipeButtons when deleting not selected swipe

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-26 02:28:48 +02:00
Wolfsblvt a6486d7f08 Add Action Loader Module with Stacking Support and STscript Commands (#5311)
* Add action loader utility with stoppable toast notifications

* Add slash commands for action loader control (/loader-wrap, /loader-show, /loader-hide, /loader-stop)

* Refactor action loader to support stacking multiple loaders with individual toast management

- Convert action loader from singleton to class-based handle system (ActionLoaderHandle)
- Support multiple concurrent loaders with single overlay and stacked toasts
- Add unique ID generation and tracking for each loader instance
- Implement onHide callback alongside existing onStop callback
- Add getActiveLoaderHandles() and getLoaderHandleById() utility functions
- Refactor hideActionLoader() to accept...

* Improve action loader overlay and toast handling with better state checks and cleanup timing

- Check isLoaderDisplayed() before showing overlay to prevent conflicts with existing loaders
- Use toastr.options.hideDuration for toast removal timing instead of hardcoded 250ms
- Simplify hideActionLoader() by using getActiveLoaderHandles() helper
- Remove redundant empty check in hideActionLoader()
- Add clarifying comment for intentional error throw in createClosureHandler()
- Remove redundant 'onStop' default

* fix stop button toast removal issue by using toastr.clear force option instead of manual removal with timeout

* Fix isLoaderDisplayed() by using double negation operator instead of null comparison

* Add non-blocking loader support with `blocking` parameter for toast-only action loaders

- Add `blocking` option to ActionLoaderHandle (default: true)
- Implement hasBlockingLoaders() helper to check for active blocking loaders
- Show/hide overlay only when blocking loaders are active
- Add `blocking` named argument to /loader-wrap and /loader-show commands
- Update help strings with non-blocking usage examples
- Import commonEnumProviders for boolean enum and isFalseBoolean utility

* Add optional title parameter to action loader toast notifications and reorder constructor parameters for consistency

- Add `title` parameter to ActionLoaderOptions and ActionLoaderHandle constructor
- Pass title to toastr.info() for toast notifications
- Reorder parameters: blocking, toastMode, message, title, stopTooltip (grouped by importance)
- Add warning when creating non-blocking loader without toast (invisible to user)
- Update /loader-wrap and /loader-show commands with title argument

* Add loader utility API to action-loader and expose it in ST context for convenient programmatic access

- Create `loader` object with show/hide/active/get methods and ToastMode/Handle exports
- Add JSDoc examples for basic usage, non-blocking tasks, and hiding all loaders
- Import and expose `loader` in ST context alongside existing loader functions

* Split slash command and functional modules

* Create abort controller on app init

* Remove HTML tags from "returns" declaration

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-20 01:04:39 +02:00
Preston Farr 56e995c320 feat: add prefers-reduced-motion and prefers-contrast media queries (#5122)
* feat: add prefers-reduced-motion and prefers-contrast media queries

- Integrate OS prefers-reduced-motion into existing JS toggle system:
  when OS preference is active, force reduced_motion on and disable
  the UI checkbox with an explanatory tooltip
- Add body.reduced-motion CSS rules for hardcoded animations that
  bypass the --animation-duration variable (text_segment fade-in,
  dragover pulse)
- Add prefers-contrast: more media query for enhanced focus outlines

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Support translating title text

* Use duration variable

* Removed stream fade-in override

* Combine hi-contrast selectors

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-02-15 19:45:24 +02:00
Wolfsblvt 9ff9d59672 Macros 2.0 (v0.7.1) - Macro Autocomplete everywhere (#5019)
* Add macro autocomplete for free text inputs

Implements macro autocomplete (`{{`) for textareas and input fields marked with `data-macros` attribute. Extracts shared autocomplete logic into MacroAutoCompleteHelper.js for consistency between slash command and free text contexts. Includes MutationObserver for dynamic element initialization and supports variable shorthands, operators, flags, and scoped macro closing tags.

* fix annoying circular dependency again

* Add `data-macros` attribute to enable macro autocomplete on text inputs

Enables macro autocomplete (`{{`) for various textareas and input fields throughout the UI by adding the `data-macros` attribute. Includes context template fields, instruct mode sequences, character/persona descriptions, world info content, and other prompt-related inputs. Also ensures the attribute is preserved when expanding editors and creating world info entries.

* Allow macro autocomplete in editing messages

Enables macro autocomplete (`{{`) when editing messages by adding the `data-macros` attribute to the dynamically created edit textarea element.

* Add autocomplete visibility setting support for macro autocomplete

Respects the global STScript autocomplete visibility setting (`power_user.stscript.autocomplete.state`) for macro autocomplete in free text inputs. When set to "Input length > 1", macro autocomplete only activates after typing `{{` plus at least 2 characters. Also adds a tooltip to the visibility setting explaining it applies to both slash commands and macros.

* Fix unclosed div tag in STScript autocomplete visibility setting

Closes the `<div>` tag that was incorrectly left open in the autocomplete visibility setting markup.

* Add setting to control macro autocomplete visibility in non-expanded fields

Introduces a new `showInAllMacroFields` setting that controls whether macro autocomplete appears in all macro-enabled fields or only in expanded editors and when pressing Ctrl+Space. Also adds `data-macros-autocomplete` attribute support with `always` and `hide` modes for per-field override. When the setting is off, autocomplete only shows in expanded editors (which now get `data-macros-autocomplete="always"`) and the completion

* Add `data-macros-autocomplete-style` attribute to control macro autocomplete popup size

Introduces a new `data-macros-autocomplete-style` attribute with `small` (33vw, max 700px) and `expanded` (default chat width) modes to control macro autocomplete popup dimensions. The `small` style is now the default for inline fields, while `expanded` is used for expanded editors and prompt manager. Also refactors `getAutocompleteMode` to return `DEFAULT` instead of `null` and adds corresponding `getAutocompleteStyle` helper

* Fix autocomplete details panel alignment when list is constrained by viewport edge

Adjusts the details panel position to align with the actual autocomplete list position when the list is constrained by the right edge of the viewport. Previously, the panel would position based on cursor location even when the list was pushed left, causing misalignment. Now checks if the list's actual position differs from the calculated position (with 5px tolerance) and uses the list's position instead.

* Guard autocomplete details panel alignment check with `isReplaceable` condition

Prevents attempting to read the autocomplete list's bounding rect when the list is not visible. The alignment adjustment for viewport-constrained lists now only runs when `isReplaceable` is true, avoiding potential errors when the list DOM is not rendered.

* Fix macro autocomplete cursor detection to handle nested macros correctly

Updates `findMacroAtCursor` to track nesting depth when searching for opening `{{` and closing `}}` braces. Previously would incorrectly stop at the first brace pair encountered in either direction, breaking autocomplete when cursor was inside nested macros like `{{getvar::{{getvar::name}}}}`. Now properly skips over nested macro boundaries by incrementing/decrementing depth counters until finding the matching braces at depth

* gief me my comments back (and fixes, that were missed)

- Added detailed JSDoc comments to all exported functions explaining parameters, return types, and behavior
- Added inline comments throughout functions explaining logic flow, edge cases, and implementation details
- Documented parser-based vs regex-based unclosed scope detection approaches
- Clarified variable shorthand autocomplete logic including operator filtering, context display, and priority

* refactor(macros): freeze MACRO_AUTOCOMPLETE_MODE and MACRO_AUTOCOMPLETE_STYLE enums

* feat(macros): explicitly set `makeSelectable` flag for non-insertable autocomplete options

- Set `makeSelectable = true` for variable shorthand options in {{if}} conditions (already insertable)
- Set `makeSelectable = false` for already-typed operators in variable shorthand autocomplete
- Set `makeSelectable = false` for already-typed flags in macro autocomplete
- Set `makeSelectable = false` for non-selectable closing block flags when no unclosed scopes exist
- Set `makeSelectable = false` for sc

* refactor(macros): consolidate typedef imports in MacroAutoCompleteHelper

- Fixed typo in MacroDefinition typedef import (removed extra `/` from JSDoc comment)
- Replaced long-form typedef imports with short-form aliases for MacroAutoCompleteContext and MacroDefinition
- Improved code consistency by using imported typedefs throughout function signatures

* refactor(autocomplete): select first selectable item as default instead of always first item

- Extracted default item selection logic into `selectDefaultItem()` method
- Changed default selection to prioritize first selectable item over first item in list
- Falls back to last item when no selectable items exist (preserves context for info-only options)
- Added JSDoc documentation explaining selection behavior

* feat(macros): make already-typed variable names non-selectable in autocomplete

- Set `makeSelectable = false` for variable name options that match the currently typed name
- Set empty `valueProvider` for matched variables to prevent re-insertion
- Prevents redundant selection of variables that are already fully typed in the input

* feat(macros): add value context autocomplete option for variable shorthand operators

- Created `VariableValueContextAutoCompleteOption` class to display context about expected values
- Shows operator name, symbol, and description when typing variable shorthand values
- Displays currently typed value and completion hint
- Non-selectable option (context only) with priority 4
- Added to variable shorthand autocomplete when operator is typed and value is being entered

* fix lint

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-23 23:46:47 +02:00
Cohee eb48c5abe2 Fix: show edit textarea for messages with inline media 2026-01-10 19:53:08 +02:00
DeclineThyself 98dd31b7f5 Chevrons can overlap with other elements. (#4878)
* Attempt to fix overlapping chevrons.
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3639322664

* Removed supports.

* swipeRightBlock now has pointer-events:none.

* Add pointer events to swipes-counter

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-12 22:02:14 +02:00
Cohee b9aebb369f Fix: Pass-through pointer events to swipe buttons in video container 2025-12-11 01:19:04 +02:00
Cohee bd1583faa4 Implement chat backups browse menu (#4862)
* Implement chat backups browse menu

* Unify bytes string formatting
2025-12-04 22:05:27 +02:00
DeclineThyself fc85b205ac Backport feat/chat-tree and fix #4709 (#4712)
* Performance improvements due to using chatElement instead of $('#chat').

* Reverts change `hideSwipeButtons()` change.

https://github.com/SillyTavern/SillyTavern/pull/4576#discussion_r2394996102

* I’ve been working on a PR for issue #1731: [Swipes on every AI message, not just the last one](https://github.com/SillyTavern/SillyTavern/issues/1731). I’d appreciate feedback to avoid unnecessary effort.

Currently, I have User and Assistant branches working.
I have not touched `/api/chats/save` or '/api/chats/get', so branches do not persist.

To keep `context.chat` unmodified (so extensions and the rest of the code remain unaffected), I’ve stored branches in `chatTree`:
```javascript
chatTree = {
  branch_id: 1,
  branch: [
    { mes: "Hi" },
    { mes: "Hello", branch_id: 0, branch: [...] },
  ]
}
```

When a message is swiped, chatTree is updated via `saveChatToTree()`, then the next branch is loaded using get`ChatFromTree()`.

Questions:
According to Cohee: [This requires reorganizations in the file format for chats, not viable in the short term.](https://github.com/SillyTavern/SillyTavern/issues/1731#issuecomment-1937845036)
I'm hesitant to proceed. May I store chatTree.json files alongside the existing .jsonl chats?
Should I create a new /save endpoint, modify the existing one, or discontinue using .jsonl for saving.

Known issues:
Branches do not persist on refresh.
Swiping multiple messages at once throws `Cannot read properties of undefined (reading 'mes')
`. This will be fixed in the UI.
Branches persist between chats/characters. This will be fixed when loading a chat.
The Swipe arrows overlap with messages.
No animation plays when swiping then editing a user message.

* Fixed bug.

Gemini:
The calculation of mesId is fragile and contains a bug. The fallback chat[chat.length - 1] is a message object, and Number(object) will result in NaN. This will break the swipe functionality if the preceding expressions are falsy. Additionally, chat.indexOf(message) will almost always point to the last message in the chat, which is incorrect when swiping on an earlier message.

A more robust approach is recommended to reliably get the message ID from the clicked element.

    const mesId = Number($(this).closest('.mes').attr('mesid'));

* Fixes swipes on long chats.

* chatTree is now persistent. Fixed bugs.

* Fixed bugs.
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2390042262
The logic to rename the chat tree file (.json) is currently in an unreachable else block. The if condition !fs.existsSync(pathToOriginalFile) || fs.existsSync(pathToRenamedFile) will almost always evaluate to true after the preceding copyFileSync and unlinkSync operations, because pathToOriginalFile will no longer exist. This prevents the chat tree file from being renamed, which breaks the persistence of message branches when a chat is renamed.

The scrollChatToMessage function is implemented incorrectly. Calling .scrollTop() without any arguments on a jQuery object retrieves the current vertical scroll position; it does not scroll the element into view. This function will not have the intended effect of scrolling the chat to the specified message.

* Fixed bugs. https://github.com/SillyTavern/SillyTavern/pull/4573#pullrequestreview-3282889120

There's a typo in the property name being deleted. It should be branch to match the data structure you've defined, not branches. This error will prevent the pruning logic from working correctly, potentially leading to corrupted or bloated chatTree data.

The modified treeData is not being saved here. Instead, the global chatTree is being sent in the request. This will cause any renames of group members within message branches to be lost upon saving. You should send treeData, which contains the modifications.

This function may have performance issues on large chats due to multiple structuredClone calls within a loop. swipelessMessage is created from a deep clone, and then it's deep-cloned again for every swipe. While this ensures data integrity, it is inefficient. Consider refactoring to reduce the number of deep-cloning operations, for instance, by creating swipelessMessage once per message and deep-cloning it only when creating a new branch for a swipe.

* Fix warning. https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2390183161

The logic for renaming the chat tree file seems to have a flaw. The condition !fs.existsSync(pathToOriginalTreeFile) || fs.existsSync(pathToRenamedTreeFile) will be true if the original tree file does not exist. In this case, a warning is logged. However, it's a valid scenario for a chat to not have a corresponding tree file, so no warning should be logged. The current logic could lead to confusing log messages.

* Refactored chatTree into `public/scripts/chat-tree.js`.

https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2390269514

* Displaying swipes on past messages and the entire chat tree functionality is now an opt-in toggle.

https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2390273599

* Only allow one concurrent swipe.
Fixed:
Swiping multiple messages at once throws Cannot read properties of undefined (reading 'mes') .

* Fixed bugs.
Now `swipe_id >= swipes.length` is set to swipes.length.

* Fixed bug.
Swiping a user message did not re-show swipe buttons after the generation finished.

* Moved `Show Swipes for All Messages` Toggle to `Chat/Message Handling`.
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2395008961

* `JSON.stringify doesn't add spaces by default`
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2395047031

* Fixed "Tree file left behind when renaming chats"

https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2395546142

* Fixed "Guard chatTree recursion in group member rename"
https://github.com/SillyTavern/SillyTavern/pull/4573#pullrequestreview-3290587129

* Re-implement: https://github.com/SillyTavern/SillyTavern/pull/4576#discussion_r2395506501

* Moved chat trees to a separate directory. https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2395045583
Enabled chat tree backups.

* Removed structuredClone() for improved performance.

* Fixed bugs.
Characters are now correctly renamed in the chatTree.
Directories are now recursively created.

* Reverts `hideSwipeButtons` to original functionality when `show_swipes_for_all_messages` is false.

https://github.com/SillyTavern/SillyTavern/pull/4576#discussion_r2395375718

* Added `refreshSwipeButtons`.
Updated `showSwipeButtons` and `hideSwipeButtons`.
Fixed bugs.

* Fixed.
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2400143193
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2400143202

* Added `clamp` to util.js.
Refactored `swipe`.

* Fixed bugs.
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2400685914
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2400685911

* Fixed bugs.

* Fixed swipe animations.

* Fixed bug by setting ids with `Number`.

* Delete swipes, and bugfixes.

* Merged `refactor/swipe`.

* Fixed bug created in `Delete swipes, and bugfixes.`.

* Merged from origin/staging.

* Merged changes from refactor/swipe.

* Fixed bug and refactored `syncWithSwipeId`.

* Merged from `origin/staging`.

* Fixed merge.

* Fixed overlapping message generations.

* Warn user, and refresh chat.

* Added metadata to chatTree file.

* Fixed "a sacrifice for the sake of simplicity." https://github.com/SillyTavern/SillyTavern/pull/2752#issuecomment-2323512022

Gemini:
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2464165990
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2464165991

* Improved swipeGenerate's animation.

* Added `SWIPE_SOURCE` constant.

* await `switchSwipesAllMessages`.

* Added `swipeState`.

* Fixed:
https://github.com/SillyTavern/SillyTavern/pull/4573#issuecomment-3449690308

* Done:
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2466884547
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2466884547
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2466894947
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2466902075
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2466911245
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2466938169

* Removed `NEUTRAL_CHAT_TREE_KEY`

* Moved backups

* Fixed `/send` and fixed a bug in `sendMessageAs`.

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2466913570

* Fixes usage of `ENOENT`: https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2466929980

* Removed LLM attribution.

* Updated link and warning.

* Removed debugging comments.

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2466905341

* Replaced `isSwipingAllowed` with `swipeState`.

* Backported many changes from feat/chat-tree.

* Refactored `showSwipeButtons` and `hideSwipeButtons` into `refreshSwipeButtons`

* Refactored `showSwipeButtons` and `hideSwipeButtons` into `refreshSwipeButtons`

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2472109888
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2472113323

* Merged from `refactor/backport-chat-tree`.

* Proposed fix for https://github.com/SillyTavern/SillyTavern/issues/4709
Reverts commit: https://github.com/SillyTavern/SillyTavern/commit/1b3db273891c1ba8c781d2f691ad2e41937ca2aa

On PR: https://github.com/SillyTavern/SillyTavern/pull/2940

* Proposed fix for https://github.com/SillyTavern/SillyTavern/issues/4709
Reverts commit: https://github.com/SillyTavern/SillyTavern/commit/1b3db273891c1ba8c781d2f691ad2e41937ca2aa

On PR: https://github.com/SillyTavern/SillyTavern/pull/2940

* Fixed regenerate and continue while editing the last message.

* Added swipesHidden.
Messages can now be designated as non-swipeable with `message.extra.swipeable`.

* Use `.hidden` and classes instead of `.css` to display swipe chevrons.

* Fixed:
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3465749700
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2476136375
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2476140043
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3465776056
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3465794330

* Fixed bug.

* Fixed broken JQuery animation.

* Fixed:
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2479003956
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2479011525
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2479014001

* Fixed active arrow transition.

* Fixed swipe shake direction.

* Fixed truthy check.

* Added temporary link to documentation PR.

* Moved `switchSwipesAllMessages`

* Fixed failed generations deleting the branch.
Fixed `forceSwipeId`.
Always call `saveChatConditional` if the `swipe_id` has changed.

* ESLint.

* Fixed bug.
Better `syncSwipeToMes` error handling.

* Backported changes from `feat/chat-tree`

Added failed swipe animation.
Fixed `newSwipeId`.

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4712

* Fixed:
https://github.com/SillyTavern/SillyTavern/pull/4712#pullrequestreview-3406878337

* Fixed:
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2483143387

* Fixed:
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2483143387

* Added `showSwipes: false` to `showMoreMessages`.

And a few more performance improvements.

* Fixed animations.

* Added `'.mes'` to `.children`.

* Significantly improved `animateSwipeTransition` performance on large chats.

* Improved `syncSwipeToMes` error handling.

* Significantly improved `animateSwipeTransition` performance on large chats.

* Improved `syncSwipeToMes` error handling.

* Corrected Merge.

* Corrected Merge.

* Improved: `redisplayChat`
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2484177521

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2484215469

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2484217230

* Added a temporary implementation of `branchChat`.

* Fixed bug when generating a swipe.

* Fixed bug in `branchChat`.

* Fixed Off by one error due to `chatElement.children()` selecting `show_more_messages`.
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3478331073

* Fixed Off by one error due to `chatElement.children()` selecting `show_more_messages`.
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3478331073

* Cleaned system messages array and moved `swipeable`

* Removed CSS nesting.

* Fixed merge.

* Improved `syncSwipeToMes` error handling.

* Matched `swipes-counter` fade to chevrons.
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3478192184

* Wrapped `transition-behavior: allow-discrete;` in `@supports`.

* Fixed types.

* Improved swipeability feedback and functions.

* Improved `refreshSwipeButtons` performance again.

* Swapped `.attr` to `.prop`.

* Fixed: `@supports (transition-behavior: allow-discrete)`

* Fixed and clarified typo.

* Fixed:
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495919425
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495923036
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495927019
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495930080
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495943870
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495950927
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495954387
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495974324
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495974683

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495957181
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495960920
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495968137
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495968922
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495959430
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495924599

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495918468
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495931979
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495933092
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495939511

* Improved `refreshSwipeButtons` performance by skipping 'swipes-counter' updates by default.

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2496382916
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2496379401

* Removed chevron fade-in on Cohee's request: https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3493829978

* Set most system messages to `swipeable: false`.

* Implemented `OVERSWIPE_BEHAVIOR`.

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3499706714

* Fix formatting, make comments IDE friendly

* IDE friendly enum comments

* Move animation frames to a dedicated file

* Do not compare with -1

* overswipeBehavior => getOverswipeBehavior

* Formatting fix

* Don't let regenerate on is_system

* Fixed canceled generations in pristine chats.
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3499819670

* Fixed `AUTO_SWIPE` when `animation_duration = 0`.

* Fixed mistake in `redisplayChat`.

* Holding the swipe button speeds up `swipeDuration`.

* Fixed 'animationend' never ending.
Altered resetTime.

* Swapped from `saveChatConditional` to `saveChatDebounced` in `swipe`.

* Skip the animation if it's faster than 50ms instead of 10ms.

* Typo.

* Fixed:
https://github.com/SillyTavern/SillyTavern/pull/4712#pullrequestreview-3457198109

* Adjust duration reset cooldown

* Add quotes to selector

* Specify type for message parameter in swipe function

* Add type for swipe UI event

* Disabled fade-in during printMessages.
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3539315919

* Typo.

* Added quotes to selector .

* Reduce reset time 500 -> 350

* Loops do not cause a generation so their chevrons should not have increased opacity.
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3543692019

* Revert reset time

* Renamed `heldSwipes` to `recentSwipes`.

* Autofix the swipes array during `updateSwipeCounter`.

* User messages should not have swipes.

* Chevrons should always be shown on pristine greetings: https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3557893373

* Improve formatting

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3559617088

* Show `pristineGreetingSwipeNotice` once.

* `clearMessageData` when swipe-regenerating a message.

* accountStorage is already imported in the module

* Removed `await`.

* Removed pristine greeting notice.
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3560758598

* Removed redundant functions in `StreamingProcessor` and fixed streamed replies missing counters.

* Moved `markUIGenStopped` after `eventSource.emit`.

Swapped to `saveChatDebounced` to fix: https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3567014810.

* Save a structuredClone of `chat` to prevent an invalid chat from being saved.

* Only `structuredClone` `chat` on `saveChatDebounced`.

* Revert "Only `structuredClone` `chat` on `saveChatDebounced`."

This reverts commit 49498b7aa1410107b294555fb945d977e60bfebf.

* Revert "Save a structuredClone of `chat` to prevent an invalid chat from being saved."

This reverts commit 5f137ed1380107fde0765b951dc634081bdbf2ff.

* Prevent `saveChatDebounced` from saving while the swipe is in progress.
See: https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3567077312

* Fixed animation never ending: https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3567106213

* `forceMesId` and `forceSwipeId` are not objects.

* Fixed Reduced Motion causing a warning when swiping back.

* Only  hide `.mes_buttons` when generating.

* Fix eslint

* Reset duration on switching direction

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-11-26 17:38:31 +02:00
Cohee c04be57f84 Support multiple images in single API response (#4734)
* 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
2025-11-03 00:30:36 +02:00
Cohee de7c113346 Multiple attachments (#4719)
* 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>
2025-11-02 20:10:43 +02:00
Cohee 5c62c3a90d feat: add move up/down functionality for alternate greetings (#4676)
* feat: add move up/down functionality for alternate greetings

* Remove disabled cursor style
2025-10-19 16:46:19 +03:00
Rivelle a418ad0f14 Add -webkit-tap-highlight-color for smoother touch experience (#4630)
* Add interactable outline color CSS variables

Introduces --interactable-outline-color and --interactable-outline-color-faint variables to the body style, both set to transparent for future use in styling interactive elements.

* Update global styles and remove unused CSS variables

Added -webkit-tap-highlight-color to the universal selector for improved touch experience.
2025-10-08 19:46:43 +03:00
Trahloc c14d88dbe0 Fix font size difference in API Connections dropdowns (#4620)
- Fixes visual inconsistency between 'Enter a Model ID' input and 'Available Models' dropdown
- Uses calc(var(--mainFontSize) * 0.95) to match the slightly smaller font size of the dropdown
- Resolves issue #4599

This is the most minimal fix that targets only the specific element causing the visual difference.

Co-authored-by: Trahloc <trahloc@hearth.trahloc.com>
2025-10-07 16:11:18 +03:00
Wolfsblvt d56c649d86 style: hide self-responses label when activation strategy is not natural (#4593) 2025-10-04 13:30:11 +03:00
Wolfsblvt 3e3dfbe05e Small change, (visually) disable "Link to Source" on characters that weren't downloaded from a source (#4588)
* feat: enable character source dropdown based on availability and style disabled options

* feat: emit event when character is in right character panel

* refactor: rename CHARACTER_SELECT_SELECTED event to CHARACTER_EDITOR_OPENED for clarity

* Always disable source option when peeking in groups

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-03 19:48:13 +03:00
Cohee dd2011f5be Streaming fade-in animation (#4568)
* [wip] Add stream fade-in effect for message text and corresponding CSS animation

* Avoid using temporary element during text segmentation

* Add fade in toggle

* Skip whitespace-only nodes

* Fade-in reasoning stream

* Fix case when segmenter is not supported
2025-09-29 23:32:41 +03:00
André M Piva 0f49a059e3 Feat: add first and last buttons to pagination component (#4560)
* add first and last buttons to pagination

* Add i18n support

* Update pagination buttons font

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-09-25 20:42:47 +03:00
Cohee deec251f09 Return newline at the end of styles 2025-09-18 21:20:55 +03:00
Cohee 4e01c9c0dc Use variable for mobile jumbo list button 2025-09-18 21:19:44 +03:00
L eec837cee6 Layout Update (#4514)
* init

* mostly working messy version

* css layout, mobile is fixed

* revert changes

* more of the above

* cleanup

* revert breaking fixes, cleanup dead code

* dead code

* delete fallback

* spacing

* css tweaks and removed getChatBackgroundsList

* mobile sizing

* revert unrelated changes

* use name instead of context

* debounce from constants.js

* replace if/else

* pass images directly

* more of the above

* buttons

* buttons functionality

* add default column counts

* remove .mobile-only-menu-toggle when clicked (layering fix)

* lint

* universal column default of 3

* sacrifice firefox for chrome

* Restore media query

This reverts commit 295a5a81908e58c0bfa5e01fd90fcd62c05471b4.

* Add disabled attribute styles for menu_button

* use opacity 0, pointer events none instead of display:none

* Format styles

* Fix type errors

* Add blur event handler to close mobile menu when focus is lost

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-09-16 13:20:06 +03:00
Rivelle 5aa1c8fbac Improvement: Enhanced UI Consistency (#4499)
* Improvement: Enhanced UI Consistency

- Added a class to `<div class="inline-drawer-toggle inline-drawer-header">` in **AI Response Configuration** and **API Connections** menus to match the styling of similar elements in **User Settings**
- Improved spacing and sizing for buttons such as `.bg_example .jg-menu` in the **Backgrounds** menu. The previous widths and gaps were too small, often causing accidental taps (especially on mobile devices)

* fix

* Adjust padding and background color in style.css

* Update inline drawer classes for configuration sections

* Remove border styles from expandable sections

* fix

* fix

* fix(sad)

* Adjust desktop bg_list width

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-09-09 23:23:34 +03:00
Wolfsblvt dcc6ddf7ad Fix/cleanup and background interactability (keyboard navigation, focus/hover) (#4503)
* refactor: remove unused background styles

* feat: add support for nested @media, @supports, and @container rules in dynamic focus styles

* fix: add keyboard focus support for background menu buttons back

* fix: move "custom" background copy functionality to unified button UI and make it work again

* refactor: simplify CSSContainerRule instance check using window global

* fix: update hover and focus selector placeholder replacements to handle multiple occurrences in selector

* Fix focused outline offset of background samples

* Fix locked background outline color

* Add a11y roles to background menu items

* Add mobile-only button selector

* fix: update button and list item selectors

* Improve keyboard navigation in narrow layout

* Hide rename button for custom=true backgrounds

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-09-09 15:57:16 +03:00
L 0ba317a318 More modern backgrounds buttons and filename (#4484)
* init

* move background styles, enlarge and clip image to get rid of antialising bug

* move styles from style.css to backgrounds.css

* Reformat backgrounds.css

* Improve selector specificity, fix type errors, increase font size on thumbnails, decrease mobile toggle size

* Fix webp chat backgrounds thumbnails

* Respect reduced motion preference

* Remove transition delay

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-09-04 18:13:35 +03:00
L e1af2fb47d Header change (#4465)
* header changes

* new line, comments

* Simplify styling targets

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-08-31 14:28:12 +03:00
Cohee 394fc508ee Move margin from reasoning buttons to actions block 2025-08-09 19:02:29 +03:00
Cohee 2a971a517c Adjust tags list to use screen size relative units 2025-07-25 22:31:30 +03:00
RossAscends b2cae4032c Make charlist tag filter list scrollable 2025-07-23 13:01:53 +09:00
Cohee afa3261746 Redesign Creator's Note block (#4298)
* Restyle creator's notes block

* Creator Notes to standoutHeader styling, allows for viewing Note without hiding chardefs

* Fix closing tag

* Remove stray close tag

* Adjust spoiler-free mode toggle

* Make the whole toggle area clickable

* Remove redundant comment

* Add empty state for creator's notes

* Adjust paddings

* Update public/index.html

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: RossAscends <124905043+RossAscends@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-07-23 00:08:56 +03:00
Cohee 5f32fba499 Increase padding of rm fixed top 2025-07-20 00:25:13 +03:00
Cohee fb86dedf29 Show controls when editing compact messages 2025-07-18 22:10:09 +03:00
Cohee 4fd39e8ad3 Improve right menu kbd nav when no char is selected 2025-07-18 22:03:43 +03:00
Cohee c6fe918556 Update .text_muted styles for improved readability and theme consistency 2025-07-18 21:18:00 +03:00
Cohee 043e3bfc50 Make rm_button_bar wrap 2025-07-18 20:55:57 +03:00
Cohee ba12b32a1f Characters list top panel touchup (#4282)
* 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>
2025-07-18 20:01:44 +03:00
Cohee de3d91670a Fix add max height and scroll overflow to hamburger and wand menus
Fixes #4242
2025-07-07 21:55:45 +03:00
Cohee 51904c2f10 Add persona titles (#4224)
* Add persona titles

* Refactor persona title editing
2025-07-03 19:28:09 +03:00
Cohee 0fa1b26fa4 Add deletion control for attached videos 2025-06-23 01:01:44 +03:00
Cohee fdf881d074 Increase slider number input width 2025-06-13 22:37:13 +03:00
RossAscends de1b4a3770 range slider knobs match theme 2025-06-13 21:21:19 +09:00
RossAscends 603cbb5fb3 range sliders also respect theme colors 2025-06-13 15:53:16 +09:00
RossAscends dd03724eb4 CSS: .right_menu_button respects theme colors, no longer forces greyscale 2025-06-13 15:36:47 +09:00
Cohee af3906e243 Change selector of chat-scoped <hr> #4144 2025-06-12 21:37:40 +03:00
Cohee 87ac4b37e4 Increase <hr> opacity in chat from 0.2 to 0.4 2025-06-12 19:33:01 +03:00
cloak1505 b3be989e24 Increase <hr>'s opacity from 0.2 to 0.4 2025-06-11 20:40:45 -05: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