swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

Compensate Operation content in lower resolution sizes

Open char0n opened this issue 2 years ago • 9 comments

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

char0n avatar Jun 19 '23 08:06 char0n

@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 avatar Sep 30 '23 22:09 shoaib-31

@char0n Please review this PR.

shoaib-31 avatar Oct 02 '23 15:10 shoaib-31

@char0n I raised a PR that addresses this issue (https://github.com/swagger-api/swagger-ui/pull/9325). Please take a look whenever you can.

pedoch avatar Oct 20 '23 00:10 pedoch

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 avatar Nov 10 '23 17:11 char0n

@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 https://github.com/swagger-api/swagger-ui/pull/9425.

char0n avatar Dec 13 '23 18:12 char0n

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

pedoch avatar Dec 14 '23 10:12 pedoch

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

cxx5208 avatar Feb 15 '24 08:02 cxx5208

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.

char0n avatar Feb 15 '24 17:02 char0n

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

klm-turing avatar May 31 '24 18:05 klm-turing