refactor(extension): improve code quality #23

Merged
kiyui merged 10 commits from refactor into master 3 years ago
kiyui commented 3 years ago (Migrated from github.com)
Owner

Refactor code to be cleaner & easier to maintain

Changed proposed:

  • Relint with standard
  • Rename SliderMenuItem to NightLightSlider
  • Refactor NightLightSlider such that NightLightExtension handles view updates and non-slider update on proxy g-properties-changed signal
  • Abstract updating night light schedule to a NightLightSchedule class that is in turn handled by NightLightExtension
  • Use GLib.timeout_add instead of the deprecated Mainloop function
  • Use standard for linting
  • Replace makefile build tools with npm

To-do:

  • Add standard to package.json and handle with precommit hook
  • Handle extension icon instance so can support #17 in the future
  • Clean up add to menu logic to support multiple item placements, such as #22
  • Add hook to NightLightSlider change event to support #18
  • Review places where clean-up is necessary on extension disable

Testing:

  • Change min & max feature working
  • Can status icon feature working
  • Show always feature working
  • Enable always feature with schedule update is working
Refactor code to be cleaner & easier to maintain Changed proposed: - Relint with `standard` - Rename `SliderMenuItem` to `NightLightSlider` - Refactor `NightLightSlider` such that `NightLightExtension` handles view updates and non-slider update on proxy `g-properties-changed` signal - Abstract updating night light schedule to a `NightLightSchedule` class that is in turn handled by `NightLightExtension` - Use `GLib.timeout_add` instead of the deprecated `Mainloop` function - Use `standard` for linting - Replace `makefile` build tools with `npm` To-do: - [x] Add `standard` to `package.json` and handle with `precommit` hook - [x] Handle extension `icon` instance so can support #17 in the future - [x] Clean up `add to menu` logic to support multiple item placements, such as #22 - [x] Add hook to `NightLightSlider` change event to support #18 - [x] Review places where clean-up is necessary on extension `disable` Testing: - [x] Change `min` & `max` feature working - [x] Can status icon feature working - [x] Show always feature working - [x] Enable always feature with schedule update is working
kiyui commented 3 years ago (Migrated from github.com)
Poster
Owner

Refactored extension, for testing purposes: night-light-slider.timur@linux.com.zip

Refactored extension, for testing purposes: [night-light-slider.timur@linux.com.zip](https://github.com/TimurKiyivinski/gnome-shell-night-light-slider-extension/files/1886270/night-light-slider.timur.linux.com.zip)
The pull request has been merged as aabff45a04.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.