Skip to content

Music: add Panels level#55758

Merged
breville merged 25 commits into
stagingfrom
music-intro-script-callouts-panels
Jan 20, 2024
Merged

Music: add Panels level#55758
breville merged 25 commits into
stagingfrom
music-intro-script-callouts-panels

Conversation

@breville

@breville breville commented Jan 16, 2024

Copy link
Copy Markdown
Member

This adds a new Panels level type. This type of level can provide a series of "panels" of information.

In this initial implementation, each panel contains one large image and one piece of markdown text. The user presses "Next" to go through the panels, "Continue" to go to the next level from the final panel, and can also use some bubbles at the bottom to navigate between the panels.

If useful, this level type can be made more flexible, to support a wider variety of content types and layouts. It's currently supported for Lab2 progressions, though could be supported in legacy progressions as well.

Authoring is currently done via JSON, and is quite simple, for example:

    "level_data": {
      "panels": [
        {
          "imageUrl": "https://images.code.org/image0.png",
          "text": "Nice work!  You just learned how to **Play a sound**."
        },
        {
          "imageUrl": "https://images.code.org/image1.png",
          "text": "Did you know there are *more* features available?"
        }
      ]
    }

It's used in one level so far: https://studio.code.org/s/music-intro-2024/lessons/1/levels/8.

music-panels-1.mov

Background

I was pondering a new kind of instructional level for Music Lab that might address some of our discussed needs:

  • We would like to give rich explanations to students, while keeping level-specific instructions crisp and actionable.
  • We know we have one or two points in our onboarding where we'd like to give students some additional context, and have currently earmarked them as video levels.
  • We're increasingly concerned that students aren't watching videos. This has been discussed a lot during and post Dance Party: AI Edition.
  • I pitched this same type of level for Dance Party: AI Edition and curriculum seemed quite interested.

Long ago

Funnily enough, the last time I built something very similar to this was all the way back in 2007, when there was a last minute scramble and I pitched, prototyped and started building the Inside Xbox live news feed feature for the Xbox 360. Inside Xbox provided a bunch of panels that the user could move between, with a variety of content types supported over time, including images, text, and video. It was easy for the content team to author new content daily.

Here's a screenshot with the entry button, that I found:

xbox 360 dashboard

@breville breville marked this pull request as draft January 16, 2024 09:33
@breville breville changed the title Music: add panels level (prototype) Music: add Panels level Jan 17, 2024
@breville breville mentioned this pull request Jan 18, 2024
@breville breville marked this pull request as ready for review January 18, 2024 10:53
@breville breville requested a review from a team as a code owner January 18, 2024 10:53
@breville breville requested review from a team, moneppo and samantha-code January 18, 2024 11:00
Comment thread apps/src/panels/PanelsView.tsx Outdated

@thomasoniii thomasoniii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

one minor request about destructuring a variable, but otherwise lgtm 🚀

@sanchitmalhotra126 sanchitmalhotra126 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cool stuff! Just some minor comments

Comment thread apps/src/panels/PanelsView.tsx Outdated
Comment thread apps/i18n/panels/en_us.json Outdated
Comment thread apps/src/lab2/types.ts Outdated
import EnhancedSafeMarkdown from '@cdo/apps/templates/EnhancedSafeMarkdown';
import FontAwesome from '@cdo/apps/templates/FontAwesome';

function useWindowSize() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems like a good candidate for a reusable util? (separate change probably?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes. I also think there's a bigger opportunity to factor out the responsive sizing from this file and standaloneVideo/Video.tsx but would like to do in a follow-up.

Comment thread apps/src/panels/PanelsView.tsx Outdated
Comment thread apps/src/panels/PanelsView.tsx Outdated
Comment thread apps/src/panels/PanelsView.tsx Outdated
Comment thread apps/src/panels/locale.ts Outdated
Comment thread apps/src/panels/panels.module.scss Outdated

@molly-moen molly-moen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice!

@sanchitmalhotra126 sanchitmalhotra126 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A few more minor things but looks good!

Comment thread apps/src/panels/PanelsView.tsx
: commonI18n.continue()}
</button>
<div id="panels-bubbles">
{Array.from(Array(levelPanels.panels.length).keys()).map(index => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've seen this kind of index generator in a couple of places (Array.from(Array(length).keys()) - worth pulling out into a util later?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh, we have getRangeArray.ts now. Maybe we could move it to apps/src/util/?

Comment thread apps/src/panels/PanelsView.tsx Outdated
Base automatically changed from music-intro-script-callouts to staging January 20, 2024 00:16
@breville breville merged commit b1ad915 into staging Jan 20, 2024
@breville breville deleted the music-intro-script-callouts-panels branch January 20, 2024 12:10
dju90 pushed a commit that referenced this pull request Feb 5, 2024
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