refactor: reorganize JavaScript into modular file structure #918
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
Reorganizes the monolithic JavaScript files into a modular file structure for better maintainability and reusability, without changing any functionality.
Changes
New directory structure:
js/shared/- Cross-page utilities (csv-utils, json-utils, variables)js/main/- Main prompts page modules (theme, search, cards, modal, platform, preferences, yaml-modal, init)js/main/templates/- Reusable card and modal templatesjs/vibe/- Vibe page modules (csv-utils, prompts, search, modal, platform, init)js/vibe/templates/- Vibe-specific card templatesjs/embed/- Embed designer (designer.js)js/embed-preview/- Embed preview (preview.js)Layout updates:
_layouts/default.html- Updated to load modular scripts in correct order_layouts/embed.html- Points tojs/embed/designer.js_layouts/embed-preview.html- Points tojs/embed-preview/preview.js_layouts/vibe.html- New dedicated layout for vibe page with vibe-specific scriptsHuman Review Checklist
script.js,vibe/script.js,embed-script.js, andembed-preview-script.jsmay still exist in the repo_layouts/vibe.htmlwas created from scratch and should match expected styling/behaviorNotes
Link to Devin run: https://app.devin.ai/sessions/4c7016a90cc049d29019172ee40e0d1f
Requested by: Fatih Kadir Akın ([email protected]) (@f)