Skip to content
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

Search box is not aligned to the index nav width on the release notes page #2085

Conversation

ColinRosati
Copy link
Contributor

@ColinRosati ColinRosati commented Sep 13, 2024

Description of changes

  • Align layout header and layout page content for release notes
  • util for shared layout for header and page content
  • refactor grid layouts
    • Shared const IDs in layout components
    • extracted config and logic

Link to original ticket
closes #2068

Link to change (deep-link for reviewing the change)

Screenshot of changes (if applicable)

DoD guidelines

  • user documentation added?
  • stakeholders approve changes? (if needed)

Copy link

changeset-bot bot commented Sep 13, 2024

🦋 Changeset detected

Latest commit: 8be6e25

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

This PR includes changesets to release 6 packages
Name Type
@commercetools-website/self-learning-smoke-test Minor
@commercetools-docs/gatsby-theme-docs Minor
@commercetools-website/api-docs-smoke-test Patch
@commercetools-website/docs-smoke-test Patch
@commercetools-website/documentation Patch
@commercetools-website/site-template 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

Copy link
Contributor

github-actions bot commented Sep 13, 2024

@ColinRosati ColinRosati marked this pull request as draft September 13, 2024 12:17
@ColinRosati ColinRosati marked this pull request as ready for review September 30, 2024 10:36
*
* Note: Release notes page has a different varient on column two's width to account for search filters
*/
export const contentLayoutConfig = {
Copy link
Contributor Author

@ColinRosati ColinRosati Sep 30, 2024

Choose a reason for hiding this comment

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

Extracted a single source of truth for layout config mapping.
We have 2 layouts here "default" & "releaseNotes"

};

// Namespace declarations for all app layout grid ids
export const GRID_ID_ROW_ONE = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Extracting shared vars for global grid layout ids

* @param allowWideContentLayout boolean to determine if the page should allow wide content layout
* @returns
*/
export const getPageLayoutGridStyles = ({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the single entry point for layout components to get their grid styling from. We can avoid layout drift by reducing the duplicated code

gridRows,
isReleaseNotesPage: props.isReleaseNotesPage,
allowWideContentLayout: props.allowWideContentLayout,
isHeader: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Header flag configures fixed width or not

Copy link
Contributor

@gabriele-ct gabriele-ct left a comment

Choose a reason for hiding this comment

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

The refactor seems ok, I'm relying mostly on VRT to ensure possible side effects.
One important thing @ColinRosati make sure to link the correct issue to the PR, as far as I can see the one linked is not related with the task

@ColinRosati
Copy link
Contributor Author

The refactor seems ok, I'm relying mostly on VRT to ensure possible side effects. One important thing @ColinRosati make sure to link the correct issue to the PR, as far as I can see the one linked is not related with the task

Thanks updated the link. I was relying on VRT as well. I manually tested few different layouts

@ColinRosati
Copy link
Contributor Author

Hey @zbalek can you help check that this fixes the layout issue for release notes?
I also did some refactor to unify layout code could you click around a few pages to see if you can spot any layout changes?

@zbalek
Copy link

zbalek commented Sep 30, 2024

Hey @zbalek can you help check that this fixes the layout issue for release notes? I also did some refactor to unify layout code could you click around a few pages to see if you can spot any layout changes?

Hi @ColinRosati can you please share a preview link?

@ColinRosati
Copy link
Contributor Author

@zbalek Theres a few different layouts here:
https://docskit-cc-searchbox-is-not-aligned-to-the-index-nav-width-o.commercetools.vercel.app/docs-smoke-test/
https://docskit-cc-searchbox-is-not-aligned-to-the-index-nav-width-o.commercetools.vercel.app/api-docs-smoke-test/

For the release notes search box I can only test that locally unfornately and will have to wait till we merge and test the changes in docs release

@zbalek
Copy link

zbalek commented Oct 1, 2024

@ColinRosati Okay, in that case I only took a look at the layouts in the links you've shared. The second one actually misses a search box completely (?🤔)

image

@ColinRosati
Copy link
Contributor Author

@gabriele-ct
Copy link
Contributor

As fare as I can see, the ticket seems to refer to the release notes page which exists only on the docs repo and uses a custom layout see websites/docs/src/pages/release-notes.js in docs repo.
I'd start from there.

@ColinRosati
Copy link
Contributor Author

ColinRosati commented Oct 1, 2024

As fare as I can see, the ticket seems to refer to the release notes page which exists only on the docs repo and uses a custom layout see websites/docs/src/pages/release-notes.js in docs repo. I'd start from there.

Thats right, the docs release-notes page as well as our other pages use the layout components within docs-kit. Ive tested the changes locally for release notes page, but unfortunately wont be able to get a preview deploy of the docs repo. I would propose we move forward with the PR and do the feature QA in docs release

@gabriele-ct
Copy link
Contributor

In this case I would proceed as follow:

  • merge this PR
  • create a new release that includes these changes
  • apply the new release to docs repo on a feature branch
  • ensure the issue with the release-notes page is gone, or work on fix for it (in the same branch)
  • finally ask stakeholders to verify the issue directly on the docs repo preview.
  • merge the docs PR

Ensure that the issue remains open as this PR it's not going to fix it directly.

@FFawzy do you agree?

@ColinRosati ColinRosati merged commit c6b6732 into main Oct 1, 2024
10 checks passed
@ColinRosati ColinRosati deleted the cc-searchbox-is-not-aligned-to-the-index-nav-width-on-the-release-notes-page branch October 1, 2024 09:40
@ct-changesets ct-changesets bot mentioned this pull request Oct 1, 2024
gabriele-ct pushed a commit that referenced this pull request Oct 1, 2024
… page (#2085)

Description of changes

Align layout header and layout page content for release notes
util for shared layout for header and page content
refactor grid layouts
Shared const IDs in layout components
extracted config and logic
Link to original ticket
closes #2068

* feat: Shared Page Content layout util

* chore: use global grid ids in layouts

* chore: add changeset

* fix: xl column2 bug

* chore: code improvements

* fix: header row height

* fix: column2 tablet

* chore: update comment

* fix: column2 fixed body
gabriele-ct added a commit that referenced this pull request Oct 1, 2024
* feat: add feedback feature to self-learning pages

* chore: added type definitions for png

* chore: fix padding and add script loading delay

* chore: refactor to use same thumbs component in ai assistant

* chore: changeset

* chore: hide feedback buttons on mobile

* chore: add google analytics call

* chore: address PR comments

* Search box is not aligned to the index nav width on the release notes page (#2085)

Description of changes

Align layout header and layout page content for release notes
util for shared layout for header and page content
refactor grid layouts
Shared const IDs in layout components
extracted config and logic
Link to original ticket
closes #2068

* feat: Shared Page Content layout util

* chore: use global grid ids in layouts

* chore: add changeset

* fix: xl column2 bug

* chore: code improvements

* fix: header row height

* fix: column2 tablet

* chore: update comment

* fix: column2 fixed body

---------

Co-authored-by: Colin Rosati <[email protected]>
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.

Searchbox is not aligned to the index nav width on the release notes page
3 participants