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

Error should be raised when we try to set slider of output variable [#19] #35

Closed

Conversation

japamat0
Copy link
Contributor

@japamat0 japamat0 commented Jun 18, 2019

[issue #19]
the problem:

When the user inputs an expression index that doesn't correspond to a slider, the expression can be overridden by the slider, screenshots & gif below for y=mx + b:

Screen Shot 2019-06-18 at 3 30 10 PM

capture burst, slider index set to 1, produces the following:

y_mx_b

My aim was to only allow the user to select from sliders that wont override expressions by filtering the expressions list from calculator.getExpressions() for only expressions whose latex follows the pattern of 1 variable being assigned a numerical value. I implemented a dropdown menu, with default values that throw errors when the users tries to capture an image burst. If there are no sliders, the defaul option is simply No Sliders.

Screen Shot 2019-06-18 at 3 36 18 PM

To do this, I needed to add burstSlider to the redux store in ui, which gets updated every time the burst panel is opened.

@ctlusto
@alissarenz
@mmmaaatttttt
Chris, please wait for Alissa to approve before review!

margin-top: 5px;
border: 1px solid #000;
font-size: 1em;
outline: none !important;
Copy link
Contributor

@misscoded misscoded Jun 21, 2019

Choose a reason for hiding this comment

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

What was the reason behind this (outline)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this should eliminate the blue outline that appears on focus to follow the same styling as other gifsmos inputs, e.g. .Burst-input and .Burst-button screenshots related:
Screen Shot 2019-06-21 at 11 42 43 AM
Screen Shot 2019-06-21 at 11 42 58 AM

dispatch(updateBurstSliders(sliders));
};

const updateBurstSliders = sliders => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

In the rest of this file, the actions appear to be at the top. Is there a particular reason you've placed this one apart from the rest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch! moved from thunk section to action section

@mmmaaatttttt
Copy link
Contributor

@japamat -- am i using this wrong or are there bugs in this PR? I tried pasting in the following:

https://www.desmos.com/calculator/gzmoe8w5hx

there are 3 sliders in this graph.

But when I try to select one of them from the dropdown, i either get a warning message about not defining a slider (for the second two), or a straight up error (for the first one). can you reproduce?

Copy link
Contributor

@mmmaaatttttt mmmaaatttttt left a comment

Choose a reason for hiding this comment

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

@japamat - nothing in here looks problematic, but i think there are some 🐛 in here. happy to chat more when you're free.

/>
>
<option value={null} defaultValue>
{burstSliders.length ? 'Choose Slider' : 'No Sliders'}
Copy link
Contributor

Choose a reason for hiding this comment

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

can you change the 'Choose Slider' text to something shorter? the text is getting cut off:

Screen Shot 2019-06-25 at 11 38 27 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to Pick Slider, now it fits

{burstSliders.map(exp => {
return (
<option key={`slider-${exp.id}`} value={exp.id}>
{' '}
Copy link
Contributor

Choose a reason for hiding this comment

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

do you need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

@japamat0
Copy link
Contributor Author

@mmmaaatttttt
I fixed the bugs you caught, let me know if you are still getting those

@japamat0 japamat0 closed this Aug 7, 2019
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.

4 participants