Java Lab: fix support file bug - #48122
Merged
Merged
Conversation
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:The contents of
TestClass.javawould be whatever the contents of the last file in the editor was. If you reloaded the page, everything would look correct again (only one, emptyTestClass.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 thelastTabIndexto 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:

Links
Testing story
tested locally