Skip to content

Call section-columns layout unconditionally for static pages - #52

Open
qiyundai wants to merge 3 commits into
stagefrom
feat/section-columns-layout
Open

Call section-columns layout unconditionally for static pages#52
qiyundai wants to merge 3 commits into
stagefrom
feat/section-columns-layout

Conversation

@qiyundai

Copy link
Copy Markdown
Collaborator

Ticket

No ticket — follow-up to event-libs' opt-in flex-column section layout feature.

Summary

event-libs added applySectionColumnsLayout(): page metadata section-layout: columns makes a page's <main> a flex row of its .section children (columns), with blocks still stacking normally inside each column. It's exported publicly (not called from decorateEvent) because decorateEvent only runs on pages with event-id — and this repo's own decorateArea only calls decorateEvent after that same gate, so the feature would never reach static/non-event pages otherwise.

This PR imports applySectionColumnsLayout from event-libs' libs.js and calls it directly, unconditionally, in this repo's decorateArea(), above the event-id gate — so both event and static pages get the layout when authored. It loads its own required CSS internally, so no other wiring is needed here.

Companion PR in event-libs: adobecom/event-libs#232

Test plan

  • npm run lint — clean (pre-existing errors in unrelated files: registration-cache.js, tools/ms-apps/daUtils.js)
  • npm test — 46/46 passing
  • Reviewed via /code-review (high effort) — no critical/blocking findings; call placement, timing relative to Milo's setConfig/DOM readiness, and idempotency under fragment/personalization re-entry were all verified against actual Milo and event-libs source
  • Manual: author a static (no event-id) page with section-layout: columns metadata and 2-3 sections; confirm side-by-side columns above 900px and normal stacking below it

qiyundai and others added 2 commits August 11, 2026 21:32
event-libs now exports applySectionColumnsLayout and addStylesToEventPage
publicly instead of running them only inside decorateEvent, which is gated
behind event-id and never runs on static/non-event pages. da-events calls
both directly in its own decorateArea, above the event-id gate, so pages
using `section-layout: columns` page metadata get the flex-column layout
regardless of whether they're event pages.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
event-libs' applySectionColumnsLayout() is now exported publicly and
loads its own required CSS, since decorateEvent (which used to call it
internally) is gated behind event-id and never runs on static pages.
da-events' own decorateArea calls it directly, unconditionally, above
that gate, so pages using `section-layout: columns` page metadata get
the flex-column layout regardless of whether they're event pages.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@aem-code-sync

aem-code-sync Bot commented Aug 12, 2026

Copy link
Copy Markdown

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 all PSI checks
  • Re-run failed PSI checks
  • Re-sync branch
Commits

Comment thread events/scripts/scripts.js Outdated
Comment on lines +67 to +69
// Runs unconditionally (unlike decorateEvent below) since section-layout
// is meant for static/non-event pages too, not just pages with an event-id.
// Loads its own required CSS internally.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

comments can be removed

…se comments

The applyPageBackground destructured import hit a merge conflict from a
stash pop against the existing applySectionColumnsLayout wiring - resolved by
keeping both. Added the missing applyPageBackground() call in loadPage()
alongside applySectionColumnsLayout(), both after await loadArea() so Milo's
.section class exists by the time they run.

Also strips all non-license-header, non-functional comments per byte-size
preference for this unbundled, unminified library (kept the
eslint-disable-next-line on the dapreview dynamic import, since that one is
functional, not documentation).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@adobecom-git-stale-pr-bot adobecom-git-stale-pr-bot Bot added the stale No recent activity label Sep 3, 2026
@adobecom-git-stale-pr-bot

Copy link
Copy Markdown

No activity in 7 days. Will be labeled stale at 14 days. Auto-close is disabled this run. Add stale-ignore to exempt.

No activity in 14 days, labeled stale (removed automatically on new activity). Auto-close is disabled this run. Add stale-ignore to exempt.


Rundeck job Git Stale PR Check (git-stale-pr-bot), execution 2739336, project global, run by casalino

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale No recent activity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants