Closed mmmckay closed 6 years ago
The setTimeout thing is hacky, but otherwise it always seemed to push back to the first tab after character add. I think this is because the commit doesn't propagate before the selectedTab is updated and vuetify has a builtin tab loop back to 0 on increment
improving*
Thanks for making the PR, Matt!
What is the motivation for disabling closing tabs you're not currently on? Daren had a similar idea in a different context but it adds clicks if I want to delete a tab. This could be a more frequent occurrence with swarms of enemies when we implement that.
i.e. Faceless swarm enemy 15/21 dying during Player 4's turn means I have to leave their character tab in order to remove the Kobold/Goblin/Zergling from play which I would find annoying.
The getters clean up the code nicely, definitely need to implement those elsewhere. Is there a reason to call the characters getter allCharacters, though? It seems a little confusing. Unless the standard is to ensure you have separate naming from the store naming I'd want to change that.
I haven't been having an issues with tabs after Daren's first PR, have you tried removing and re-pulling the repo recently? With the vue-cli 3 update I had to wholesale remove the installed packages and re-npm i
but the tabs, as regrettable a choice as it may be, were working.
Initially, I started playing around with the code in TrackerList because the new character button would not move to the new character tab after character creation, and clicking any 'x' would always as if I wanted to delete the player in the selected tab. This is on master (231d7e8332318eb2f185e769c37e15c86166beb5), after the most recent pull, and Chrome 70.
It seems like vuetify will cycle back to tab index 0 if an index is specified that is greater than the number of tabs. The setTimeout is an admittedly hacky way around that update cycle in the event loop.
I'll have a look through the whole code and come up with a better and more reasonable overall naming scheme for getters and port that to another branch, but I am curious about the behavior of the tabs, whether or not this approach is an avenue to go down.
Honestly, if tabs continue to prove to be an issue I'm just going to switch to a dropdown and embed the close button into that. After the previous merge I thought this wasn't going to be an issue anymore but if it continues to be problematic and there's another aesthetically pleasing solution that can be come up with then I may just abandon ship. Daren made a slack channel so we don't have to discuss all this stuff over comments on github as well: https://join.slack.com/t/dminimal/shared_invite/enQtNDYwMzExNzY0MTAwLTFlMjNmMjU2ZTk4NjE4YTg4ZDMwOGI1OGU4OTMyMTQyYTk2YzgyZWM4NGVhNTAwMTc1NjkxMTg1NDdmZjQ2ZjE