Skip to content

Code refactoring #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 19, 2025
Merged

Code refactoring #19

merged 3 commits into from
Jun 19, 2025

Conversation

ChrisLauinger77
Copy link
Owner

No description provided.

Refactors indicator visibility logic

Improves code maintainability by extracting the system indicator visibility update into its own function.

Updates the settings monitoring to use a more structured approach, associating setting keys with their corresponding callback functions. This enhances readability and reduces potential errors when managing settings changes.
Updates the "Developing" section title in README to "Contributing"
to better reflect the content and encourage community involvement.
@ChrisLauinger77 ChrisLauinger77 requested a review from Copilot June 19, 2025 19:54
Copy link
Contributor

@Copilot 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 how the SettingsCenter extension manages its system indicator and settings change handlers, and updates the project README heading.

  • Always instantiate the indicator and control its visibility via a new visible property
  • Change indicator insertion to index 0 and introduce a dedicated setIndicatorVisible method
  • Refactor settings watchers to a key–callback mapping and rename callbacks for clarity
  • Rename README section from “Developing” to “Contributing”

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
[email protected]/extension.js Simplified indicator visibility logic; updated insertion API; refactored settings watchers and renamed handlers
README.md Renamed "Developing" section to "Contributing"
Comments suppressed due to low confidence (4)

[email protected]/extension.js:114

  • This new public method lacks a doc comment; consider adding a brief JSDoc explaining its purpose and expected behavior to improve code documentation.
        setIndicatorVisible(visible) {

[email protected]/extension.js:126

  • [nitpick] The method name _onParamChangedIndicator could be more descriptive (e.g., _updateIndicatorVisibility) to clarify its intent.
    _onParamChangedIndicator() {

[email protected]/extension.js:110

  • [nitpick] Inserting the indicator at index 0 changes its ordering in the panel; adding a comment explaining this positioning choice would aid future maintainers.
            QuickSettingsMenu._indicators.insert_child_at_index(this, 0);

[email protected]/extension.js:145

  • The new setting change handler for "show-systemindicator" toggles UI state; consider adding or updating unit/UI tests to cover this visibility toggle behavior.
                key: "show-systemindicator",

@ChrisLauinger77 ChrisLauinger77 merged commit 24b02b7 into main Jun 19, 2025
2 checks passed
@ChrisLauinger77 ChrisLauinger77 deleted the dev branch June 19, 2025 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant