Skip to content

feat: handle head deploy state#1066

Merged
jwartofsky-yext merged 5 commits intomainfrom
handleHeadDeployState
Feb 26, 2026
Merged

feat: handle head deploy state#1066
jwartofsky-yext merged 5 commits intomainfrom
handleHeadDeployState

Conversation

@jwartofsky-yext
Copy link
Contributor

@jwartofsky-yext jwartofsky-yext commented Feb 26, 2026

Show a different error message depending on the head deploy state

This replaces "deployInProgress" in template metadata

Dependent on this change: https://gerrit.yext.com/c/alpha/+/322590

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec3bc42 and bab2fee.

📒 Files selected for processing (1)
  • packages/visual-editor/src/internal/puck/components/ThemeHeader.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/visual-editor/src/internal/puck/components/ThemeHeader.tsx

Walkthrough

Replaces the boolean deploymentInProgress with a new HeadDeployStatus union ("RUNNING" | "INACTIVE" | "FAILED" | "ACTIVE") on TemplateMetadata and initializes it. Components (InternalThemeEditor, ThemeHeader, LayoutHeader) and their props updated to use headDeployStatus; publish gating now checks history length or headDeployStatus !== "ACTIVE" and derives tooltip text via a new getPublishTooltipMessageFromHeadDeployStatus utility. Adds localized publishBlocked messages deploymentFailed and deploymentInactive across many platform locales.

Sequence Diagram(s)

sequenceDiagram
  participant User as User
  participant ThemeHeader as ThemeHeader
  participant TemplateMetadata as TemplateMetadata
  participant TooltipUtil as getPublishTooltipMessageFromHeadDeployStatus
  participant PublishService as PublishService

  User->>ThemeHeader: Click "Publish"
  ThemeHeader->>TemplateMetadata: Read headDeployStatus & history
  alt history length == 1 or headDeployStatus != "ACTIVE"
    ThemeHeader->>TooltipUtil: getPublishTooltipMessageFromHeadDeployStatus(headDeployStatus)
    TooltipUtil-->>ThemeHeader: localized tooltip (RUNNING/FAILED/INACTIVE) or undefined
    ThemeHeader-->>User: show disabled publish + tooltip
  else
    ThemeHeader->>PublishService: initiate publish
    PublishService-->>ThemeHeader: publish result
    ThemeHeader-->>User: show publish result / errors
  end
Loading

Possibly related PRs

Suggested labels

create-dev-release

Suggested reviewers

  • mkilpatrick
  • benlife5
  • asanehisa
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: handle head deploy state' directly reflects the main change: replacing deploymentInProgress with a new headDeployStatus-based mechanism to display context-specific error messages based on deployment state.
Description check ✅ Passed The description clearly relates to the changeset by explaining the purpose of replacing 'deployInProgress' with head deploy state handling to show different error messages for various deployment states.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch handleHeadDeployState

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: 3

🧹 Nitpick comments (1)
packages/visual-editor/src/internal/puck/components/ThemeHeader.tsx (1)

39-52: Consider destructuring headDeployStatus for consistency.

The headDeployStatus prop is accessed via props.headDeployStatus (lines 144, 147) while all other props are destructured. For consistency, consider adding it to the destructuring block.

♻️ Suggested refactor
   const {
     isDevMode,
     setThemeHistories,
     onPublishTheme,
     themeConfig,
     themeHistories,
     clearThemeHistory,
     puckInitialHistory,
     clearLocalChangesModalOpen,
     setClearLocalChangesModalOpen,
     totalEntityCount,
     localDev,
+    headDeployStatus,
   } = props;

Then update the usages:

   const publishDisabled =
-    themeHistories?.histories?.length === 1 ||
-    props.headDeployStatus !== "ACTIVE";
+    themeHistories?.histories?.length === 1 || headDeployStatus !== "ACTIVE";

   const publishTooltipMessage = getPublishTooltipMessageFromHeadDeployStatus(
-    props.headDeployStatus
+    headDeployStatus
   );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/visual-editor/src/internal/puck/components/ThemeHeader.tsx` around
lines 39 - 52, The component ThemeHeader currently reads props.headDeployStatus
directly while all other props are destructured; update the destructuring in the
ThemeHeader function to include headDeployStatus alongside isDevMode,
setThemeHistories, onPublishTheme, etc., and then replace any remaining usages
of props.headDeployStatus (e.g., where headDeployStatus is referenced at the
current call sites) with the newly destructured headDeployStatus variable to
keep prop access consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/visual-editor/locales/platform/et/visual-editor.json`:
- Around line 553-554: Update the Estonian translations for the publish-blocked
keys: change "deploymentFailed" to a fully Estonian sentence (e.g., "Avaldamine
on keelatud, sest viimane juurutus nurjus. Parandage probleemid ja proovige
uuesti") instead of the mixed-language text, and populate the empty
"deploymentInactive" key with an appropriate Estonian message (e.g., "Avaldamine
on keelatud, sest viimane juurutus on inaktiivne"). Make these edits for the
keys "deploymentFailed" and "deploymentInactive" in the visual-editor.json
locale file.

In `@packages/visual-editor/locales/platform/lt/visual-editor.json`:
- Around line 563-565: The three localized keys deploymentFailed,
deploymentInactive and deploymentInProgress are inconsistent:
deploymentInProgress uses “Atnaujinimas išjungtas…” while the others use
“Paskelbimas išjungtas…”. Update the value for deploymentInProgress to use the
same “Paskelbimas išjungtas…” phrasing so all publishBlocked messages are
uniform, keeping the rest of the sentence identical to the current translation
style.

In `@packages/visual-editor/locales/platform/sv/visual-editor.json`:
- Around line 553-555: The Swedish strings are inconsistent: "deploymentFailed"
uses "implementeringen" while "deploymentInactive" and "deploymentInProgress"
use "distributionen"; update the "deploymentFailed" value to match the others
(use "distributionen") so all three keys—deploymentFailed, deploymentInactive,
deploymentInProgress—use the same term for deployment for consistency in the UI.

---

Nitpick comments:
In `@packages/visual-editor/src/internal/puck/components/ThemeHeader.tsx`:
- Around line 39-52: The component ThemeHeader currently reads
props.headDeployStatus directly while all other props are destructured; update
the destructuring in the ThemeHeader function to include headDeployStatus
alongside isDevMode, setThemeHistories, onPublishTheme, etc., and then replace
any remaining usages of props.headDeployStatus (e.g., where headDeployStatus is
referenced at the current call sites) with the newly destructured
headDeployStatus variable to keep prop access consistent.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dec9f1c and 7388847.

📒 Files selected for processing (30)
  • packages/visual-editor/locales/platform/cs/visual-editor.json
  • packages/visual-editor/locales/platform/da/visual-editor.json
  • packages/visual-editor/locales/platform/de/visual-editor.json
  • packages/visual-editor/locales/platform/en-GB/visual-editor.json
  • packages/visual-editor/locales/platform/en/visual-editor.json
  • packages/visual-editor/locales/platform/es/visual-editor.json
  • packages/visual-editor/locales/platform/et/visual-editor.json
  • packages/visual-editor/locales/platform/fi/visual-editor.json
  • packages/visual-editor/locales/platform/fr/visual-editor.json
  • packages/visual-editor/locales/platform/hr/visual-editor.json
  • packages/visual-editor/locales/platform/hu/visual-editor.json
  • packages/visual-editor/locales/platform/it/visual-editor.json
  • packages/visual-editor/locales/platform/ja/visual-editor.json
  • packages/visual-editor/locales/platform/lt/visual-editor.json
  • packages/visual-editor/locales/platform/lv/visual-editor.json
  • packages/visual-editor/locales/platform/nb/visual-editor.json
  • packages/visual-editor/locales/platform/nl/visual-editor.json
  • packages/visual-editor/locales/platform/pl/visual-editor.json
  • packages/visual-editor/locales/platform/pt/visual-editor.json
  • packages/visual-editor/locales/platform/ro/visual-editor.json
  • packages/visual-editor/locales/platform/sk/visual-editor.json
  • packages/visual-editor/locales/platform/sv/visual-editor.json
  • packages/visual-editor/locales/platform/tr/visual-editor.json
  • packages/visual-editor/locales/platform/zh-TW/visual-editor.json
  • packages/visual-editor/locales/platform/zh/visual-editor.json
  • packages/visual-editor/src/internal/components/InternalThemeEditor.tsx
  • packages/visual-editor/src/internal/puck/components/LayoutHeader.tsx
  • packages/visual-editor/src/internal/puck/components/ThemeHeader.tsx
  • packages/visual-editor/src/internal/types/templateMetadata.ts
  • packages/visual-editor/src/internal/utils/getPublishTooltipMessageFromHeadDeployStatus.ts

Copy link
Collaborator

@mkilpatrick mkilpatrick left a comment

Choose a reason for hiding this comment

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

translation issues

@jwartofsky-yext jwartofsky-yext merged commit a980cfc into main Feb 26, 2026
16 checks passed
@jwartofsky-yext jwartofsky-yext deleted the handleHeadDeployState branch February 26, 2026 21:12
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.

3 participants