trueshade
Reactive icon

TrueShade

Stable version 1.2.0 (Compatible with OutSystems 11)
Uploaded
 on 6 Oct (yesterday)
 by 
5.0
 (5 ratings)
trueshade

TrueShade

Compatible with:
Created on OutSystems 11

Version 1.2.0

Stable
Current
See documentation
Uploaded on 6 Oct (14 hours ago) by 
Compatible with:
Version 11
11.9.2 or higher
11.7.6 to 11.9.0
11.0.539 to 11.0.615
Database:
All
Release notes:

New Features:

  • Optional AppName parameter in Initialize(appName)
    • TrueShade can now be initialized with an explicit AppName by calling TrueShade.Theme.Initialize(appName). When set, this name is used to generate both the localStorage key and the BroadcastChannel ID, allowing multiple front-ends under the same portal to share a common dark/light theme preference. If no parameter is provided, the previous behavior using the derived $OS_<module>$ key remains unchanged.


Compability:

The update is fully backward-compatible. Existing implementations using Initialize() without arguments will behave exactly as before, while new integrations can optionally specify an AppName to enable shared preferences.

Application Objects:
TrueShade has 1 AOs.

Version 1.1.1

Stable
See documentation
Uploaded on 4 Sep by 
Compatible with:
Version 11
11.9.2 or higher
11.7.6 to 11.9.0
11.0.539 to 11.0.615
Database:
All
Release notes:

Added validation for TrueShade availability

  • Implemented a safeguard to verify that window.TrueShade and window.TrueShade.Theme are defined before invoking public APIs.

  • Prevents runtime errors when the TrueShade library is not properly loaded.

  • Improves stability and ensures API calls are only made when the underlying objects are available.

Application Objects:
TrueShade has 1 AOs.

Version 1.1.0

Stable
See documentation
Uploaded on 25 Aug by 
Compatible with:
Version 11
11.9.2 or higher
11.7.6 to 11.9.0
11.0.539 to 11.0.615
Database:
All
Release notes:

New Features


  • BroadcastChannel support

    Theme synchronization across multiple browser tabs/windows using BroadcastChannel (replaces storage event listeners).

  • Theme.OnChange(cb) API

    New subscription API for theme changes.

    • Callbacks now receive two arguments:

      • effective: resolved theme ('dark' | 'light')

      • raw: stored preference ('system-default' | 'dark' | 'light')

    • Backward compatible with single-argument callbacks.

  • Initial emit on Initialize()

    Subscribers get the current theme immediately after initialization.

  • Smarter caching

    Internal caching for module name, storage key, and last applied theme to reduce redundant localStorage lookups.


Improvements


  • Robust seeding (ensureSeeded()):

    Always guarantees a valid value (system-default) even when storage is unavailable (e.g., private mode).

  • Optimized setLayoutColorScheme():

    Avoids redundant writes to localStorage and DOM when the value didn’t change.

  • Better drift prevention:

    applyTheme() and onColorSchemeChange() now keep <html data-theme> strictly in sync with the chosen mode.

  • Error resilience:

    Listener and storage errors are safely swallowed to prevent breaking apps.

  • Enhanced dispose():

    Cleans up listeners, closes BroadcastChannel, clears subscribers, and resets internal state.


Removed / Changed

  • Removed window.storage event listener → replaced with BroadcastChannel.

  • getStorageKey() now caches results for efficiency.

  • setLayoutColorScheme() no longer always forces a write — it only updates when necessary.




Application Objects:
TrueShade has 1 AOs.