Skip to content

Conversation

sbencoding
Copy link

@sbencoding sbencoding commented Jul 7, 2019

Description

This PR adds the ability to open and edit notes in separate, new windows.
The new windows only implement the Detail component, so there's only one main window.
The full screen button has been removed from the new windows, because I don't think it has purpose in that context. The editor already covers the entire window.
I also had to add a new string to i18n: Open in new window. English and Hungarian versions are correct, but for the rest of the languages I simply added the english text.
Some images of the new feature:
image
image

Issue fixed

#1572 [Feature Request] Multiple notes open in their own dedicated windows.

Type of changes

  • ⚪ Bug fix (Change that fixed an issue)
  • ⚪ Breaking change (Change that can cause existing functionality to change)
  • ⚪ Improvement (Change that improves the code. Maybe performance or development improvement)
  • 🔘 Feature (Change that adds new functionality)
  • ⚪ Documentation change (Change that modifies documentation. Maybe typo fixes)

Checklist:

  • 🔘 My code follows the project code style
  • ⚪ I have written test for my code and it has been tested
  • 🔘 All existing tests have been passed
  • 🔘 I have attached a screenshot/video to visualize my change if possible

IssueHunt Summary

Referenced issues

This pull request has been submitted to:


IssueHunt has been backed by the following sponsors. Become a sponsor

@ZeroX-DG ZeroX-DG added the awaiting review ❇️ Pull request is awaiting a review. label Jul 10, 2019
@ZeroX-DG ZeroX-DG added needs extra review 🔎 Pull request requires review from an additional reviewer. awaiting review ❇️ Pull request is awaiting a review. and removed awaiting review ❇️ Pull request is awaiting a review. needs extra review 🔎 Pull request requires review from an additional reviewer. labels Jul 20, 2019
@ZeroX-DG
Copy link
Member

ZeroX-DG commented Apr 5, 2020

@sbencoding can you resolve the conflict please? Very sorry for the wait 😢

@sbencoding
Copy link
Author

I've resolved the conflicts, but the travis-ci check seems to be hung.
No problem for the wait, I recognize this is a very big and complex project, so it's not so easy to resolve issues and implement pull requests 👍 .

Copy link
Member

@ZeroX-DG ZeroX-DG left a comment

Choose a reason for hiding this comment

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

Please update your code 👍

},
icon: path.resolve(basepath, '../resources/app.png')
})
const url = path.resolve(basepath, './main.development.html')
Copy link
Member

Choose a reason for hiding this comment

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

We have an HTML file for production too, can you do it like in the main window:
https://github.com/BoostIO/Boostnote/blob/6ee92588b10cb9bbc5f9b43dd367ffd7439ca554/lib/main-window.js#L57-L62

noteDetailWidth: 0,
mainBodyWidth: 0
mainBodyWidth: 0,
globRenderFlag: 1
Copy link
Member

Choose a reason for hiding this comment

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

Instead of globRenderFlag can you come up with another name that express more meaning? Otherwise you can add some comments explaining what it does. But I would prefer to have a better variable name


const { showFullScreen } = this.props.data

if (showFullScreen === undefined || showFullScreen === true) {
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 redundant, because === compare the type too, so you don't have to compare it to underfined.


let renderFullScreenButton = true
const { showFullScreen } = this.props.data
if (showFullScreen !== undefined && showFullScreen === false) {
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 redundant, because === compare the type too, so you don't have to compare it to underfined.

note: note
})
const { showFullScreen } = this.props.data
if (showFullScreen !== undefined && showFullScreen === false) {
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 redundant, because === compare the type too, so you don't have to compare it to underfined.

this.toggleLockButton = this.handleToggleLockButton.bind(this)
const { showFullScreen } = this.props.data

if (showFullScreen === undefined || showFullScreen === true) {
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 redundant, because === compare the type too, so you don't have to compare it to underfined.

note: note
})
const { showFullScreen } = this.props.data
if (showFullScreen !== undefined && showFullScreen === false) {
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 redundant, because === compare the type too, so you don't have to compare it to underfined.


let renderFullScreenButton = true
const { showFullScreen } = this.props.data
if (showFullScreen !== undefined && showFullScreen === false) {
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 redundant, because === compare the type too, so you don't have to compare it to underfined.


if (this.state.globRenderFlag !== 1) {
this.props.location.search = `?key=${this.state.currentNoteKey}`
this.props.data.showFullScreen = false
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 strange, I don't think we can modify the props directly like this because props are read-only
https://reactjs.org/docs/components-and-props.html#props-are-read-only

@sbencoding
Copy link
Author

I've implemented the requested changes 👍

Copy link
Member

@ZeroX-DG ZeroX-DG left a comment

Choose a reason for hiding this comment

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

Please fix your code 👍

},
{
label: openInNewWindow,
click: this.openInNewWindow.bind(this)(note)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't it be like this?

Suggested change
click: this.openInNewWindow.bind(this)(note)
click: this.openInNewWindow.bind(this, note)

const url = path.resolve(
__dirname,
process.env.NODE_ENV === 'development'
? './main.development.html'
Copy link
Member

@ZeroX-DG ZeroX-DG Apr 13, 2020

Choose a reason for hiding this comment

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

This code is not working, I think because it been called in a different place so the __dirname is changed. Can you fix the path for this?

@Flexo013 Flexo013 added awaiting changes 🖊️ Pull request has been reviewed, but contributor needs to make changes. and removed awaiting review ❇️ Pull request is awaiting a review. labels Apr 14, 2020
@sbencoding
Copy link
Author

I've implemented the requested changes, let me know if there's anything else I should fix or change.

Copy link
Member

@ZeroX-DG ZeroX-DG left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@ZeroX-DG ZeroX-DG added approved 👍 Pull request has been approved by sufficient reviewers. and removed awaiting changes 🖊️ Pull request has been reviewed, but contributor needs to make changes. labels Apr 17, 2020
@Rokt33r Rokt33r added this to the v0.16.0 milestone Apr 26, 2020
@Rokt33r Rokt33r modified the milestones: v0.16.0, v0.17.0 Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved 👍 Pull request has been approved by sufficient reviewers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants