I just love user feedback

Today I shared DeepTownCalc with Reddit, and I got some great feedback. Some spurred additional research, and some gave some great ideas for future development. Here are some things I’ve been thinking about.

  1. Viewport metadata - I honestly don’t know why this isn’t built into every browser as the default, but apparently I should be adding this to pretty much everything I do from now on:

    1
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    Because in what world are forms that look like this acceptable? It’s funny how for site that claims, “Websites aren’t broken by default, they are functional, high-performing, and accessible,”[sic] the one thing they’ve done that affects the way the page looks is to add that one piece of metadata.

    If it’s not going to be default browser behavior, shouldn’t every HTML tutorial in the world mention it?

  2. Sliders - A user requested the ability to use both coal and charcoal in DTC. I explained the challenge and why I chose to keep them separate, and the user came back with the suggestion of using a slider to indicate the ratio you want to use. The slider itself would come in the styling portion of development (i.e., last), but getting proportional quantities should be doable. That may also be useful for when (if) I make mining times, allowing users to enter a ratio of online to offline time.

  3. We don’t need no stinking batches - Apparently something I’ve done has messed up my batch solutions. Gotta figure that one out.

  4. Buttons are just buttons - I had originally used preventDefault() on my buttons to keep them from reloading the page. I wondered if that was necessary, and I found that it wasn’t. You just had to set it to <button type="button"></button>. If you tell it that a button is just a button, it’s no longer a submit. But that also means that if you’re in a text field and hit enter, it does nothing. I find that annoying. So I think I’m going to have to go back to preventDefault(), at least for the one button.

  5. Stop getting stuff you don’t need - This is something I did when I was figuring out a reasonable algorithm in a spreadsheet. Once you reach a weightedNeed of 0 for a material, it shouldn’t be considering that material anymore when it comes to choosing a mine. If you don’t need any more copper, but you need tons of coal, area 1 { coal: 100 } is better than area 2 { coal: 70, copper: 30 }, but the way it is now, those are both equal.

    I think I can do that at the time when it finds a weightedNeed that’s less than 0. I’ll have to loop through sortingMines and remove it, then recalculate howMuch for each mine. But I think it will make the decisions better. I’ll call it a low priority.

  6. Incorporate existing materials - I have to figure out a way for users to include their existing materials. That will affect the chosen mines a lot. It will have to go into makeInputNeeds, before findMines. I can just have it make an array of the materials and quantities, then subtract it from needsList before it starts picking mines.

    The input will take some thought, but maybe I can have it create hidden inputs during displayResults. Then in the click listener, I can have it reuse the loop that makes itemArray. DRY code!

  7. Styling - Yeah, it’s last, but it’s going to be annoying. I guess I just want to figure out the full functionality here before I invest a lot of time to how it looks. I don’t want to duplicate much more work than necessary.

    But I do know that I want to use it as an opportunity to learn and practice CSS Grid. I don’t want to rely on any third-party framework. I like knowing that I can use them, but I don’t want to have a crutch. We’re trying to do at least some of these things the hard way, people. I mean, how much easier would a lot of this be in jQuery? Probably a lot.