Skip to content

Conversation

@Leonabcd123
Copy link
Contributor

@Leonabcd123 Leonabcd123 commented Jan 7, 2026

Description

Closes #7186

@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Jan 7, 2026
@Miodec Miodec added the waiting for update Pull requests or issues that require changes/comments before continuing label Jan 10, 2026
@github-actions github-actions bot removed the waiting for update Pull requests or issues that require changes/comments before continuing label Jan 11, 2026
@Miodec Miodec marked this pull request as ready for review January 21, 2026 18:31
Copilot AI review requested due to automatic review settings January 21, 2026 18:32
@github-actions github-actions bot added the waiting for review Pull requests that require a review before continuing label Jan 21, 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 pull request removes jQuery dependencies from the test directory, replacing jQuery calls with native DOM manipulation utilities provided by the ElementWithUtils and ElementsWithUtils classes from frontend/src/ts/utils/dom.ts.

Changes:

  • Refactored jQuery selectors ($) to native DOM utilities (qs, qsa, qsr)
  • Replaced jQuery event handlers with native addEventListener and custom onChild method
  • Updated DOM manipulation methods (addClass, removeClass, setHtml, etc.) to use ElementWithUtils API
  • Removed jQuery-specific type annotations (JQuery.KeyDownEvent → KeyboardEvent)

Reviewed changes

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

Show a summary per file
File Description
frontend/src/ts/utils/dom.ts Added new utility methods (getOuterHeight, getOuterWidth, getChildren) and made scrollIntoView/focus parameters optional
frontend/src/ts/test/test-ui.ts Extensive refactoring of jQuery to native DOM utilities, updated event handlers and element manipulation
frontend/src/ts/test/test-screenshot.ts Replaced jQuery selectors and methods with native utilities
frontend/src/ts/test/test-logic.ts Updated event handlers and type annotations
frontend/src/ts/test/test-config.ts Refactored animations and DOM manipulations
frontend/src/ts/test/result.ts Extensive jQuery removal throughout result display logic
frontend/src/ts/test/replay.ts Updated event handlers and selectors
frontend/src/ts/test/pb-crown.ts Removed jQuery, used native utilities for crown display
frontend/src/ts/test/out-of-focus.ts Refactored focus warning display
frontend/src/ts/test/monkey.ts Updated monkey animation logic
frontend/src/ts/test/live-speed.ts Refactored live speed display
frontend/src/ts/test/live-burst.ts Refactored live burst display
frontend/src/ts/test/live-acc.ts Refactored live accuracy display
frontend/src/ts/test/layout-emulator.ts Updated event listener registration
frontend/src/ts/test/funbox/memory-funbox-timer.ts Updated timer display
frontend/src/ts/test/funbox/layoutfluid-funbox-timer.ts Updated timer display
frontend/src/ts/test/funbox/funbox.ts Refactored funbox activation/deactivation
frontend/src/ts/test/funbox/funbox-functions.ts Updated funbox function implementations
frontend/src/ts/test/focus.ts Updated focus management
frontend/src/ts/states/connection.ts Added debugging console.warn statements that should be removed
frontend/src/ts/observables/connection-event.ts Added debugging console.warn statement that should be removed
frontend/tests/test/layout-emulator.spec.ts Updated test type annotations

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

Miodec and others added 5 commits January 21, 2026 19:43
Miodec
Miodec previously approved these changes Jan 21, 2026
@Miodec Miodec requested a review from Copilot January 21, 2026 19:10
@github-actions github-actions bot added waiting for review Pull requests that require a review before continuing and removed waiting for review Pull requests that require a review before continuing labels Jan 21, 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

Copilot reviewed 20 out of 20 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.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 7 comments.

Comments suppressed due to low confidence (1)

frontend/src/ts/utils/dom.ts:308

  • The addClass and removeClass methods split space-separated class names into an array and recursively call themselves. However, the split(" ") call will create empty strings if there are multiple consecutive spaces (e.g., "class1 class2"). This could lead to adding/removing empty class names. Consider filtering out empty strings after splitting: className.split(" ").filter(cn => cn.length > 0).
  addClass(className: string | string[]): this {
    if (Array.isArray(className)) {
      this.native.classList.add(...className);
    } else {
      if (className.includes(" ")) {
        return this.addClass(className.split(" "));
      }
      this.native.classList.add(className);
    }
    return this;
  }

  /**
   * Remove a class from the element
   */
  removeClass(className: string | string[]): this {
    if (Array.isArray(className)) {
      this.native.classList.remove(...className);
    } else {
      if (className.includes(" ")) {
        return this.removeClass(className.split(" "));
      }
      this.native.classList.remove(className);
    }
    return this;
  }

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

@Miodec Miodec merged commit 81829ed into monkeytypegame:master Jan 21, 2026
15 checks passed
@Leonabcd123 Leonabcd123 deleted the bye-jquery-test branch January 21, 2026 19:54
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 waiting for review Pull requests that require a review before continuing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transition away from JQuery

4 participants