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

[Maker][CP] - Use blank array param for buzzer #44877

Merged
merged 3 commits into from
Feb 17, 2022
Merged

Conversation

epeach
Copy link

@epeach epeach commented Feb 16, 2022

Curriculum request to style the block parameters for buzzer.playSong/playNotes. Old notes were displayed in a vertical array to minimize impact of a really long array. This change removes the default values placed in the array. PlayNotes uses an empty array and PlaySong uses an array with spaces - discussion here: https://codedotorg.slack.com/archives/C0T0EGE8L/p1644507117916229

Before / After in Blocks:
Screenshot from 2022-02-16 15-36-48

Before/After in Text:
Screenshot from 2022-02-16 15-40-10

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@epeach epeach requested a review from a team February 16, 2022 21:12
@maddiedierker
Copy link
Contributor

just read through the thread and it looks like some updates might be coming through, so i'll hold off until then. in the meantime, it looks like buzzer.play is now the only block that uses stringifySong:

{
func: 'buzzer.play',
category: CIRCUIT_CATEGORY,
paletteParams: ['notes', 'tempo'],
params: [stringifySong(SONG_CHARGE), 120],
paramButtons: {minArgs: 1, maxArgs: 2}
},

do we want to update/change the default for that block as well?

@epeach
Copy link
Author

epeach commented Feb 16, 2022

@madelynkasula - I had the same thought and made a ticket to track it! https://codedotorg.atlassian.net/jira/software/c/projects/STAR/boards/26?modal=detail&selectedIssue=STAR-2103

I wanted to split it out because I want to get this change out ASAP for curriculum and want to make sure I'm deprecating carefully. We only use buzzer.play internally and it does the same things as PlaySong, so we should just remove Play (and stringifySong).

Copy link
Contributor

@maddiedierker maddiedierker left a comment

Choose a reason for hiding this comment

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

left a nit comment/question, but it's not a merge-blocker

paramButtons: {minArgs: 1, maxArgs: 2}
},
{
func: 'buzzer.playSong',
category: CIRCUIT_CATEGORY,
paletteParams: ['notes', 'tempo'],
params: [stringifySong(SONG_CHARGE), 120],
params: [`[${stringifySong(SONG_CHARGE[0])}]`, 120],
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: SONG_CHARGE[0] is the same as SONG_SINGLE_NOTE -- should we use that instead?

Copy link
Author

Choose a reason for hiding this comment

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

SONG_CHARGE[0] is ['G3', 0.25] and SONG_SINGLE_NOTE is ['G3']. PlayNotes takes a one dimensional value (note) and PlaySong takes two dimensional (note, length).

Copy link
Contributor

Choose a reason for hiding this comment

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

ahh, my bad!

@epeach epeach merged commit 06af540 into staging Feb 17, 2022
@epeach epeach deleted the maker-playnotes-default branch February 17, 2022 19:34
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.

None yet

2 participants