Commit Graph

23 Commits

Author SHA1 Message Date
Wolfsblvt 4df18ccb0b Add Slug Parameter to Action Loader for Programmatic Identification (#5490)
* feat: add slug parameter to action-loader for programmatic identification

Add optional `slug` parameter to ActionLoaderHandle for easier identification via code or CSS. Update all loader.show() calls across the codebase to include descriptive slugs ('app-init', 'chat-rename', 'chat-delete', 'bulk-delete', 'chat-load', 'image-generation', 'legacy-loader'). Add data attributes (data-slug, data-loader-id, data-blocking) to toast content div. Expose slug via getter and make id private with getter.

* Apply suggestions from code review

Fix slug jsdoc wording

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

* fix: Add identifier to second loader in img gen

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-20 22:29:40 +03:00
Wolfsblvt 45009cd0e4 Deprecate legacy loader and migrate all callsites to action-loader system with informative toasts (#5326)
* Refactor loader.js to use action-loader system and move overlay management into action-loader module

- Deprecate showLoader() and hideLoader() in favor of action-loader API
- Implement legacy functions as thin wrappers around ActionLoaderHandle
- Move overlay management (showOverlay, hideOverlay, isOverlayDisplayed) into action-loader.js
- Move Popup-based loader implementation and preloader cleanup to action-loader
- Add loader.isBlocking() method to check for active blocking overlays

* Migrate from legacy loader functions to action-loader API throughout codebase

- Replace showLoader()/hideLoader() imports with loader from action-loader.js
- Update firstLoadInit() to use loader.show() with title, message, and ToastMode.STATIC
- Pass initLoaderHandle to getSettings() for early hide during onboarding flow
- Refactor renameGroupOrCharacterChat() to use loader.show() instead of boolean flag
- Wrap handleDeleteChat() with loader.show() and proper error handling
- Update BulkEditOver...

* Update loader titles and remove redundant reload notification

- Change bookmark loader title from "Bookmark" to "Chat History" for clarity
- Remove loader notification before extensions reload (redundant with browser reload)

* lint fix

* Add splash screen support to action loader with custom overlay content

- Add `overlayContent` option to ActionLoaderOptions for custom HTML in overlay
- Implement splash screen styles with centered logo, spinner, and message
- Update firstLoadInit() to use custom splash screen instead of static toast
- Pass custom content through showOverlay() to replace default spinner
- Adjust non-blocking loader warning to account for custom overlay content

* Refactor loader overlay to use DOM elements instead of HTML strings

- Add createDefaultLoaderOverlay() function to generate fresh loader overlay elements
- Export createOverlay() method on loader utility API for external use
- Change overlayContent parameter type from string-only to string|HTMLElement|null
- Add getOverlayContent() helper to normalize custom content for Popup
- Update firstLoadInit() to build splash screen using DOM manipulation instead of template literals
- Add splash-logo class and

* Use a true ellipsis

* Adjust sizing for desktop

* Even truer ellipsis

* Add transition to splash screen and fix blur animation on hideOverlay (#5338)

* Initial plan

* Blur entire splash screen on hideOverlay, not just spinner

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/eee6c06d-7c9d-4363-bc8f-2647ed390368

* Add transition to splash-screen and fix transition detection

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/9368bc36-31a0-4a58-aebd-7b569696ff2e

---------

Co-authored-by: anthropic-code-agent[bot] <242468646+Claude@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Add translations to supported locales

* Localize logo alt on welcome screen

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
Co-authored-by: Claude <242468646+Claude@users.noreply.github.com>
2026-03-22 03:30:23 +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
Cohee f53f039452 Fix toast position on app init 2025-09-13 21:23:11 +03:00
Cohee e4dda3c488 Run eslint 2025-01-30 22:00:46 +02:00
IceFog72 578c3dda73 Update loader being removed correctly on manually forced transition duration (#3384)
---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-01-30 21:59:59 +02:00
Cohee aef879ced0 Fix double blur on preloader 2024-07-04 01:41:21 +03:00
Cohee da63c26258 Remove popup animation 2024-06-30 23:27:49 +03:00
Wolfsblvt 5a8973d12a Fix double transition of loader backdrop 2024-06-30 22:17:23 +02:00
Cohee 5c318cd3f3 Move preloader yoinking on animation end 2024-06-30 23:10:25 +03:00
Wolfsblvt 47f00d3755 Fix 'preloader' overlay being removed too early 2024-06-30 22:03:38 +02: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
Wolfsblvt aff4138263 Update loader to use modal dialog overlay 2024-06-30 19:45:42 +02:00
Cohee 022c180b62 Lint and clean-up 2024-04-15 00:39:15 +03:00
Cohee 3f3e23420d Working login flow 2024-04-07 23:08:19 +03:00
RossAscends f0aa0c5540 imp user creation, split out from loader.js (still disabled) 2024-04-08 02:22:44 +09:00
RossAscends c0264f1cd6 mockup user select modal (disabled) 2024-04-08 00:18:21 +09:00
Cohee 91811f63b5 lint: Fix JSdocs 2023-12-03 14:23:20 +02:00
Cohee c63cd87cc0 lint: Require semicolons 2023-12-02 21:11:06 +02:00
valadaptive a37f874e38 Require single quotes 2023-12-02 13:04:51 -05:00
RossAscends 610c9b9f24 update loader styling 2023-11-01 12:40:21 +09:00
Cohee a0706fcfc8 Add loader UI component 2023-10-31 22:16:33 +02:00