Skip to content

Conversation

@benlife5
Copy link
Contributor

@benlife5 benlife5 commented Dec 12, 2025

  • Product card images appear differently in editor than live page
    • Fix: different style applied to the Slot
  • Secondary header links appear left-aligned in editor but right-aligned on live page
    • Fix: different style applied to the Slot
  • Directory heading alignment not being respected on live page
    • Fix: different style applied to the Slot
  • Fixed position header content flash on live page
    • Cause: We had a placeholder div to move the top of the page down below the header. However, this required JS to calculate the height of the header and so it would load as 0 and then update to be correct
    • Fix: css position 'sticky' is supposed to handle this. It previously did not work because the height for the whole page was set to 100vh (in order to push the footer to the bottom of the page). By changing this to min-height, the footer remains always at the bottom but 'sticky' for the header works as expected for the whole length of the page. So, I think we can consolidate 'fixed' into 'sticky'
    • Example with the new sticky: https://daintily-tops-rooster.pgsdemo.com/dc/washington/2517-k-street-northwest

@benlife5 benlife5 added the create-dev-release Triggers dev release workflow label Dec 12, 2025
@github-actions
Copy link
Contributor

Warning: Component files have been updated but no migrations have been added. See https://github.com/yext/visual-editor/blob/main/packages/visual-editor/src/components/migrations/README.md for more information.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 12, 2025

commit: df21035

@benlife5 benlife5 marked this pull request as ready for review December 12, 2025 20:06
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 12, 2025

Walkthrough

This PR removes the "sticky" headerPosition option and consolidates it as "fixed", replaces internal header-height measurement and spacer logic with a simplified wrapper, adds a migration to convert existing "sticky" values to "fixed", changes several DropZone/layout styles from height: "100vh" to minHeight: "100vh", updates a locator template to use pre-migrated data from props, adjusts some slot sizing (fit-content / width: 100%), and removes "sticky" translations from many locale files.

Possibly related PRs

Suggested reviewers

  • colton-demetriou
  • briantstephan
  • mkilpatrick

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the two main changes: fixing header rendering flash and fixing product card image ratio issues.
Description check ✅ Passed The PR description clearly relates to the changeset, explaining specific UI rendering issues and their fixes with good detail.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch rendering-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (4)
packages/visual-editor/src/components/header/SecondaryHeaderSlot.tsx (1)

120-130: Verify Slot actually applies style to the element you intend (and consider Tailwind w-fit).

This fix likely addresses the editor/live mismatch, but it relies on @measured/puck’s Slot forwarding style to the correct DOM node (wrapper vs inner). If it doesn’t, consider wrapping the slot in a <div className="w-fit">…</div> or using className="w-fit h-auto" directly on the slot (if supported) to stay consistent with the rest of the Tailwind usage.

packages/visual-editor/src/docs/ai/components.d.ts (1)

523-528: Type narrowing looks correct; consider updating the docstring wording.

headerPosition: "sticky" | "scrollsWithPage" aligns with the component changes. The comment “Whether the header is ‘sticky’ or not” is slightly misleading now that this is a two-value mode; consider rewording to “Header positioning behavior”.

packages/visual-editor/src/components/header/ExpandedHeader.tsx (1)

27-32: LGTM on removing “fixed”; drop the now-unnecessary fragment wrapper.

headerPosition: "sticky" | "scrollsWithPage" and the simplified wrapper are consistent with the new approach. Since you’re no longer conditionally rendering a spacer, the outer <>...</> can be removed.

 const ExpandedHeaderWrapper: PuckComponent<ExpandedHeaderProps> = ({
   styles,
   slots,
 }) => {
   return (
-    <>
-      <div className={headerWrapper({ position: styles.headerPosition })}>
+    <div className={headerWrapper({ position: styles.headerPosition })}>
       {/* Secondary Header (Top Bar) */}
       <div className="hidden md:flex">
         <slots.SecondaryHeaderSlot
           style={{ height: "auto", width: "100%" }}
         />
       </div>

       {/* Primary Header w/ nav bar */}
       <slots.PrimaryHeaderSlot style={{ height: "auto" }} />
-      </div>
-    </>
+    </div>
   );
 };

Also applies to: 105-118

packages/visual-editor/src/components/migrations/0046_removed_fixed_header.ts (1)

1-13: Migration logic is correct; consider avoiding in-place mutation (optional).

Current implementation works, but returning a copied object is a bit safer if props might be reused elsewhere.

 export const removeFixedHeader: Migration = {
   ExpandedHeader: {
     action: "updated",
     propTransformation: (props) => {
       if (props.styles?.headerPosition === "fixed") {
-        props.styles.headerPosition = "sticky";
+        return {
+          ...props,
+          styles: { ...props.styles, headerPosition: "sticky" },
+        };
       }
-      return props;
+      return props;
     },
   },
 };
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e381a5d and 3af3d2d.

⛔ Files ignored due to path filters (1)
  • packages/visual-editor/src/components/testing/screenshots/StaticMapSection/[desktop] default props with coordinate - with api key.png is excluded by !**/*.png, !packages/visual-editor/src/components/testing/screenshots/**
📒 Files selected for processing (12)
  • packages/visual-editor/src/components/configs/directoryConfig.tsx (1 hunks)
  • packages/visual-editor/src/components/configs/locatorConfig.tsx (1 hunks)
  • packages/visual-editor/src/components/configs/mainConfig.tsx (1 hunks)
  • packages/visual-editor/src/components/header/ExpandedHeader.test.tsx (1 hunks)
  • packages/visual-editor/src/components/header/ExpandedHeader.tsx (2 hunks)
  • packages/visual-editor/src/components/header/SecondaryHeaderSlot.tsx (1 hunks)
  • packages/visual-editor/src/components/migrations/0046_removed_fixed_header.ts (1 hunks)
  • packages/visual-editor/src/components/migrations/migrationRegistry.ts (2 hunks)
  • packages/visual-editor/src/components/pageSections/ProductSection/ProductCard.tsx (1 hunks)
  • packages/visual-editor/src/docs/ai/components.d.ts (1 hunks)
  • packages/visual-editor/src/docs/components.md (1 hunks)
  • packages/visual-editor/src/vite-plugin/templates/locator.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-29T22:00:03.843Z
Learnt from: mkouzel-yext
Repo: yext/visual-editor PR: 833
File: packages/visual-editor/src/components/Locator.tsx:1050-1057
Timestamp: 2025-10-29T22:00:03.843Z
Learning: In packages/visual-editor/src/components/Locator.tsx, the AppliedFilters component is intentionally rendered in two locations (inside the filter modal and outside it) as per the design requirements. This dual rendering should not be flagged as a duplicate issue.

Applied to files:

  • packages/visual-editor/src/vite-plugin/templates/locator.tsx
🧬 Code graph analysis (1)
packages/visual-editor/src/components/migrations/migrationRegistry.ts (1)
packages/visual-editor/src/components/migrations/0046_removed_fixed_header.ts (1)
  • removeFixedHeader (3-13)
🔇 Additional comments (7)
packages/visual-editor/src/components/configs/directoryConfig.tsx (1)

65-69: LGTM! Enables sticky positioning while preserving layout.

The change from height: "100vh" to minHeight: "100vh" allows content to grow beyond the viewport while maintaining the minimum height needed to keep the footer at the bottom. This enables sticky header positioning as described in the PR objectives.

packages/visual-editor/src/components/configs/mainConfig.tsx (1)

75-79: LGTM! Consistent change across configs.

The change from height: "100vh" to minHeight: "100vh" is consistent with the other config files and enables sticky header functionality while preserving footer placement.

packages/visual-editor/src/components/configs/locatorConfig.tsx (1)

64-68: LGTM! Completes consistent styling across all configs.

The change from height: "100vh" to minHeight: "100vh" is consistent with the other config files (directoryConfig and mainConfig) and enables the sticky header fix described in the PR objectives.

packages/visual-editor/src/components/pageSections/ProductSection/ProductCard.tsx (1)

339-343: LGTM! Rendering fix correctly applied.

The inline style height: "fit-content" combined with the responsive minimum height ensures consistent image rendering between the editor and live page, addressing the stated PR objective.

packages/visual-editor/src/vite-plugin/templates/locator.tsx (2)

107-120: LGTM: Proper data transformation pattern.

Moving the migration and resolution logic into transformProps is the correct approach. This ensures data is fully resolved before the component renders, eliminating the rendering flash mentioned in the PR objectives.


144-144: LGTM: Correctly uses pre-resolved data.

Passing the pre-resolved data from props (prepared by transformProps) to the Render component eliminates the need for inline migration during render. This architectural improvement directly addresses the rendering flash issue and follows React best practices by separating data transformation from rendering.

packages/visual-editor/src/docs/components.md (1)

276-280: Docs update matches the new headerPosition contract.

The props table correctly reflects "sticky" | "scrollsWithPage".

asanehisa
asanehisa previously approved these changes Dec 12, 2025
Copy link
Contributor

@asanehisa asanehisa left a comment

Choose a reason for hiding this comment

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

nice! awesome we can get the header "fixed" fixed haha

@mkilpatrick mkilpatrick changed the title fix: fixed header rendering flash and and product card image ratio fix: fixed header rendering flash and product card image ratio Dec 12, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 12, 2025

⚠️ Deleted Translation Keys Detected

🔤 Deleted Translation Keys

fields

Key Languages Removed
fields.options.sticky cs,da de,en en-GB,es et,fi fr,hr hu,it ja,lt lv,nb nl,pl pt,ro sk,sv tr,zh

mkilpatrick
mkilpatrick previously approved these changes Dec 12, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/visual-editor/src/docs/components.md (1)

276-279: Consider clarifying the headerPosition description.

The description "Whether the header is fixed to the top of the page or not" reads like a boolean choice, but the property accepts two distinct values: "fixed" (header remains at top) and "scrollsWithPage" (header scrolls normally). Consider revising to something like: "Controls header positioning: 'fixed' keeps it at the top, 'scrollsWithPage' allows it to scroll with content."

</review_comment_end>

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3af3d2d and 3f05ae8.

📒 Files selected for processing (29)
  • packages/visual-editor/locales/cs/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/da/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/de/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/en-GB/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/en/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/es/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/et/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/fi/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/fr/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/hr/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/hu/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/it/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/ja/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/lt/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/lv/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/nb/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/nl/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/pl/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/pt/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/ro/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/sk/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/sv/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/tr/visual-editor.json (0 hunks)
  • packages/visual-editor/locales/zh/visual-editor.json (0 hunks)
  • packages/visual-editor/src/components/header/ExpandedHeader.tsx (3 hunks)
  • packages/visual-editor/src/components/migrations/0046_merge_sticky_and_fixed_header.ts (1 hunks)
  • packages/visual-editor/src/components/migrations/migrationRegistry.ts (2 hunks)
  • packages/visual-editor/src/docs/ai/components.d.ts (1 hunks)
  • packages/visual-editor/src/docs/components.md (1 hunks)
💤 Files with no reviewable changes (24)
  • packages/visual-editor/locales/es/visual-editor.json
  • packages/visual-editor/locales/fi/visual-editor.json
  • packages/visual-editor/locales/nb/visual-editor.json
  • packages/visual-editor/locales/de/visual-editor.json
  • packages/visual-editor/locales/lt/visual-editor.json
  • packages/visual-editor/locales/lv/visual-editor.json
  • packages/visual-editor/locales/sk/visual-editor.json
  • packages/visual-editor/locales/zh/visual-editor.json
  • packages/visual-editor/locales/cs/visual-editor.json
  • packages/visual-editor/locales/hr/visual-editor.json
  • packages/visual-editor/locales/pl/visual-editor.json
  • packages/visual-editor/locales/nl/visual-editor.json
  • packages/visual-editor/locales/en/visual-editor.json
  • packages/visual-editor/locales/en-GB/visual-editor.json
  • packages/visual-editor/locales/da/visual-editor.json
  • packages/visual-editor/locales/sv/visual-editor.json
  • packages/visual-editor/locales/hu/visual-editor.json
  • packages/visual-editor/locales/tr/visual-editor.json
  • packages/visual-editor/locales/pt/visual-editor.json
  • packages/visual-editor/locales/it/visual-editor.json
  • packages/visual-editor/locales/ja/visual-editor.json
  • packages/visual-editor/locales/fr/visual-editor.json
  • packages/visual-editor/locales/et/visual-editor.json
  • packages/visual-editor/locales/ro/visual-editor.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/visual-editor/src/docs/ai/components.d.ts
  • packages/visual-editor/src/components/header/ExpandedHeader.tsx
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-12T20:17:30.322Z
Learnt from: benlife5
Repo: yext/visual-editor PR: 946
File: packages/visual-editor/src/components/migrations/migrationRegistry.ts:47-48
Timestamp: 2025-12-12T20:17:30.322Z
Learning: In the yext/visual-editor repository, empty object placeholders (`{}`) in the migrationRegistry array are sometimes intentionally used to reserve migration slots for parallel PRs to prevent merge conflicts and maintain consistent migration indices.

Applied to files:

  • packages/visual-editor/src/components/migrations/migrationRegistry.ts
🧬 Code graph analysis (1)
packages/visual-editor/src/components/migrations/migrationRegistry.ts (1)
packages/visual-editor/src/components/migrations/0046_merge_sticky_and_fixed_header.ts (1)
  • mergeStickyAndFixedHeader (3-13)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: call_unit_test / unit_tests (20.x)
  • GitHub Check: call_unit_test / unit_tests (18.x)
  • GitHub Check: create-dev-release
  • GitHub Check: semgrep/ci
🔇 Additional comments (3)
packages/visual-editor/src/components/migrations/migrationRegistry.ts (2)

47-47: LGTM!

The import and registration of the new migration mergeStickyAndFixedHeader is correctly implemented. The migration will transform existing "sticky" headerPosition values to "fixed" as intended.

</review_comment_end>


99-100: LGTM - placeholder is intentional.

Based on learnings, the empty object placeholder at line 99 is intentionally reserved for migration 0045 from a parallel PR to prevent index conflicts.

</review_comment_end>

packages/visual-editor/src/components/migrations/0046_merge_sticky_and_fixed_header.ts (1)

3-13: LGTM!

The migration correctly transforms headerPosition: "sticky" to "fixed" for ExpandedHeader components. The implementation:

  • Uses optional chaining to safely check nested properties
  • Follows the standard migration pattern of direct prop mutation
  • Handles only the specific case that needs transformation

</review_comment_end>

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/visual-editor/src/components/directory/Directory.tsx (1)

90-91: Full‑width slot styling is appropriate here

Using width: "100%" on SiteNameSlot and TitleSlot matches the centered column layout of the PageSection and should help keep editor vs. live rendering consistent. No functional concerns from this change.

If you want to avoid repeating inline style and keep things a bit cleaner, you could factor a shared style object:

const headingSlotStyle = { height: "auto", width: "100%" };
// ...
<slots.SiteNameSlot style={headingSlotStyle} />
<slots.TitleSlot style={headingSlotStyle} />

But this is purely optional and the current code is fine as-is.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3f05ae8 and df21035.

📒 Files selected for processing (1)
  • packages/visual-editor/src/components/directory/Directory.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: call_unit_test / unit_tests (20.x)
  • GitHub Check: call_unit_test / unit_tests (18.x)
  • GitHub Check: create-dev-release
  • GitHub Check: semgrep/ci

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

Labels

create-dev-release Triggers dev release workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants