Skip to content

Conversation

@Miodec
Copy link
Member

@Miodec Miodec commented Jan 1, 2026

Refactor

@Miodec Miodec changed the title refactor: use dom utils in animated-modal refactor: use dom utils in animated-modal (@miodec) Jan 1, 2026
@Miodec Miodec requested a review from Copilot January 1, 2026 22:05
@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Jan 1, 2026
@github-actions github-actions bot added the waiting for review Pull requests that require a review before continuing label Jan 1, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors modal and animated modal code to use the DOM utility wrapper (ElementWithUtils) instead of direct DOM manipulation and jQuery, improving code consistency and type safety.

Key Changes:

  • Updated AnimatedModal class to use ElementWithUtils for wrapper and modal elements
  • Added new utility methods to ElementWithUtils: setChecked(), getChecked(), focus(), and select()
  • Refactored 30+ modal files to use DOM utils for event handling, element queries, and DOM manipulation

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
frontend/src/ts/utils/dom.ts Added new utility methods for checked state, focus, and select functionality to ElementWithUtils class
frontend/src/ts/utils/animated-modal.ts Converted wrapper and modal elements to use ElementWithUtils, updated event handlers and element queries
frontend/src/ts/utils/simple-modal.ts Updated element types to ElementWithUtils and refactored button state management
frontend/src/ts/modals/word-filter.ts Replaced querySelectorAll with qsa() method for button queries
frontend/src/ts/modals/user-report.ts Refactored element queries and event handlers to use DOM utils
frontend/src/ts/modals/support.ts Updated event handler to use .on() method
frontend/src/ts/modals/streak-hour-offset.ts Replaced innerHTML with setHtml(), querySelector with qs(), and direct DOM manipulation with utility methods
frontend/src/ts/modals/share-test-settings.ts Updated setup function signature and converted querySelectorAll to qsa()
frontend/src/ts/modals/share-custom-theme.ts Replaced direct checked property access with setChecked() method
frontend/src/ts/modals/save-custom-text.ts Updated event handlers to use .on() method and setup function signature
frontend/src/ts/modals/register-captcha.ts Updated element query to use qs() method
frontend/src/ts/modals/quote-submit.ts Added ElementWithUtils import and updated setup function signature
frontend/src/ts/modals/quote-search.ts Refactored element queries, event handlers, and updated setup function signature
frontend/src/ts/modals/quote-report.ts Updated setup function signature and event handler
frontend/src/ts/modals/quote-rate.ts Converted querySelectorAll to qsa() and addEventListener to on()
frontend/src/ts/modals/quote-approve.ts Updated event handler to use .on() method
frontend/src/ts/modals/practise-words.ts Converted querySelectorAll to qsa() and event handlers to on()
frontend/src/ts/modals/pb-tables.ts Replaced innerHTML with setText(), empty(), and appendHtml() methods
frontend/src/ts/modals/mobile-test-config.ts Converted querySelectorAll to qsa() and addEventListener to on()
frontend/src/ts/modals/last-signed-out-result.ts Replaced innerHTML with setHtml() method
frontend/src/ts/modals/import-export-settings.ts Refactored element queries and attribute manipulation to use DOM utils
frontend/src/ts/modals/google-sign-up.ts Updated event handler to use on() method
frontend/src/ts/modals/forgot-password.ts Refactored element queries and value retrieval to use DOM utils
frontend/src/ts/modals/edit-result-tags.ts Replaced querySelector with qs(), innerHTML with empty(), and appendChild with append()
frontend/src/ts/modals/edit-profile.ts Updated event handler to use on() method
frontend/src/ts/modals/edit-preset.ts Converted querySelector to qs() and addEventListener to on()
frontend/src/ts/modals/dev-options.ts Refactored all querySelector calls to qs() and addEventListener to on()
frontend/src/ts/modals/custom-word-amount.ts Updated element queries and event handlers to use DOM utils
frontend/src/ts/modals/custom-text.ts Converted querySelectorAll to qsa() and addEventListener to on()
frontend/src/ts/modals/custom-test-duration.ts Updated element queries and event handlers to use DOM utils
frontend/src/ts/modals/custom-generator.ts Updated setup function signature and event handlers
frontend/src/ts/modals/cookies.ts Refactored element queries, class manipulation, and checked state management
frontend/src/ts/commandline/commandline.ts Replaced querySelector with qsr(), classList manipulation with addClass/removeClass, and textContent with setText()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 33 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 33 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions bot removed the waiting for review Pull requests that require a review before continuing label Jan 2, 2026
Copy link
Contributor

@Leonabcd123 Leonabcd123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to all other instances in modals/custom-text.ts.

Copy link
Contributor

@Leonabcd123 Leonabcd123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Miodec Miodec merged commit 8fb18d6 into master Jan 2, 2026
14 checks passed
@Miodec Miodec deleted the animated-modal branch January 2, 2026 17:06
Miodec added a commit that referenced this pull request Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend User interface or web stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants