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

Preset and add creation #1015

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Preset and add creation #1015

wants to merge 1 commit into from

Conversation

SteveMicroNova
Copy link
Contributor

@SteveMicroNova SteveMicroNova commented Jan 9, 2025

What does this change intend to accomplish?

Closes #707

Moved stream and preset creation workflows to the components folder, then spread them to relevant places (preset creation on presets settings page and presets modal on home page, stream creation in all places streams can be selected)

Checklist

  • Have you tested your changes and ensured they work?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • If applicable, have you updated the documentation/manual?
  • If applicable, have you updated the CHANGELOG?
  • Does your submission pass linting & tests? You can test on localhost using ./scripts/test
  • If this is a UI change, have you tested it across multiple browser platforms on both desktop and mobile?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TypeSelectModal and StreamModal are always used as a pair, so I packaged them as a pair for ease of use

Copy link
Contributor Author

@SteveMicroNova SteveMicroNova Jan 9, 2025

Choose a reason for hiding this comment

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

I liked the style of the add stream button on the home page and wanted to use it elsewhere, so I've packaged it into this component

Comment on lines 27 to 29
<>
<Modal className="streams-modal" onClose={onClose}>
<Modal onClose={onClose}>
<Card className="type-select-card">
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 class wasn't declared in any CSS so I removed it

@SteveMicroNova
Copy link
Contributor Author

Recording.2025-01-16.135310.mp4
Recording.2025-01-16.135434.mp4

@linknum23
Copy link
Contributor

I think the flow for the stream creation makes a lot of sense. Unsure about the presets. After a preset is created there really isn't any point in running it since it will partially update the amplipi to the same state that it is already in.

@@ -118,6 +121,8 @@ const PresetsModal = ({ onClose }) => {
<div className="presets-modal-header">Select Preset</div>
<div className="presets-modal-body">
<List>{presetItems}</List>
<RectangularAddButton onClick={() => {setCreateModalOpen(true); onClose();}} />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed @linknum23's concerns by adding the onClose function to preset creation via the preset select modal, now the selection modal will close as soon as the creation modal opens, and so you do not have to close multiple modals to either abort or approve this line of action

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.81%. Comparing base (7499989) to head (259e28e).
Report is 63 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1015      +/-   ##
==========================================
- Coverage   50.67%   49.81%   -0.86%     
==========================================
  Files          40       41       +1     
  Lines        7154     7303     +149     
==========================================
+ Hits         3625     3638      +13     
- Misses       3529     3665     +136     
Flag Coverage Δ
unittests 49.81% <ø> (-0.86%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…ls into the components folder and reuse them on the home page
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.

Add "Add Stream" and "Add Preset" buttons, modals to relevant modals on Home screen
3 participants