mirror of
https://github.com/dualshock-tools/dualshock-tools.github.io.git
synced 2026-03-01 11:19:54 +03:00
[PR #135] [CLOSED] Refactor and split into smaller files #158
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dualshock-tools/dualshock-tools.github.io/pull/135
Author: @mathiasm74
Created: 9/8/2025
Status: ❌ Closed
Base:
main← Head:refactor-and-split-into-smaller-files📝 Commits (5)
c42c034Define with const or let, remove unnessessary spaces, start extracting controller API calls in separate functions that don't update the UI90a2bfaContinue separating calls to controller APIs from UI updates and deduplicate related code150a58dRefactor into separate files with abstractions for controller typese8d85e9Split the code into smaller more manageble filesd9496c2Bug fixes📊 Changes
30 files changed (+5394 additions, -4382 deletions)
View changed files
➕
assets/dualshock-controller.svg(+108 -0)➕
assets/icons.svg(+27 -0)➖
core.js(+0 -3306)➕
css/finetune.css(+116 -0)➕
css/main.css(+23 -0)📝
index.html(+219 -1076)➕
js/controller-manager.js(+484 -0)➕
js/controllers/base-controller.js(+148 -0)➕
js/controllers/controller-factory.js(+101 -0)➕
js/controllers/ds4-controller.js(+365 -0)➕
js/controllers/ds5-controller.js(+434 -0)➕
js/controllers/ds5-edge-controller.js(+248 -0)➕
js/core.js(+866 -0)➕
js/modals/calib-center-modal.js(+237 -0)➕
js/modals/calib-range-modal.js(+62 -0)➕
js/modals/finetune-modal.js(+754 -0)➕
js/stick-renderer.js(+213 -0)➕
js/template-loader.js(+69 -0)➕
js/translations.js(+193 -0)➕
js/utils.js(+160 -0)...and 10 more files
📄 Description
Code Refactoring and Architecture Improvements
This PR implements a comprehensive refactoring of the DualShock Calibration GUI codebase to improve maintainability, readability, and organization. The changes include:
Major Changes
Modular Architecture: Implemented a proper class hierarchy with a BaseController abstract class and specific implementations for DS4, DualSense, and DualSense Edge controllers.
Separation of Concerns: Decoupled controller API calls from UI updates, allowing for better testability and cleaner code organization.
Component-Based Structure: Split the monolithic codebase into smaller, more manageable files organized by functionality:
Modern JavaScript Practices: Updated code to use ES6+ features like const/let declarations, classes, and modules.
Technical Details
These changes provide a solid foundation for future feature development while making the codebase more maintainable and easier to understand for new contributors.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.