Skip to content
New issue

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

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

Already on GitHub? # to your account

Compensate Operation content in lower resolution sizes #8940

Open
char0n opened this issue Jun 19, 2023 · 9 comments · Fixed by #9325 · May be fixed by #9963, #9982 or #9992
Open

Compensate Operation content in lower resolution sizes #8940

char0n opened this issue Jun 19, 2023 · 9 comments · Fixed by #9325 · May be fixed by #9963, #9982 or #9992

Comments

@char0n
Copy link
Member

char0n commented Jun 19, 2023

This can be reproduced both in SwaggerEditor (v4) and Swagger Editor (v5). The preview that is located in the right-hand side (where SwaggerUI displays) is fully collapsible without any limits. The components tries to compensate, but after some threshold they will stop making visual sense.

This is not really specific to SwaggerUI. If we take for example React Material Design components, these reference components will too collapse until they stop making sense.

What we can do is to use Material Design Specification and say that our minimal supported break-point is 360dp/px. We will make CSS changes and make sure that Operations and other visual components renders properly on that break-point. Second remediation can be setting the minimum width of the preview pane in the editors (but not sure this is warranted).

Under threshold of 360dp/px what is displayed is no longer guaranteed.

Work on this can be done progressively, layering changes on top of previous changes:

  • Amend CSS of expand level 0
  • Amend CSS of expand level 1
    ….. repeat to level n ….

Currently SwaggerUI has some notion of minimal supported break-point and some components tries to compensate.

image

@shoaib-31
Copy link

@char0n Hi, please assign this issue to me, I am able to fix this. I am attaching a screenshot of it.
Screenshot from 2023-10-01 04-12-46

@shoaib-31
Copy link

@char0n Please review this PR.

@pedoch
Copy link
Contributor

pedoch commented Oct 20, 2023

@char0n I raised a PR that addresses this issue (#9325). Please take a look whenever you can.

@char0n char0n self-assigned this Nov 10, 2023
char0n pushed a commit that referenced this issue Nov 10, 2023
Along with the operations, Topbar and Authorization button
has been made more responsive as well.

Refs #8940
@char0n char0n reopened this Nov 10, 2023
@char0n
Copy link
Member Author

char0n commented Nov 10, 2023

I'm keeping this issue open as we've basically addressed Amend CSS of expand level 0 - what I mean by this is that collapsed operation has been addressed. Next task is Amend CSS of expand level 1 - address content of expanded Operation.

@char0n
Copy link
Member Author

char0n commented Dec 13, 2023

@pedoch we have another regressions reported:

image
image

I'll try to address this during tomorrow, any help is appreciated.

NOTE: CSS breaks only with combination of latest SwaggEditor: https://github.com/swagger-api/swagger-editor/releases/tag/v5.0.0-alpha.84. Alone it works just fine.


Update (14.12.2023): I've issued #9425.

@pedoch
Copy link
Contributor

pedoch commented Dec 14, 2023

@char0n I see you've pushed a fix for it. Thank you! I tried recreating the bug but I couldn't.

@cxx5208
Copy link

cxx5208 commented Feb 15, 2024

Hey Can you assign this to me? I will try to fix the issue
Thank you

@char0n
Copy link
Member Author

char0n commented Feb 15, 2024

Hi @cxx5208,

No need to assign explicitly. If you with to work on this, just create PRs that reference this issue. Ideally very small PRs, where each PR addresses just one small aspect.

@klm-turing
Copy link

Hi @char0n I got 3 PR for this issue. Let me know if you need anything else. Thanks

github-merge-queue bot pushed a commit to infonl/dimpact-zaakafhandelcomponent that referenced this issue Mar 7, 2025
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [org.webjars:swagger-ui](https://www.webjars.org)
([source](https://github.com/swagger-api/swagger-ui)) |
`5.18.3` -> `5.20.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/org.webjars:swagger-ui/5.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/org.webjars:swagger-ui/5.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/org.webjars:swagger-ui/5.18.3/5.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.webjars:swagger-ui/5.18.3/5.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>swagger-api/swagger-ui (org.webjars:swagger-ui)</summary>

###
[`v5.20.0`](https://github.com/swagger-api/swagger-ui/releases/tag/v5.20.0):
Swagger UI v5.20.0 Released!

##### Bug Fixes

-   **docker:** add OpenContainer labels
- **json-schema-5**: fix JumpToPath feature for schemas, closes
[swagger-api/swagger-editor#4035](https://github.com/swagger-api/swagger-editor/issues/4035)
-   fix JumpToPath feature for auth methods
-   display the correct name of security methods
-   fix console errors appearing when security scheme is not defined
-   **components**: render examples only when their shape is correct
- **swagger-client**: allow resolving URLs without extensions, closes
[swagger-api/apidom#4298](https://github.com/swagger-api/apidom/issues/4298)
-   **css**: fix css sourcemaps
-   **security**: update axios to address CVE-2024-39338
- **swagger-client**: do not encode server variables, closes
[swagger-api/swagger-js#3656](https://github.com/swagger-api/swagger-js/issues/3656)
- **security**: fix unsafe cookie serialization, addresses
CVE-2024-47764, GHSA-pxg6-pf52-xh8x
- **spec**: compensate if OpenAPI.paths field is defined as unexpected
structure
- **json-schema-2020-12**: check for schema type before extracting
extension keywords, closes
[swagger-ui/issues#9376](https://github.com/swagger-api/swagger-ui/issues/9376)
-   **json-schema-2020-12**: fix rendering of uniqueItems keyword
- **json-schema-2020-12**: fix overrides of JSON Schema extension
keywords
-   **spec**: clear JSON state when loading a new definition
-   **oas31**: fix caching of JSON Schema 2020-12 context
- **json-schema-2020-12**: fix default expansion being applied to
components after initial render
- **json-schema-2020-12**: fix complex schemas expanding beyond the
default expansion depth
- **json-schema-2020-12**: fix deep expansion not expanding some of the
keywords
-   **oas31**: fix expansion of Schema Object fixed fields

##### Features

-   **swagger-ui-react**: add support for initialState prop
- add horizontal scrollbar for schemas, refs
[swagger-api/swagger-ui#8940](https://github.com/swagger-api/swagger-ui/issues/8940)
-   display schema of complex parameters
-   display schema of complex request body properties
-   **json-schema-2020-12**: allow to use fn outside of React context
-   **oas31**: display schema of complex parameters with union type
- **oas31**: display schema of complex request body properties with
union type
-   **oas31**: display textarea for parameters with complex union type
- **json-schema-2020-12**: allow to use getTitle outside of JSON Schema
2020-12 context
-   **json-schema-2020-12**: introduce system bound HOC
- **json-schema-2020-12**: add support for rendering extension keywords,
closes
[swagger-ui/issues#9376](https://github.com/swagger-api/swagger-ui/issues/9376)
-   **json-schema-2020-12**: add support for rendering examples keyword
- **json-schema-2020-12**: use JSON Viewer to display keywords with
complex values
- **json-schema-2020-12**: handle empty objects and arrays in JSONViewer
-   **oas3**: more support for OpenAPI 3.0.4
-   introduce custom URL sanitization mechanism
-   apply additional fixes for custom URL sanitization mechanism
-   **oas31**: add support for OpenAPI extensions
-   **json-schema-2020-12**: respect showExtensions config option

***

#### Attributions (alphabetical order)

[@&#8203;char0n](https://github.com/char0n)
[@&#8203;glowcloud](https://github.com/glowcloud)
[@&#8203;robert-hebel-sb](https://github.com/robert-hebel-sb)

###
[`v5.19.0`](https://github.com/swagger-api/swagger-ui/releases/tag/v5.19.0):
Swagger UI v5.19.0 Released!

##### Features

- add support for OpenAPI 3.0.4
([#&#8203;10247](https://github.com/swagger-api/swagger-ui/issues/10247))
([d437474](https://github.com/swagger-api/swagger-ui/commit/d437474b0c8aef286522d19bc7d02e35230d9a7d))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/infonl/dimpact-zaakafhandelcomponent).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xODUuNCIsInVwZGF0ZWRJblZlciI6IjM5LjE4NS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
# for free to join this conversation on GitHub. Already have an account? # to comment