Skip to content

Conversation

not-my-profile
Copy link
Contributor

Resolves #27277.

Does this PR introduce a user-facing change?

Updated the REST API documentation page to hide the Read the Docs version selector (which didn't affect the API version) and introduced a new version selector for the API version.

Signed-off-by: Martin Fischer <martin@push-f.com>
Preparation for the next commit in which we'll make the script tag async
(in order to use await to fetch the new versions.json file).

Signed-off-by: Martin Fischer <martin@push-f.com>
@packit-as-a-service
Copy link

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

Copy link
Member

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

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

I tried to build and display the changes, and I got a syntax error. You can find instructions on how to build the documentation locally here.

@not-my-profile
Copy link
Contributor Author

Ah yeah sorry. I did build it locally but getting the specs from storage.googleapis.com fails locally because of CORS, so I had to use a relative URL and when I changed it back I introduced the syntax error. Fixed!

@TomSweeneyRedHat
Copy link
Member

LGTM

@not-my-profile
Copy link
Contributor Author

(Slightly corrected a comment: clearing the redoc-container led to errors rather than the delay.)

@Honny1
Copy link
Member

Honny1 commented Oct 15, 2025

I am not sure if this is a good style for a version selector.
image

How about this, or something similar?
image

    #versionSelect {
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;

      position: fixed;
      bottom: 20px;
      right: 20px;
      z-index: 1000;

      background-color: #272725;
      border: 1px solid #4a4a4a;
      border-radius: 4px;
      color: #E2E2E2;
      cursor: pointer;

      padding: 6px 30px 6px 12px;
      font-family: system-ui, -apple-system, sans-serif;
      font-size: 14px;
      line-height: 1.5;

      background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 5'%3e%3cpath d='M0 0l5 5 5-5z' fill='%23E2E2E2'/%3e%3c/svg%3e");
      background-repeat: no-repeat;
      background-position: right 12px center;
      background-size: 10px 5px;
      
      transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
    }

    #versionSelect::-ms-expand {
      display: none;
    }

    #versionSelect:hover {
      background-color: #383836;
      border-color: #636363;
    }

    #versionSelect:focus-visible {
      outline: 2px solid #0085CA;
      outline-offset: 2px;
    }

@not-my-profile
Copy link
Contributor Author

I agree that the outline I added looks bad, I just removed it. But I don't think styling it to be dark makes sense because I just noticed that for narrow browser widths ReDoc puts a white menu button next to it (and I adjusted the position to be better aligned with that other button):

image

Fixes: containers#27277

Signed-off-by: Martin Fischer <martin@push-f.com>
Copy link
Member

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

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

LGTM

@mheon
Copy link
Member

mheon commented Oct 17, 2025

@ashley-cui Mind doing final review?

Copy link
Member

@ashley-cui ashley-cui left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 17, 2025
@baude
Copy link
Member

baude commented Oct 21, 2025

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 21, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: baude, flouthoc, Honny1, not-my-profile

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 21, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit d906918 into containers:main Oct 21, 2025
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Version selector on REST API reference page is confusing

7 participants