Skip to content

feat: Improvements to indexeddb-examples #303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 27, 2025
Merged

Conversation

bsmth
Copy link
Member

@bsmth bsmth commented Mar 25, 2025

Fixes:

  • var -> const/let
  • Styles are tidied up a little
  • Noise from formatter

Fixes #140

@bsmth bsmth requested a review from a team as a code owner March 25, 2025 11:23
@bsmth bsmth requested review from pepelsbey and removed request for a team March 25, 2025 11:23
@bsmth
Copy link
Member Author

bsmth commented Mar 25, 2025

cc @OnkarRuikar

Copy link
Contributor

@OnkarRuikar OnkarRuikar left a comment

Choose a reason for hiding this comment

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

A few things to consider.

Also, it would be great if we group the five filter inputs and bring the Filter by on the top.

@bsmth
Copy link
Member Author

bsmth commented Mar 26, 2025

Also, it would be great if we group the five filter inputs and bring the Filter by on the top.

Can we do this in a follow-up? It will be easier to review once this cleanup is done

@bsmth bsmth requested a review from OnkarRuikar March 26, 2025 12:16
@OnkarRuikar
Copy link
Contributor

Can we do this in a follow-up? It will be easier to review once this cleanup is done

Simply replace the <form> tag with:

      <form>
        <div>
          <div>
            <input
              type="radio"
              name="filterIndex"
              value="fThing"
              id="thing"
              checked=""
            />
            <label for="thing">Filter by name</label>
          </div>
          <div>
            <input
              type="radio"
              name="filterIndex"
              value="fRating"
              id="rating"
            />
            <label for="rating">Filter by rating</label>
          </div>
        </div>
        <fieldset>
          <div>
            <div>
              <label for="none">Don't filter values at all</label>
              <input
                type="radio"
                name="value"
                value="none"
                id="none"
                checked=""
              />
            </div>
          </div>
          <div>
            <div>
              <label for="only">Return <strong>only</strong> one value</label>
              <input type="radio" name="value" value="only" id="only" />
            </div>
            <div>
              <label for="onlyText">Key value for single value selection</label>
              <input type="text" name="onlyText" id="onlyText" />
            </div>
          </div>
          <div>
            <div>
              <label for="range"
                >Return a <strong>range</strong> of values</label
              >
              <input type="radio" name="value" value="range" id="range" />
            </div>
            <div>
              <label for="rangeLowerText">Lower limit for range</label>
              <input type="text" name="rangeLowerText" id="rangeLowerText" />
            </div>
            <div>
              <label for="rangeUpperText">Upper limit for range</label>
              <input type="text" name="rangeUpperText" id="rangeUpperText" />
            </div>
          </div>
          <div>
            <div>
              <label for="lower"
                >Return values with a <strong>lower</strong> bound</label
              >
              <input type="radio" name="value" value="lower" id="lower" />
            </div>
            <div>
              <label for="lowerBoundText">Lower bound limit for results</label>
              <input type="text" name="lowerBoundText" id="lowerBoundText" />
            </div>
          </div>
          <div>
            <div>
              <label for="upper"
                >Return values with an <strong>upper</strong> bound</label
              >
              <input type="radio" name="value" value="upper" id="upper" />
            </div>
            <div>
              <label for="upperBoundText">Upper bound limit for results</label>
              <input type="text" name="upperBoundText" id="upperBoundText" />
            </div>
          </div>
        </fieldset>

        <button class="run">Run query</button>
      </form>

And apply the following CSS:

@OnkarRuikar
Copy link
Contributor

@bsmth changes look good to me.

@bsmth
Copy link
Member Author

bsmth commented Mar 27, 2025

Thanks Onkar, let's merge for now!

@bsmth bsmth merged commit 077d0af into mdn:main Mar 27, 2025
1 check passed
@bsmth bsmth deleted the indexed-db-css branch March 27, 2025 11:24
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.

indexeddb-examples/idbkeyrange: bad UX
2 participants