Skip to content

Conversation

@joshpetit
Copy link

Added the ability to search selected text on the subreddit currently viewing and all of Reddit. I also fixed a few bugs I experienced where the loading screen would pop up when clicking on intrasite links. Finally, I added yarn as a dependency since that was missing from the package.json and a small setup in the readme.

joshpetit and others added 3 commits June 10, 2020 20:43
…ugs with the loading window, added yarn as a dependency
It's stated that there isn't Linux support, but this is electron so it does, beautiful how easy it is right! You can fix this if you'd like unless you meant something else by not having Linux support listed.
@savigny030 savigny030 self-requested a review June 11, 2020 11:49
@savigny030 savigny030 self-assigned this Jun 11, 2020
@savigny030 savigny030 added the enhancement New feature or request label Jun 11, 2020
@savigny030
Copy link
Collaborator

Hi,
thanks for ur commit! I try to review the code today but realistically I will do it on Sunday or Monday because I got a lot of stuff to do the next days. But I looked a lil into it and it is looking good. The next very necessary feature is the ability to update the app. I need to look into electron-forge, I think there is something prebuilt...
Have a great day!
Btw. My name is also Joshua 😂
-Josh

Copy link
Collaborator

@savigny030 savigny030 left a comment

Choose a reason for hiding this comment

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

nvm that review lol

Copy link
Collaborator

@savigny030 savigny030 left a comment

Choose a reason for hiding this comment

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

very nice features added. Thank u for ur effort! There are some little things that need to be changed.
greetings! :)

let mainWindow;
let loadWindow;
//Created a variable to tell if the load page has already been displayed since interfered with the search functions,
let loaded = false;
Copy link
Collaborator

@savigny030 savigny030 Jun 15, 2020

Choose a reason for hiding this comment

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

ok so here we have a problem. This variable is a great idea from keeping the loading screen hidden, but there are two problems. first isnt that big. i thought it would be cool to show the loading screen when returning back from a maximised image hosted on reddit (i dunno if u kno but u can click on a image of e.g. a post and it will be shown in little viewer. if u click the cross in the top right there are sometimes a couple seconds delay untill the reddit thread page is shown again. but what do u think is it better without the loader? does it look annoying? the other thing is crutial. Mac apps dont close when pressing the window close cross. if u reopen the app then before the app was just restarted. but somehow now it only shows the loading screen. i dont know the exact reason but i can look into it further if u dont want to...

Copy link
Collaborator

Choose a reason for hiding this comment

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

to skip this problem u can use

// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') {
    app.quit()
  }
})

app.on('activate', () => {
  // On macOS it's common to re-create a window in the app when the
  // dock icon is clicked and there are no other windows open.
  if (BrowserWindow.getAllWindows().length === 0) {
    loaded = false;
    createMainWindow();
    createLoadWindow();
  }
})

i still have to check it but i think this will do the trick...

Copy link
Author

Choose a reason for hiding this comment

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

ok so here we have a problem. This variable is a great idea from keeping the loading screen hidden, but there are two problems. first isnt that big. i thought it would be cool to show the loading screen when returning back from a maximised image hosted on reddit (i dunno if u kno but u can click on a image of e.g. a post and it will be shown in little viewer. if u click the cross in the top right there are sometimes a couple seconds delay untill the reddit thread page is shown again. but what do u think is it better without the loader? does it look annoying? the other thing is crutial. Mac apps dont close when pressing the window close cross. if u reopen the app then before the app was just restarted. but somehow now it only shows the loading screen. i dont know the exact reason but i can look into it further if u dont want to...

Ok I see, I originally added the loaded variable because the load screen had some conflicts with the search Reddit function. I actually do like the loading screen, the only slightly annoying thing about it is that it opens an entirely new window so if there is a way to show the load screen on the main window then that'd make it perfect.

Copy link
Author

Choose a reason for hiding this comment

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

to skip this problem u can use

// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') {
    app.quit()
  }
})

app.on('activate', () => {
  // On macOS it's common to re-create a window in the app when the
  // dock icon is clicked and there are no other windows open.
  if (BrowserWindow.getAllWindows().length === 0) {
    loaded = false;
    createMainWindow();
    createLoadWindow();
  }
})

i still have to check it but i think this will do the trick...

I do not own a Mac so it would be impossible for me to test haha, so if you have one you can look and see if this might be a fix.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok so here we have a problem. This variable is a great idea from keeping the loading screen hidden, but there are two problems. first isnt that big. i thought it would be cool to show the loading screen when returning back from a maximised image hosted on reddit (i dunno if u kno but u can click on a image of e.g. a post and it will be shown in little viewer. if u click the cross in the top right there are sometimes a couple seconds delay untill the reddit thread page is shown again. but what do u think is it better without the loader? does it look annoying? the other thing is crutial. Mac apps dont close when pressing the window close cross. if u reopen the app then before the app was just restarted. but somehow now it only shows the loading screen. i dont know the exact reason but i can look into it further if u dont want to...

Ok I see, I originally added the loaded variable because the load screen had some conflicts with the search Reddit function. I actually do like the loading screen, the only slightly annoying thing about it is that it opens an entirely new window so if there is a way to show the load screen on the main window then that'd make it perfect.

Do you have slow internet or a slow machine? I though about it, too, but it wasnt notable on my main rig (ok obviously lol) and my old 2011 mac air... so I though it would be fine to open another window with the exact same dimensions...

Copy link
Author

@joshpetit joshpetit Jun 16, 2020

Choose a reason for hiding this comment

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

Do you have slow internet or a slow machine? I though about it, too, but it wasnt notable on my main rig (ok obviously lol) and my old 2011 mac air... so I though it would be fine to open another window with the exact same dimensions...

It's probably because I am running Ubuntu that it creates such a difference, it probably isn't like this for Window and Mac machines

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes could be, I'm running fedora for work on my work laptop and on my main rig... I can check on that, too. If u wonder why i didnt release for linux in the first place, there is a huge bug (maybe was... it was in Feb. ) which didnt let me choose an Icon and i always had to rename the app in the package.json to meet som req. to build for linux. It was so horrible that I couldnt release. I will check for the new release if those bugs got addressed 😄

src/index.js Outdated
shell.openExternal(urlToGo).catch(err => {
if (err) console.log(err)
})
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

yea still doesnt work somehow. if u click on a link in a post, like mine in my reddit post in e.g. r/electron the app opens the link in its own window, i dont know why yet...

Copy link
Collaborator

Choose a reason for hiding this comment

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

i think i commented the wrong line lol... I hope you know what i mean...

@savigny030
Copy link
Collaborator

savigny030 commented Jun 15, 2020

btw. when the changes are done, i will be implementing the auto update feature
( https://www.electronforge.io/advanced/auto-update i think the first method is by far the easiest) and the last thing will be the fix of those weird link bugs in posts. if all thats done, this will be the new release :D 🎉🚀

@savigny030
Copy link
Collaborator

ok so to give you an update, i think i fixed the tab handling completely, also the mac fix did work and i changed your search feature to work with the loading screen.
BUT u are absolutely right!!! The window thing is really annoying regarding the loading screen. I will definately address that problem b4 the new release. The auto update feature is still missing but i think that wont be a problem...

@joshpetit
Copy link
Author

joshpetit commented Jun 17, 2020

ok so to give you an update, i think i fixed the tab handling completely, also the mac fix did work and i changed your search feature to work with the loading screen.
BUT u are absolutely right!!! The window thing is really annoying regarding the loading screen. I will definately address that problem b4 the new release. The auto update feature is still missing but i think that wont be a problem...

Ok awesome! UI on different operating systems can vary so it's great that you were able to test it. I am sure there is a way to make a loading screen on the same webpage using the 'preload' field in the 'webpreference' option when creating the main window. I think it should be fairly easy to implement; I could look into it today or later this week.

@savigny030
Copy link
Collaborator

ok so to give you an update, i think i fixed the tab handling completely, also the mac fix did work and i changed your search feature to work with the loading screen.
BUT u are absolutely right!!! The window thing is really annoying regarding the loading screen. I will definately address that problem b4 the new release. The auto update feature is still missing but i think that wont be a problem...

Ok awesome! UI on different operating systems can vary so it's great that you were able to test it. I am sure there is a way to make a loading screen on the same webpage using the 'preload' field in the 'webpreference' option when creating the main window. I think it should be fairly easy to implement; I could look into it today or later this week.

Hi, fantastic, that would be awesome! I recently created a Issue regarding that and wrote down some Ideas, but yours sound great! #3
Greetings!

@savigny030
Copy link
Collaborator

ok so to give you an update, i think i fixed the tab handling completely, also the mac fix did work and i changed your search feature to work with the loading screen.
BUT u are absolutely right!!! The window thing is really annoying regarding the loading screen. I will definately address that problem b4 the new release. The auto update feature is still missing but i think that wont be a problem...

Ok awesome! UI on different operating systems can vary so it's great that you were able to test it. I am sure there is a way to make a loading screen on the same webpage using the 'preload' field in the 'webpreference' option when creating the main window. I think it should be fairly easy to implement; I could look into it today or later this week.

Hi Josh, did u made any progress? I'm sorry im writing all my exams at the time and I'm a bit slower in continuing the development. I don't want to overwrite your work if u have started on working on the loading spinner, but if u haven't i can look into it next week or sth...
greetings!

@joshpetit
Copy link
Author

joshpetit commented Jul 5, 2020

Hi Josh, did u made any progress? I'm sorry im writing all my exams at the time and I'm a bit slower in continuing the development. I don't want to overwrite your work if u have started on working on the loading spinner, but if u haven't i can look into it next week or sth...

Oh man past two weeks have been really busy! Had zoom meetings every day prepping for this semester, sorry for the wait. I should be fairly free this week so I'll look into the on-page loading tomorrow!

@joshpetit
Copy link
Author

Yea, it seems like the workaround in commit ba9e86f created a bug in how images are displayed. I would recommend rolling back to the original fork and then make next release without the loading screen. In the meantime, we could work on better implementing the load screen! (Just to verify it's the best possible way). If not that's alright though.

@savigny030
Copy link
Collaborator

Yea, it seems like the workaround in commit ba9e86f created a bug in how images are displayed. I would recommend rolling back to the original fork and then make next release without the loading screen. In the meantime, we could work on better implementing the load screen! (Just to verify it's the best possible way). If not that's alright though.

thanks for the feedback :) - coming to the bug, did u pulled the newest version of this branch? cause for me everything is displayed perfectly 😅 even using it via npm start... Or do you mean smth else then the maximised image window?

@joshpetit
Copy link
Author

thanks for the feedback :) - coming to the bug, did u pulled the newest version of this branch? cause for me everything is displayed perfectly sweat_smile even using it via npm start... Or do you mean smth else then the maximised image window?

Yea I pulled the newest, either way though I think having the onpage loading may fix the problem anyway, I've begun implementing it so hopefully it will.

@joshpetit
Copy link
Author

joshpetit commented Jul 9, 2020

Alright so I found a better alternative to using the load screen, it's in this package and I think it would be very useful. I'm having trouble implementing it though, I've done it as a standalone but haven't been able to modify the codebase. Sorry I couldn't have been of more help! Here is an example to try and understand how it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants