Skip to content

Java Lab: fix support file bug - #48122

Merged
molly-moen merged 1 commit into
stagingfrom
molly/javalab-support-bug
Sep 15, 2022
Merged

Java Lab: fix support file bug#48122
molly-moen merged 1 commit into
stagingfrom
molly/javalab-support-bug

Conversation

@molly-moen

Copy link
Copy Markdown
Contributor

We had a bug where if you added a file (in the screenshot, named TestClass.java) to a level with at least one hidden file you would see the following:
Screen Shot 2022-09-15 at 11 16 54 AM
The contents of TestClass.java would be whatever the contents of the last file in the editor was. If you reloaded the page, everything would look correct again (only one, empty TestClass.java).

The cause of this bug was we used the index in the file list for the tab key for each file, which meant if a hidden file was in the list at index 2 our tab keys would be file-0-tab, file-1-tab, file-3-tab.... However, we set the lastTabIndex to be the length of the list instead of the last index. This PR changes the tab indexes to equal with the index that tab is in the list not including support files.

Now when you add a new file to a level with a support file you see:
Screen Shot 2022-09-15 at 11 17 18 AM

Links

Testing story

tested locally

@molly-moen
molly-moen requested a review from a team September 15, 2022 18:26

@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.

🎉

@molly-moen
molly-moen merged commit 56c28ff into staging Sep 15, 2022
@molly-moen
molly-moen deleted the molly/javalab-support-bug branch September 15, 2022 21:11
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.

2 participants