Skip to content

refactor: do not assign this to self in fc-date-picker - #130

Open
paodb wants to merge 1 commit into
masterfrom
refactor/remove-self-alias
Open

paodb wants to merge 1 commit into
masterfrom
refactor/remove-self-alias

Conversation

@paodb

@paodb paodb commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Remove the self alias in fc-date-picker.js and use this directly, since the listener is an arrow function and already binds this to the component.

Close #127

Summary by CodeRabbit

  • No user-facing changes
    • The date picker’s visible behavior and appearance are unchanged in this update. No new features or user-visible fixes are included.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The opened-changed handler now uses this instead of a captured self reference when accessing the overlay content and wrapping the month scroller.

Changes

Date picker handler

Layer / File(s) Summary
Overlay handler
src/main/resources/META-INF/frontend/fc-date-picker/fc-date-picker.js
The handler accesses the month scroller through this. The first-open guard, theme assignment, and element wrappers remain.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Refactor

Suggested reviewers: javier-godoy

Merge Risk: Minimal · up to e3906

This is a small refactor that removes a redundant alias without changing behavior. It carries no identified merge risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "refactor: do not assign this to self in fc-date-picker" matches the change. The raw summary says the opened-changed handler now reads _overlayContent through this instead of a captured self…
Linked Issues check Passed Issue #127 asks that fc-date-picker.js stop assigning this to self (const self=this; at line 76 in the issue). The reviewed head file at `src/main/resources/META-INF/frontend/fc-date-picker/fc…
Out of Scope Changes check Passed The PR summary reports one changed file, fc-date-picker.js, with +5/-6 lines. The change removes the self alias and replaces self references with this in the same handler. This directly implem…
Full details: Title check

Explanation

The title "refactor: do not assign this to self in fc-date-picker" matches the change. The raw summary says the opened-changed handler now reads _overlayContent through this instead of a captured self reference, and the objectives describe removing the self alias in fc-date-picker.js. The title names the main change and the file, so it is fully related to the changeset.

Full details: Linked Issues check

Explanation

Issue #127 asks that fc-date-picker.js stop assigning this to self (const self=this; at line 76 in the issue). The reviewed head file at src/main/resources/META-INF/frontend/fc-date-picker/fc-date-picker.js contains no self alias. The opened-changed listener is an arrow function. It now uses this._overlayContent, this._updateMonthStyles(...), and this._set_theme(...) directly. Those references bind to the component, as before. The behavior is unchanged: the theme is applied, _updateElement and _createElement are wrapped once, and month styles are updated. The base-side text diff could not be read, so the removal is confirmed from the head file content and the PR summary, not from a diff hunk. No automated test changes are required by the issue. Coding requirements are fully met.

Full details: Out of Scope Changes check

Explanation

The PR summary reports one changed file, fc-date-picker.js, with +5/-6 lines. The change removes the self alias and replaces self references with this in the same handler. This directly implements #127. No unrelated changes were identified in the summary. The base-side diff could not be read, so this verdict relies on the PR summary's file list and the head file content.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 331dc147-9b99-4749-a523-c9ad555bb2e5
Commits

Reviewing files that changed from the base of the PR and between 8de8ee6 and e3906fb.

Files selected for processing: 1

  • src/main/resources/META-INF/frontend/fc-date-picker/fc-date-picker.js

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@sonarqubecloud

Copy link
Copy Markdown

@paodb

paodb commented Nov 16, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@paodb
paodb marked this pull request as ready for review November 16, 2026 18:24
@paodb
paodb requested a review from scardanzan November 16, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Do

Development

Successfully merging this pull request may close these issues.

refactor: do not assign this to self

1 participant