commercetools / commercetools-docs-kit

Tools and components for developing Documentation websites 🛠
https://docs-kit.commercetools.vercel.app
MIT License
18 stars 5 forks source link

Display multiple scopes in api endpoints in two columns #2076

Closed timonrey closed 2 months ago

timonrey commented 2 months ago

Description of changes

Link original ticket closes https://github.com/commercetools/commercetools-docs/issues/4871

Screenshot of changes (if applicable) After:

Screenshot 2024-09-10 at 2 46 02 PM

Maintaining no column for less than 10 scopes and two columns for more than 10 scopes:

Screenshot 2024-09-10 at 2 46 10 PM

DoD guidelines

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: 88bbaa20892639486142851306f45abd46a6b1c9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages | Name | Type | | ------------------------------------------ | ----- | | @commercetools-docs/gatsby-theme-api-docs | Minor | | @commercetools-api-specs/test | Minor | | @commercetools-website/api-docs-smoke-test | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

github-actions[bot] commented 2 months ago

🚚 Build Process Details

Preview URLs:

gabriele-ct commented 2 months ago

I think @ColinRosati that on mobile viewports we agreed in the ticket to display the scopes in a single column

Screenshot 2024-09-11 at 07 52 34

@zbalek can you confirm this? This is the direct link to the page

nkuehn commented 2 months ago

FYI that was why I was asking for an actual coulumn layout. No need for breakpoints, it automatically puts the number of columns that fit the space and distributes content so that columns are same height.

ColinRosati commented 2 months ago

Thanks for the feedback @nkuehn. I have a mock up of using pure css columns and have some unintended limitations for the colums:

CSS Columns POC - Column cant controls the content inside the elements, so we don't guarantee a single scope is dedicated to one column and can span across multiple. - We see poor layout for scopes with small amounts. The column align wont kick in until there is column element threshold is met. - Cant control row gap (vertical space between elements). Of course theres other ways to add vertical space to element. This make the scopes less readable I explored some other config adding some additional spacing between text. But this appears to be suboptimal. This is the result of the columns POC: Screenshot 2024-09-11 at 9 22 31 AM Screenshot 2024-09-11 at 9 22 36 AM Screenshot 2024-09-11 at 9 22 45 AM

The solution I propose removes the number of column controlling gap mentioned previously. The behaviour is now: Columns for desktops Mobile single column (comma separated)

zbalek commented 2 months ago

@gabriele-ct - Thanks for attaching the link. Let's not squish it on mobile - we can leave it as one column.

gabriele-ct commented 2 months ago

Mobile view:

Screenshot 2024-09-11 at 11 44 36

Tablet/Desktop view with few elements:

Screenshot 2024-09-11 at 11 57 17

Tablet/Desktop with many elements:

Screenshot 2024-09-11 at 11 57 56

are we ok with this @zbalek

zbalek commented 2 months ago

Ye, looks good - thanks all!