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

Undesirable workaround for Audio preferences #956

Open
samreid opened this issue Mar 6, 2024 · 2 comments
Open

Undesirable workaround for Audio preferences #956

samreid opened this issue Mar 6, 2024 · 2 comments
Assignees

Comments

@samreid
Copy link
Member

samreid commented Mar 6, 2024

As discovered in the code review phetsims/projectile-data-lab#215

@pixelzoom said:

For code review #32 ...

In projectile-data-lab-main.ts, a blank Node is being created for the left column of the Audio preferences tab, to workaround a joist layout problem -- see relevant code below. Rather than creating an undesirable dependency on bad layout behavior, it would be preferrable to fix the layout problem in joist. Or at least open a GitHub issue for the problem, with a TODO here, so that the problem may eventually get fixed, and someone will know to remove this workaround.

    audioOptions: {
      customPreferences: [
        {

          // Due to the layout considerations in the Preferences Dialog, it has 2 columns. Our entry for the left column
          // is blank
          createContent: () => new Node()
        },
        {
        createContent: tandem => new AudioPreferencesContentNode( tandem.createTandem( 'audioPreferences' ) )
      } ]

That code was modeled after an example we saw in Quadrilateral which uses the same workaround:

https://github.com/phetsims/quadrilateral/blob/1f95cbe28d44dbbc7579b7cff9afc5f8a9c96375/js/quadrilateral-main.ts#L40-L57

@jessegreenberg can you please advise?

samreid added a commit to phetsims/quadrilateral that referenced this issue Mar 6, 2024
samreid added a commit to phetsims/projectile-data-lab that referenced this issue Mar 6, 2024
@jessegreenberg
Copy link
Contributor

Thanks for making an issue - we could use better layout support for the PreferencesPanels. Right now, the subclass manages layout for the content of the panel. AudioPreferencesPanel creates two columns for the content and then alternates between then when creating customPreferences.

One better way could be for the superclass to manage layout with an API that lets the client decide where customPreferences are placed. The newer grid-based layout in scenery might be helpful for this, I am not sure.

I am not sure when to work on this, I will add it to a prioritization board to make sure it gets reviewed. However, if you have other thoughts for improving it and would like to work on it as part of projectile-data-lab, please feel free.

@marlitas
Copy link
Contributor

Meeting 3/11/24

  • We want to move this to a preferences board and track preferences work through that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants