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

Minimum Width Warning #53

Merged
merged 32 commits into from
Oct 20, 2016
Merged

Minimum Width Warning #53

merged 32 commits into from
Oct 20, 2016

Conversation

voltaaage
Copy link
Contributor

@voltaaage voltaaage commented Oct 6, 2016

Builds the feature for #30

Goals:

  • Change the existing language of 'length' to represent width. (The board's width changes with each additional strip)
  • Display a warning for the user when the width of the board goes beyond a pre-defined width.
  • Refactor to make sure it is coded in a non redundant style while abiding by the React philosophy of componentizing and reacting to state/prop changes

Considerations

  • We are not considering dynamic widths at this time. A min width of 13 is requested at this time until we have more input from the client.
  • The UI of adding/removing/updating strips needs to be updated to allow for easier refinement of the overall board width. Since this is a much larger project that needs to be more throroughly thought out, we are opting for a simple warning to display to the user that they have achieved the maximum width. However, we are not blocking them from adding more strips at this time.

@brian-slate
Copy link
Contributor

@voltaaage is this ready to review?

@voltaaage
Copy link
Contributor Author

If you have some advice, I'm open to any feedback you have. I'm planning to
go through it and refactor things once I'm back from my weekend trip
On Sat, Oct 8, 2016 at 6:17 PM Brian Herold notifications@github.com
wrote:

@voltaaage https://github.com/voltaaage is this ready to review?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#53 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AGyCRVNAyo6vr9ZzGwIwBnThtTyICuvGks5qyECegaJpZM4KPmAC
.

@voltaaage
Copy link
Contributor Author

Ready for review 🎾

@trezy @bmherold




let maxWidth = 13
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't look like this is used anywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's used in the comparison on ln 125

Copy link
Contributor

Choose a reason for hiding this comment

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

In Wizard.jsx, yeah. It's not used anywhere in Board.js.

<div className="warning">
<span>
{this.state.peakedWidth ?
"Warning: the maximum width reached (" + currentWidth+ "\")" :
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it supposed to be max width or min width? I don't think we have a max.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wow, completely missed that. Must've misinterpreted "limit the width" to be max. It'll be an easier flip

Copy link
Contributor

@trezy trezy left a comment

Choose a reason for hiding this comment

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

I'm not sure what's causing it, but the board gets really short when I remove a strip.

Copy link
Contributor

@trezy trezy left a comment

Choose a reason for hiding this comment

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

The total width calculation in the overlay is displaying {calculated} instead of the calculated width.

@voltaaage
Copy link
Contributor Author

Where do you see {calculated}? I'm pulling in the current width in the warning

@voltaaage
Copy link
Contributor Author

Found the {calculated} piece:
in BoardModel.json:

  "length": "{calculated}",
export default class Wizard extends React.Component {
  getDimensions () {
    let board = this.props.board

    return `${board.get('width')}" x ${board.get('length')}"`
  }

This breaks because I removed the update length method. I'll have to throw it back in.

approaching this with the philosophy that width should represent the side that gets larger as you add more strips
we were previously updating the width with the length update binding
@voltaaage
Copy link
Contributor Author

{calculated} issue fixed!!

@trezy
Copy link
Contributor

trezy commented Oct 12, 2016

  • {calculated} is almost fixed. It still shows calculated when you first load up a board.
  • I can no l longer change the board length. Adjusting the slider causes the dimensions in the overlay to be updated, but it doesn't update the board length anymore.
  • The remove strip links aren't disabled until the board reaches ~9". I thought it was set at 13"?

@voltaaage
Copy link
Contributor Author

@trezy I'm not disabling any controls at minimum width - just showing a warning like we discussed

The {calculated} issue is related to the length rendering. It seems to be coupled fairly tightly in the virtual board and I'm wondering if it's worthwhile to switch the logic over to use change how we're using width vs length - or just keep using length as is.

@voltaaage
Copy link
Contributor Author

voltaaage commented Oct 12, 2016

Current Issues:

  • Weird CPU usage spikes while using the app - unsure if this is related to my changes yet. It appears to be remedied when I have a value for length set.
  • Initial state of the board has an undefined length. This seems to come in as "{calculated}" and the only reference to this string that I could find is in the boardDataModel.json files.
  • Attempted to update those files to no success.
  • Also trying to initialize it in the board model - doesn't like it.
  • Set it in the constructor for Builder (definitely not the best place) which worked... but now it doesn't
  • Found the disabled toggle - I can hook in the minimum width logic if that is what we want. Right now, it just looks at minimum number of strips. I was under the understanding that we just want to show the warning at the bottom of the Wizard.

@voltaaage
Copy link
Contributor Author

Currently blocked by the #2 and #3 of the issues in the comment above. I think this PR relies on updating the API (flipping length and width in the response) & a clarification of the requirements in #3.

@brian-slate
Copy link
Contributor

I added a temporary swap of length/width in the backbone model. This looks good. Once @trezy verifies as well we should merge this in and then make new tickets for anything outstanding.

@brian-slate brian-slate merged commit 8e51dea into master Oct 20, 2016
@trezy trezy deleted the 30/minimum-width branch June 14, 2017 01:21
brian-slate added a commit that referenced this pull request Jun 15, 2017
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.

3 participants