Skip to content

Comments

[94] Fix: canvas syntax highlighting not syncing with theme changes via GPThemes btn#97

Merged
itsmartashub merged 13 commits intomainfrom
fix/codemirror-radix-theme-sync
Jan 7, 2025
Merged

[94] Fix: canvas syntax highlighting not syncing with theme changes via GPThemes btn#97
itsmartashub merged 13 commits intomainfrom
fix/codemirror-radix-theme-sync

Conversation

@itsmartashub
Copy link
Owner

Closes #94

Dispatch StorageEvent to trigger all the ChatGPT functions that are based on localStorage theme value.

On slower devices this seems laggy for Chromium users, but it is what it is if we want to avoid the need of page refreshing to change the theme for Canvas code syntax too...

Maybe I will add some loader showed during the theme appling process, but the loader duration can't be dynamic in this case, and I don't like to use the fixed predefined values...

- Manually changing the theme value in localStorage now dispatches a `StorageEvent` to notify the system of the update
- This ensures the CodeMirror syntax theme updates correctly without requiring a page refresh
- Note: The theme change may cause a brief lag, but it avoids the need for a full page reload

Changes summary:
    - Dispatching a `StorageEvent` after setting the theme value in localStorage to ensure the CodeMirror syntax theme updates correctly, avoiding the need for a page refresh. A brief lag may occur during the theme change, but this will prevent the need for a full page reload.
- Remove some transitions, such as those in sidebars
- Limit global transitions to specific properties instead of using "all"
- Note: Further investigation is needed to refine the transition settings

Changes summary:
    - Removed some transitions, particularly in sidebars, and limited global transitions to specific properties to improve performance. Further investigation is planned to refine these settings.
…PCs (#94)

- Add a loader to indicate theme changes are in progress
- Ensure the loader is displayed during theme changes, especially when the canvas chat is opened, to prevent lagging on lower-performance systems
- Note: The loader may appear briefly if the changes are quick, but it ensures a smoother user experience

Changes summary:
    - Added a loader to indicate theme changes are in progress, ensuring a smoother user experience, especially when the canvas chat is opened and on lower performance systems.
…anager-2.js` (#94)

- Replace "loading" text with a spinner in the loader
- Introduce themeManager 2 to evaluate performance and user experience improvements

Changes summary:
    - Updated the loader to use a spinner instead of "loading" text and introduced themeManager-2 to assess performance and user experience, aiming to reduce lag and improve UX.
)

- Rewrite the theme manager to be more efficient and DRY
- Optimize code to reduce redundancy and improve maintainability

Changes summary:
    - Refactored the theme manager to optimize the code and make it more DRY, reducing redundancy and improving maintainability.
…-full (#94)

- There are still issues with animations not being triggered...
@itsmartashub itsmartashub self-assigned this Jan 7, 2025
@itsmartashub itsmartashub merged commit f448a07 into main Jan 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Canvas syntax highlighting not syncing with theme changes via GPThemes btn

1 participant