refactor: extract hardcoded config from AppShell template#321
Merged
Conversation
Move TTS provider definitions, accepted upload file types, and canvas iframe sandbox permissions into a dedicated constants module (src/core/constants.js). AppShell now interpolates these values at runtime instead of embedding them in the HTML string. Adding a new TTS provider now requires editing only one file instead of searching through the template markup. Addresses MCERQUA#234.
Owner
|
Thanks for this @Alexi5000 — nice cleanup, and it pairs well with your accessibility PR. Heads-up on what I did so nothing's a surprise: your #320 (ARIA labels) merged into |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracts hardcoded configuration values from the
AppShell.jsHTML template into a dedicatedsrc/core/constants.jsmodule:The shell template (
buildShellHTML()) now interpolates these constants at runtime instead of embedding them directly in the markup.Motivation
Adding or removing a TTS provider currently requires finding and editing the HTML string in AppShell.js. With this change, provider definitions live in one place —
constants.js— making the system easier to extend and less error-prone.Addresses #234.
Changes
src/core/constants.jsTTS_PROVIDERS,TRANSCRIPT_UPLOAD_ACCEPT,CANVAS_SANDBOX_PERMISSIONSsrc/ui/AppShell.jsbuildShellHTML()function; interpolate constantsTest Plan