Skip to content

Conversation

@benjiwheeler
Copy link
Contributor

#5168 was originally intended to resolve #3433 and scratchfoundation/scratch-desktop#71 , but then it was narrowed in scope to a general refactor of project title handling.

This change should resolve #3433 and scratchfoundation/scratch-desktop#71 .

Proposed Changes

When project state transitions into isShowingWithoutId being true, set the project title to the default title, and call GUI's owner's onUpdateProjectTitle function.

Reason for Changes

In standalone and desktop modes, File->New was not resetting title.

Test Coverage

We don't have good testing for this functionality yet. What would it look like?

@rschamp rschamp assigned paulkaplan and unassigned rschamp Nov 20, 2019
@benjiwheeler benjiwheeler requested review from paulkaplan and removed request for rschamp November 26, 2019 13:33
@paulkaplan
Copy link
Contributor

Code LG but it is tough to think about all the implications. could you test with selenium integration test? Like load app, change project title, file -> new, check project title?

Could you put together a list of actions we should make sure to test that might intersect with this, like importing a file when showing with ID and when showi without Id?

@benjiwheeler
Copy link
Contributor Author

benjiwheeler commented Jan 2, 2020

Things we'd test, ideally:

  • in standalone mode:

    • showing default project
      • change title, then do file->new; title should reset
      • change title, then do file->load; title should be from file
        • then do file->new; title should reset
  • embedded in www:

    • logged in
      • showing default project
        • change title, then do file->new; title should be some version of "Untitled-NUMBER"
        • change title, then do file->load; title should be from file
          • then do file->new; title should reset

Unfortunately, I don't know how we can test the file-> load functionality automatically, but we can test the file->new stuff!

I added a test to do what you described:

load app, change project title, file -> new, check project title?

...and confirmed that the current (before this PR) code fails it, and this PR's code passes.

Copy link
Contributor

@paulkaplan paulkaplan left a comment

Choose a reason for hiding this comment

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

LGTM thanks for adding that test

@paulkaplan paulkaplan assigned benjiwheeler and unassigned paulkaplan Jan 6, 2020
@benjiwheeler benjiwheeler merged commit 9639265 into scratchfoundation:develop Jan 6, 2020
@benjiwheeler benjiwheeler deleted the standalone-new-project-title-fix branch January 6, 2020 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

in standalone, project title persists after upload; isn't set to default when File->New

3 participants