Skip to content
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

✨ Fix Nav Buttons, Fix Quick access, Update Electron, and more #1142

Open
wants to merge 27 commits into
base: development
Choose a base branch
from

Conversation

guywmustang
Copy link

Added Back and Forward history buttons to the search bar (easiest place that had room) to deal with the Youtube Music UI changes that recently rolled out.

…ependencies.

Update the notification title for windows.

Added windows readme for how to setup and run as it is quite hard to setup.

Major version bump to 1.15.0.
…s "lost".

Add additional logic to handle multiple screens for the miniplayer location.
… Transport Controls (SMTC).

Improved the Windows setup readme file.
@guywmustang guywmustang marked this pull request as ready for review August 2, 2023 05:36
@guywmustang
Copy link
Author

Screenshot 2023-08-01 223401

Added forward and back buttons. This is based on my previous branch which had other changes & upgrades.

@Alipoodle
Copy link
Member

While this PR looks like an absolute Saving Grace of a Final tihng to ship for a v1.15 before we move over to V2....
This PR is really underselling itself and is not exactly just fixing the add back button as the title states...

This changes a lot of stuff, both good and bit more discussion is needed 😵.

From my quick skim:

  • Updating Electron from v11.4 -> v23.1
  • Updating a few other Dependancies
  • Adding a app-path param for Custom CSS and bits
  • A large amount of clean ups
  • Fixing of Quick buttons in Bottom player (Playlist + Library)
  • Enabling "Stop" (although not found other code to go with it) for Win Media Service
  • Defaulting Windows to use System Titlebar rather than Fancy
  • Forcing Modals to use Default Title bar Set ones.

And probably a few other bits which i've missed from my skim review. 😅

@guywmustang
Copy link
Author

You can see that the 'Fancy' title bar is actually feature-deficient compared to the System one (there is no title of application in the fancy one so it made sense to me to use the default one):
Screenshot 2023-08-02 125224
Screenshot 2023-08-02 125156

This branch includes all my previous changes that have been in a couple different Pull Requests. I have merged in a couple other things (where you're seeing the app-path change because I didn't make this change directly). I have also fixed some other things like the quick buttons. I enabled "Stop" for the Windows Media Service so the windows now playing feature works properly when enabled.

Screenshot 2023-08-02 125804

The modals are boxes that don't really matter which title bar we use (at least currently as they look basically the same), so it made sense to use the system default ones.

@Alipoodle Alipoodle changed the title Add-back-button ✨ Fix Nav Buttons, Fix Quick access, Update Electron, and more Aug 3, 2023
@ytmdesktop ytmdesktop deleted a comment from A-Matt Aug 3, 2023
Copy link
Member

@Alipoodle Alipoodle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😵 So this is only really the initial review of things, but probably the 90% of the things from this overall.

This is kinda designed to be a discussion as well as some changes.
This was discussed by people as well regarding some of the changes made, so this is not souly my own opinion on this.

package.json Outdated Show resolved Hide resolved
}
],
"variables": {
"openssl_fips" : "0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confused as to why this is needed, this seels a little suspious
Could you explain this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember, it was to make it build properly.

main.js Outdated Show resolved Hide resolved
main.js Outdated Show resolved Hide resolved
main.js Outdated
icon: iconDefault,
modal: false,
frame: windowConfig.frame,
titleBarStyle: windowConfig.titleBarStyle,
titleBarStyle: 'default',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again forcing default titlebar when style is upto user choice.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we're forcing user choice already to the 'nice' style which is deficient in what it displays - doesn't display the app title. What does it give you over the default system styling (which you can change from)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't display the app title

This is indeed a minor thing to be missing, but given that this was something from the start of the project and how the application has been show.
To my knowledge there was works to get this to likely be themeable in CSS so that it could match your theme / album art. (This was present in the insperation fo this from GPMDP)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So why show the 'Nice' theme as a default if it:
a) Doesn't show the app title at the top (like the system one does)
b) Is not the Electron default title bar which should ideally be more compatible/same across platforms

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not backing down from this.
When you show off a product you show it off generally with all the bells and whistles to make it visually look good.
The user obviously can go through the settings (And generally considered all users will as there's so many other additions which YTM Desktop offers in features)
That's when they can decide if they want to go back to the System title bar or not.
Changes like this are the sort of things which are discussed by the community and not an individual, before being actioned.

Ultimately this is going to be the last opportunity to get a v1 release before we finalise up the final bits we want for v2 and ship that and v1 is no longer supported at all (given how much of a mess code base is, building not working, how out of date most dependencies are). V2 has been a complete re-code for modern Electron with far better security measures put in place for it to work with modern practices.

Ultimately there's some bigger changes coming in with how the title bar is managed in v2 using some of Electron's new features for "overlaying" over existing controls to provide a Customisable Native Taskbar (Good example inside of VS Code)
Example on MacOS we may not even have a top bar at all and the "traffic lights" will be embedded into the YT top bar.

src/providers/companionServer.js Show resolved Hide resolved
src/providers/settingsProvider.js Outdated Show resolved Hide resolved
const { app } = require('electron')

if (isLinux()) settingsProvider.setInitialValue('titlebar-type', 'system')
if (isLinux() || isWindows())
settingsProvider.setInitialValue('titlebar-type', 'system')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a matter of opinion.

src/utils/injectControls.js Outdated Show resolved Hide resolved
node-version: 12
- run: yarn --frozen-lockfile
node-version: 18
- run: yarn
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious to why we are removing the --forzen-lockfile considering this is intended to be 1-1 to what people are using?
This shouldn't be trying to update things at all.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added back. Given this is for the workflow builds, it should still be there; I don't remember why I removed it.

@guywmustang
Copy link
Author

Screenshot 2023-08-03 145441

With the latest changes

@Alipoodle Alipoodle added the YTMD V1 Issue or Feature is already fixed in YTMD V2 / No longer applicible in YTMD V2 Source code label Aug 4, 2023
@Alipoodle
Copy link
Member

So besides the changes regarding the title bar.

And Producing a successful builds (which GitHub Actions is kinda the only hope to make sure that each platform has one...)
I'll do a test and then give a final approval of this and likely do the minor clean-ups before this is released as a final version of YTM Desktop v1

@Alipoodle
Copy link
Member

By the looks of it, the yarn.lock file is out of sync which is why it failed without the --frozen-lockfile

@guywmustang
Copy link
Author

I'll change the title bars back to configured theme. I'm attempting to upgrade the yarn.lock but having issues with it building the Windows native dependencies... it's such a pain.

@guywmustang
Copy link
Author

I'll change the title bars back to configured theme. I'm attempting to upgrade the yarn.lock but having issues with it building the Windows native dependencies... it's such a pain.

I was messing with updating dependencies but running into issues, so I'm leaving yarn file as is for now.

@Alipoodle
Copy link
Member

activity.type = 2 // 'Listening To' - but doesn't seem to work
This is a thing which is not accessible via the standard RPC connection. A lot of libraries like discord.js RPC include it for consistency with the documentation and incase it does go public.

Currently, only bots and allowed integrations are allow to set Listening/Watching or Streaming (And to my knowledge there might even be Competing now)

Doing some v2 work today, but might get some time later to review some of the extra changes.

main.js Outdated
),
{
search:
'page=settings/settings&trusted=1&icon=settings&hide=btn-minimize,btn-maximize&title=' +
__.trans('LABEL_SETTINGS'),
__.trans('LABEL_SETTINGS') +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duiplicate Search items?
&hide=btn-minimize,btn-maximize

Copy link
Member

@Alipoodle Alipoodle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few other minor bits from the original review.
Most are simple fixes/changes.

search:
'page=settings/sub/last-fm/last-fm-login&icon=music_note&hide=btn-minimize,btn-maximize&title=Last.FM Login',
}
'./src/pages/settings/sub/last-fm/last-fm-login.html'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These have had the search params removed for it working using the titlebar stuff,

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Page breaks if trying to add the &hide... arguments. The other called out instances have the same behavior as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used to pass the additional data to the custom frame and not the embeded frame.
storing these lines to how they were before should be the fix (considering it's done for settings)

search:
'page=editor/editor&icon=color_lens&hide=btn-minimize,btn-maximize',
}
path.join(__dirname, './src/pages/editor/editor.html')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More search things for Custom titlebar

main.js Outdated
'page=lyrics/lyrics&icon=music_note&hide=btn-minimize,btn-maximize&title=' +
__.trans('LABEL_LYRICS'),
}
path.join(__dirname, './src/pages/lyrics/lyrics.html')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More search things for Custom titlebar

__.trans('LABEL_SETTINGS_DISCORD') +
'&hide=btn-minimize,btn-maximize',
}
'src/pages/settings/sub/discord/discord_settings.html'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More search things for Custom titlebar

__.trans('SHORTCUT_BUTTONS') +
'&hide=btn-minimize,btn-maximize',
}
'src/pages/settings/sub/shortcut-buttons/shortcut-buttons-settings.html'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More search things for Custom titlebar

'LABEL_CHANGELOG'
)}&page=changelog/changelog&hide=btn-minimize,btn-maximize`,
}
path.join(app.getAppPath(), 'src/pages/changelog/changelog.html')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More search things for Custom titlebar

src/utils/defaultSettings.js Outdated Show resolved Hide resolved
src/utils/defaultSettings.js Outdated Show resolved Hide resolved
yarn.lock Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The yarn lock is still broken with the GitHub Actions. >.<

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you need reproducible dependencies, which is usually the case with the continuous integration systems, you should pass --frozen-lockfile flag.

That's from the Yarn page. So removing that flag will fix it? I find it hard to believe because you'd want these reproducible, but I will put a new commit without that flag.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole point of including the --forzen-lockfile flag is to make sure that the GitHub Actions is running with the intended Packages.
The yarn.lock will check that version, hashes ETC matchup with the package.json, just running yarn to install packages will likely solve this issue.

If you are using npm to install/add packages then this will be the reason for breaking it as the lock files are missaligned as some bits have gone into the node lock and some in the yarn lock.

@guywmustang
Copy link
Author

guywmustang commented Aug 14, 2023 via email

@guywmustang
Copy link
Author

guywmustang commented Aug 14, 2023 via email

@@ -318,11 +322,16 @@ function createContextMenu() {
}
}

function createTopMiddleContent() {
function getTrustedHTML(htmlText) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I ask what the reason for including this function when this is all first party html which is hard coded in?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it was giving an error in the console for not secure content and failing.

@guywmustang
Copy link
Author

guywmustang commented Aug 14, 2023 via email

@guywmustang
Copy link
Author

guywmustang commented Oct 12, 2023

If you want to download my 1.14.2 version to test it out: https://drive.google.com/file/d/1bt594ku2s5h8B4iIVMLD9Tsr7CioJyKA/view?usp=drive_link

EDIT FROM YTMDESKTOP:
While this is a Link to the build, we cannot confirm that this is a safe build of the applicaiton as it is not maintained by the YTM Desktop Team.

…rovider to use my locales and to handle the source not being found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
YTMD V1 Issue or Feature is already fixed in YTMD V2 / No longer applicible in YTMD V2 Source code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants