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

Port HowToV2 block from express to milo #128

Merged
merged 20 commits into from
Feb 7, 2025
Merged

Conversation

jsandland
Copy link
Collaborator

@jsandland jsandland commented Jan 10, 2025

Describe your specific features or fixes:

Resolves: MWPW-164891
how-to-v2
Example in express: https://stage--express--adobecom.hlx.page/drafts/jsandlan/how-to-steps-accordion
Example in milo: https://port-how-to-v2-from-express--express-milo--adobecom.hlx.page/drafts/jsandlan/how-to-v2-milo

Copy link

aem-code-sync bot commented Jan 10, 2025

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

@jsandland jsandland changed the title init add how-to-v2 files - WIP Port HowToV2 block from express to milo Jan 10, 2025
@jsandland jsandland added the do not merge Use if business reason for not merging. label Jan 10, 2025
@aem-code-sync aem-code-sync bot temporarily deployed to port-how-to-v2-from-express January 11, 2025 20:45 Inactive
Copy link

aem-code-sync bot commented Jan 11, 2025

Page Scores Audits
📱 /drafts/jsandlan/how-to-v2-milo PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS
🖥️ /drafts/jsandlan/how-to-v2-milo PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS

@jsandland jsandland removed the do not merge Use if business reason for not merging. label Jan 12, 2025
Copy link
Collaborator

@vhargrave vhargrave left a comment

Choose a reason for hiding this comment

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

found a few things.
Some unit tests wouldn't hurt either 🙌

express/code/scripts/embed-videos.js Outdated Show resolved Hide resolved
express/code/blocks/how-to-v2/how-to-v2.js Outdated Show resolved Hide resolved
express/code/blocks/how-to-v2/how-to-v2.js Outdated Show resolved Hide resolved
@jsandland jsandland added do not merge Use if business reason for not merging. and removed do not merge Use if business reason for not merging. labels Jan 13, 2025
@aem-code-sync aem-code-sync bot temporarily deployed to port-how-to-v2-from-express January 24, 2025 20:46 Inactive
@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.85%. Comparing base (d11561c) to head (6a7b38e).
Report is 220 commits behind head on stage.

Additional details and impacted files
@@            Coverage Diff             @@
##            stage     #128      +/-   ##
==========================================
- Coverage   67.01%   66.85%   -0.17%     
==========================================
  Files          62       61       -1     
  Lines       10148    10104      -44     
==========================================
- Hits         6801     6755      -46     
- Misses       3347     3349       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aem-code-sync aem-code-sync bot temporarily deployed to port-how-to-v2-from-express January 24, 2025 20:49 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to port-how-to-v2-from-express January 24, 2025 21:04 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to port-how-to-v2-from-express January 24, 2025 21:08 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to port-how-to-v2-from-express January 24, 2025 21:35 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to port-how-to-v2-from-express January 24, 2025 21:55 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to port-how-to-v2-from-express January 24, 2025 22:28 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to port-how-to-v2-from-express January 24, 2025 22:30 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to port-how-to-v2-from-express January 24, 2025 22:31 Inactive
@rgclayton
Copy link
Collaborator

rgclayton commented Jan 27, 2025

A few more observations.

I created a test page under my drafts folder:

The first how-to block on the page doesn't have title text above it and it has a media block under it, in the same section. Notice the how-to block pulls the title text out of the media block and inserts it above the how-to.

The second how to block doesn't have a title in the same section and returns null on the page.

@vhargrave, @fullcolorcoder,
I know this is a port from the express site. But, I almost think it would be better to have the title/heading for the block be a new row - similar to the rest of the block features - to avoid an odd authoring experience like I noted above. What do you think?

@aem-code-sync aem-code-sync bot temporarily deployed to port-how-to-v2-from-express January 27, 2025 21:22 Inactive
@jsandland
Copy link
Collaborator Author

jsandland commented Jan 27, 2025

A few more observations.

I created a test page under my drafts folder:

The first how-to block on the page doesn't have title text above it and it has a media block under it, in the same section. Notice the how-to block pulls the title text out of the media block and inserts it above the how-to.

The second how to block doesn't have a title in the same section and returns null on the page.

I've updated this block so that the header is a new row within the block to address the comments above. I've also removed any reliance on section.

@aem-code-sync aem-code-sync bot temporarily deployed to port-how-to-v2-from-express January 29, 2025 20:40 Inactive
@rgclayton
Copy link
Collaborator

@jsandland Still seeing some issues. Here's my sample page for reference.

  • If the header row is omitted the block fails to decorate correctly (throws null in place where h tag would be).
  • If the header text is not an h2, h3, h4 the block fails to decorate (throws null in place where h tag would be).

I think adding a header should be optional.

I don't think you should force the author to use an h2, h3, h4 to decorate. You should accept any string and size the text as needed. For SEO reasons you should let the author decided on which heading to use depending on where the block falls on the page. Maybe default wrapping plain text in a h2 or h3. But leave as is if the author styles the text with any h tag they choose.

I'll try and get some sample code to help point you in the right direction for this.

In the mean time you can take a look at how some of the blocks in milo-core decorate the block to achieve similar things.

Hero marquee has a lot going on but a similar example to what your block has as far as structure (key value pairs).

Marquee block. A more simple version than the hero marquee.

cc: @fullcolorcoder

@aem-code-sync aem-code-sync bot temporarily deployed to port-how-to-v2-from-express January 30, 2025 18:25 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to port-how-to-v2-from-express January 30, 2025 19:01 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to port-how-to-v2-from-express January 30, 2025 19:02 Inactive
@vhargrave
Copy link
Collaborator

A few more observations.
I created a test page under my drafts folder:

The first how-to block on the page doesn't have title text above it and it has a media block under it, in the same section. Notice the how-to block pulls the title text out of the media block and inserts it above the how-to.
The second how to block doesn't have a title in the same section and returns null on the page.

@vhargrave, @fullcolorcoder, I know this is a port from the express site. But, I almost think it would be better to have the title/heading for the block be a new row - similar to the rest of the block features - to avoid an odd authoring experience like I noted above. What do you think?

@rgclayton I agree, that sounds like a good approach.

@rgclayton
Copy link
Collaborator

A few more observations.
I created a test page under my drafts folder:

The first how-to block on the page doesn't have title text above it and it has a media block under it, in the same section. Notice the how-to block pulls the title text out of the media block and inserts it above the how-to.
The second how to block doesn't have a title in the same section and returns null on the page.

@vhargrave, @fullcolorcoder, I know this is a port from the express site. But, I almost think it would be better to have the title/heading for the block be a new row - similar to the rest of the block features - to avoid an odd authoring experience like I noted above. What do you think?

@rgclayton I agree, that sounds like a good approach.

@vhargrave @fullcolorcoder,
I believe @jsandland and I figured at a better approach that feels more authoring intuitive. Basically, using regular page titles (due to how the title sits above the block). Which in turn reduces some of the complexity in the block decoration.

Jackson, did this all work out?

@aem-code-sync aem-code-sync bot temporarily deployed to port-how-to-v2-from-express January 31, 2025 18:49 Inactive
@jsandland jsandland requested review from vhargrave and removed request for vhargrave February 1, 2025 00:21
@jsandland jsandland added Ready for Review Ready for peer review. and removed Ready for Review Ready for peer review. labels Feb 5, 2025
@aem-code-sync aem-code-sync bot temporarily deployed to port-how-to-v2-from-express February 6, 2025 21:26 Inactive
@jsandland jsandland merged commit 75c5986 into stage Feb 7, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for Review Ready for peer review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants