Skip to content

Refactor/cleanup tray related code after PR merged#7856

Merged
FreeTubeBot merged 2 commits into
FreeTubeApp:developmentfrom
PikachuEXE:tray-cleanup-1
Aug 24, 2025
Merged

Refactor/cleanup tray related code after PR merged#7856
FreeTubeBot merged 2 commits into
FreeTubeApp:developmentfrom
PikachuEXE:tray-cleanup-1

Conversation

@PikachuEXE

@PikachuEXE PikachuEXE commented Aug 16, 2025

Copy link
Copy Markdown
Member

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

#6915

Description

Cleanup per #6915 (review)
Addressed stuff:

  • Commented code
  • Using .length as boolean -> .length === 0 / > 0
  • If (!something) else -> if (something) else
  • Move tray related code in main process to be behind process.platform !== 'darwin' so they should be removed on build time

Screenshots

Nope

Testing

Same as #6915

  • Update _scripts/webpack.main.config.js from 'process.platform': '${process.platform}', to 'process.platform': '\'darwin\'', (replace `darwin with other values later
  • yarn run pack && npx prettier@2.8.8 --write --no-config dist/main.js
  • open dist/main.js
  • Check setIgnoreDoubleClickEvents absent with darwin, present with other values

Desktop

  • OS:
  • OS Version:
  • FreeTube version:

Additional context

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) August 16, 2025 21:33
@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 16, 2025
@absidue

absidue commented Aug 16, 2025

Copy link
Copy Markdown
Member

Move tray related code in main process to be behind process.platform !== 'darwin' so they should be removed on build time (not idea how to test

The webpack config for the main file sets the value of process.platform to process.platform, so of your current machine/build machine, but you can also hardcode it to 'darwin', 'win32' or 'linux' to see what the build output looks like for other OS'. To make the build output more readable I use prettier 2 (3 and later don't seem to reformat files for some reason) as it's aggressive reformatting works quite well on mimified files e.g. npx prettier@2.8.8 --write --no-config dist/main.js.
As for navigating around the file faster, picking some things that won't change between input and output such as strings or methods provided by the runtime (electron, node, browser) e.g. isMinimized and searching for them in the output works quite well.

Those are just the steps I take when I want to look at the output, but if you find some better ways to do it, I am all ears :).

@PikachuEXE

Copy link
Copy Markdown
Member Author

Updated testing section and locally tested (from previous macOS only testing

@FreeTubeBot FreeTubeBot merged commit a5c4c0c into FreeTubeApp:development Aug 24, 2025
5 checks passed
@github-actions github-actions Bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 24, 2025
PikachuEXE added a commit to NishPatel101/FreeTube that referenced this pull request Aug 25, 2025
* development: (84 commits)
  Translated using Weblate (Chinese (Traditional Han script))
  Show more information on long playlists. (FreeTubeApp#7804)
  Translated using Weblate (French)
  Refactor/cleanup tray related code after PR merged (FreeTubeApp#7856)
  Translated using Weblate (Estonian)
  Translated using Weblate (Italian)
  Translated using Weblate (Afrikaans)
  Translated using Weblate (Latvian)
  Translated using Weblate (Lithuanian)
  Translated using Weblate (Norwegian Nynorsk)
  Translated using Weblate (Galician)
  Translated using Weblate (Korean)
  Translated using Weblate (Slovenian)
  Translated using Weblate (Danish)
  Translated using Weblate (Kurdish)
  Translated using Weblate (Catalan)
  Translated using Weblate (Indonesian)
  Translated using Weblate (Greek)
  Translated using Weblate (Slovak)
  Translated using Weblate (Spanish (Mexico))
  ...
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Aug 25, 2025
* development: (25 commits)
  Translated using Weblate (Chinese (Traditional Han script))
  Show more information on long playlists. (FreeTubeApp#7804)
  Translated using Weblate (French)
  Refactor/cleanup tray related code after PR merged (FreeTubeApp#7856)
  Translated using Weblate (Estonian)
  Translated using Weblate (Italian)
  Translated using Weblate (Afrikaans)
  Translated using Weblate (Latvian)
  Translated using Weblate (Lithuanian)
  Translated using Weblate (Norwegian Nynorsk)
  Translated using Weblate (Galician)
  Translated using Weblate (Korean)
  Translated using Weblate (Slovenian)
  Translated using Weblate (Danish)
  Translated using Weblate (Kurdish)
  Translated using Weblate (Catalan)
  Translated using Weblate (Indonesian)
  Translated using Weblate (Greek)
  Translated using Weblate (Slovak)
  Translated using Weblate (Spanish (Mexico))
  ...
caetano-dev pushed a commit to caetano-dev/FreeTube that referenced this pull request Sep 17, 2025
* $ Refactor/cleanup tray related code after PR merged

* $ Guard tray related code behind process.platform check
@PikachuEXE PikachuEXE deleted the tray-cleanup-1 branch November 10, 2025 05:14
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.

5 participants