feat: disable Update Pages button while a deployment is in progress#1057
feat: disable Update Pages button while a deployment is in progress#1057jwartofsky-yext wants to merge 15 commits intomainfrom
Conversation
Disables the update pages button while a deployment is in progress.
There was a problem hiding this comment.
Pull request overview
This PR adds functionality to disable the "Update Pages" button when a deployment is in progress, preventing users from attempting updates during active deployments.
Changes:
- Added
deploymentInProgressboolean field to theTemplateMetadatatype - Updated
LayoutHeadercomponent to check deployment status and disable the publish button with an appropriate tooltip message - Added translations for the deployment-in-progress message across all 25 supported locales
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/visual-editor/src/internal/types/templateMetadata.ts | Added deploymentInProgress boolean field to TemplateMetadata type and its generator function |
| packages/visual-editor/src/internal/puck/components/LayoutHeader.tsx | Updated publish button logic to check deployment status, refactored tooltip/disabled logic to handle both error and deployment states |
| packages/visual-editor/locales/platform/*/visual-editor.json | Added publishBlocked.deploymentInProgress translation key for all 25 supported locales |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds a boolean Sequence Diagram(s)sequenceDiagram
participant User
participant UI as ThemeHeader / LayoutHeader
participant Metadata as TemplateMetadata (store)
participant I18n as Localization
User->>UI: hover or click "Update"/"Publish"
UI->>Metadata: read deploymentInProgress
alt deploymentInProgress == true
UI->>I18n: request publishBlocked.deploymentInProgress
I18n-->>UI: localized deployment-in-progress message
UI-->>User: disabled control + show tooltip message
else deploymentInProgress == false
UI->>UI: compute publishDisabled (histories/errors)
alt publishDisabled == true
UI->>I18n: request relevant publishError message
I18n-->>UI: localized error message
UI-->>User: disabled control + show tooltip
else
UI-->>User: enabled publish action
end
end
Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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/de/visual-editor.json`:
- Around line 552-554: Update the translation for the key
publishBlocked.deploymentInProgress so it explicitly references the "Seite
aktualisieren" action (e.g., "Die Aktion 'Seite aktualisieren' ist während der
Bereitstellung deaktiviert" or "Die Schaltfläche 'Seite aktualisieren' ist
während der Bereitstellung deaktiviert") to match the UI label; modify the value
for publishBlocked.deploymentInProgress in visual-editor.json accordingly.
In `@packages/visual-editor/locales/platform/et/visual-editor.json`:
- Around line 552-554: The key "publishBlocked"."deploymentInProgress" must be
updated to sentence case and plural to match UI copy: replace the current value
with a sentence-case plural string such as "Värskendused on juurutamise ajal
keelatud." and confirm with a native speaker/localization team; locate the
"publishBlocked" object and its "deploymentInProgress" property in the
visual-editor.json and apply this replacement.
In `@packages/visual-editor/locales/platform/lv/visual-editor.json`:
- Around line 557-559: The translation for publishBlocked.deploymentInProgress
uses the singular "atjauninājums" but should convey updates/publishing in
general; update the string value for the "publishBlocked" ->
"deploymentInProgress" key to use a plural or abstract form (e.g.,
"atjauninājumi ir atspējoti, kamēr notiek izvietošana" or "atjaunināšana ir
atspējota, kamēr notiek izvietošana") and confirm whether the first letter
should be capitalized depending on where the string is rendered in the UI.
In `@packages/visual-editor/locales/platform/nl/visual-editor.json`:
- Around line 552-554: The JSON string for publishBlocked.deploymentInProgress
uses lowercase and the word "implementatie"; change it to sentence case and use
the same term as the "Update Pages" button label (e.g., replace "update" with
the button's verb and "implementatie" with "uitrol" or the project's chosen
term) so the message reads like "Bijwerken is uitgeschakeld terwijl de uitrol
bezig is" or the equivalent that matches the existing button wording; update the
value for the "deploymentInProgress" key under "publishBlocked" accordingly.
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (27)
packages/visual-editor/locales/platform/cs/visual-editor.jsonpackages/visual-editor/locales/platform/da/visual-editor.jsonpackages/visual-editor/locales/platform/de/visual-editor.jsonpackages/visual-editor/locales/platform/en-GB/visual-editor.jsonpackages/visual-editor/locales/platform/en/visual-editor.jsonpackages/visual-editor/locales/platform/es/visual-editor.jsonpackages/visual-editor/locales/platform/et/visual-editor.jsonpackages/visual-editor/locales/platform/fi/visual-editor.jsonpackages/visual-editor/locales/platform/fr/visual-editor.jsonpackages/visual-editor/locales/platform/hr/visual-editor.jsonpackages/visual-editor/locales/platform/hu/visual-editor.jsonpackages/visual-editor/locales/platform/it/visual-editor.jsonpackages/visual-editor/locales/platform/ja/visual-editor.jsonpackages/visual-editor/locales/platform/lt/visual-editor.jsonpackages/visual-editor/locales/platform/lv/visual-editor.jsonpackages/visual-editor/locales/platform/nb/visual-editor.jsonpackages/visual-editor/locales/platform/nl/visual-editor.jsonpackages/visual-editor/locales/platform/pl/visual-editor.jsonpackages/visual-editor/locales/platform/pt/visual-editor.jsonpackages/visual-editor/locales/platform/ro/visual-editor.jsonpackages/visual-editor/locales/platform/sk/visual-editor.jsonpackages/visual-editor/locales/platform/sv/visual-editor.jsonpackages/visual-editor/locales/platform/tr/visual-editor.jsonpackages/visual-editor/locales/platform/zh-TW/visual-editor.jsonpackages/visual-editor/locales/platform/zh/visual-editor.jsonpackages/visual-editor/src/internal/puck/components/LayoutHeader.tsxpackages/visual-editor/src/internal/types/templateMetadata.ts
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 27 out of 27 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
packages/visual-editor/src/internal/puck/components/LayoutHeader.tsx:281
publishDisabledcan be true whenhistories.length === 1, butTooltipContentis only rendered whenpublishTooltipMessageis truthy. In thehistories.length === 1case this makes the wrapper<span>keyboard-focusable (tabIndex=0) and styled as disabled without providing any tooltip/explanation. Consider drivingtabIndex/disabled cursor styling from!!publishTooltipMessage(or adding a tooltip message for the no-changes state) so keyboard users don’t land on a focusable element with no feedback.
<span
tabIndex={publishDisabled ? 0 : -1}
className={publishDisabled ? "ve-cursor-not-allowed" : ""}
>
<Button
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/src/internal/puck/components/ThemeHeader.tsx`:
- Around line 207-235: The wrapper <span> around the Button needs accessibility
semantics when publishDisabled is true; update the element in ThemeHeader.tsx to
include role="button" and aria-disabled={publishDisabled} so assistive tech
knows it’s disabled, and correct the tabIndex logic so the span is focusable
only when it should be (use tabIndex={!publishDisabled ? 0 : -1}) or remove the
focusable span entirely and let <Button> handle focus; locate the span near the
TooltipTrigger and the onPublishTheme/Button code to apply these changes.
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/visual-editor/src/internal/components/InternalThemeEditor.tsxpackages/visual-editor/src/internal/puck/components/ThemeHeader.tsx
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 29 out of 29 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
packages/visual-editor/src/internal/puck/components/LayoutHeader.tsx:137
- The tooltip message prioritizes deployment status over validation errors. When both
deploymentInProgressis true andhasErrorsis true, users will only see the deployment message and won't be informed about validation errors. Consider showing both messages or prioritizing validation errors since users can address those immediately, whereas they must wait for deployment to complete. This could lead to confusion when deployment finishes but the button remains disabled due to unresolved validation errors.
const publishTooltipMessage = deploymentInProgress
? pt(
"publishBlocked.deploymentInProgress",
"update is disabled while deployment is in progress"
)
: hasErrors
? getPublishErrorMessage(errorSources, errorDetails)
: undefined;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
♻️ Duplicate comments (1)
packages/visual-editor/src/internal/puck/components/ThemeHeader.tsx (1)
207-235:⚠️ Potential issue | 🟡 MinorFocusable wrapper span still missing accessibility semantics.
When
publishDisabledistrue, keyboard focus lands on the<span>(the<Button>is unreachable), but the span carries no semantic role oraria-disabledsignal. Assistive technology users will encounter a focusable element with no announced purpose.♿ Suggested fix
<span tabIndex={publishDisabled ? 0 : -1} + role={publishDisabled ? "button" : undefined} + aria-disabled={publishDisabled || undefined} className={publishDisabled ? "ve-cursor-not-allowed" : ""} >🤖 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 207 - 235, The focusable wrapper <span> in ThemeHeader that becomes focusable when publishDisabled is true lacks accessibility semantics; update that span (inside ThemeHeader near the TooltipTrigger/Button block) to include role="button" and aria-disabled={publishDisabled} (and an appropriate aria-label if the button text isn't sufficient) so assistive tech recognizes it as a disabled control, keeping the existing tabIndex logic and visual classes (ve-cursor-not-allowed / ve-pointer-events-none).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@packages/visual-editor/src/internal/puck/components/ThemeHeader.tsx`:
- Around line 207-235: The focusable wrapper <span> in ThemeHeader that becomes
focusable when publishDisabled is true lacks accessibility semantics; update
that span (inside ThemeHeader near the TooltipTrigger/Button block) to include
role="button" and aria-disabled={publishDisabled} (and an appropriate aria-label
if the button text isn't sufficient) so assistive tech recognizes it as a
disabled control, keeping the existing tabIndex logic and visual classes
(ve-cursor-not-allowed / ve-pointer-events-none).
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (27)
packages/visual-editor/locales/platform/cs/visual-editor.jsonpackages/visual-editor/locales/platform/da/visual-editor.jsonpackages/visual-editor/locales/platform/de/visual-editor.jsonpackages/visual-editor/locales/platform/en-GB/visual-editor.jsonpackages/visual-editor/locales/platform/en/visual-editor.jsonpackages/visual-editor/locales/platform/es/visual-editor.jsonpackages/visual-editor/locales/platform/et/visual-editor.jsonpackages/visual-editor/locales/platform/fi/visual-editor.jsonpackages/visual-editor/locales/platform/fr/visual-editor.jsonpackages/visual-editor/locales/platform/hr/visual-editor.jsonpackages/visual-editor/locales/platform/hu/visual-editor.jsonpackages/visual-editor/locales/platform/it/visual-editor.jsonpackages/visual-editor/locales/platform/ja/visual-editor.jsonpackages/visual-editor/locales/platform/lt/visual-editor.jsonpackages/visual-editor/locales/platform/lv/visual-editor.jsonpackages/visual-editor/locales/platform/nb/visual-editor.jsonpackages/visual-editor/locales/platform/nl/visual-editor.jsonpackages/visual-editor/locales/platform/pl/visual-editor.jsonpackages/visual-editor/locales/platform/pt/visual-editor.jsonpackages/visual-editor/locales/platform/ro/visual-editor.jsonpackages/visual-editor/locales/platform/sk/visual-editor.jsonpackages/visual-editor/locales/platform/sv/visual-editor.jsonpackages/visual-editor/locales/platform/tr/visual-editor.jsonpackages/visual-editor/locales/platform/zh-TW/visual-editor.jsonpackages/visual-editor/locales/platform/zh/visual-editor.jsonpackages/visual-editor/src/internal/puck/components/LayoutHeader.tsxpackages/visual-editor/src/internal/puck/components/ThemeHeader.tsx
🚧 Files skipped from review as they are similar to previous changes (17)
- packages/visual-editor/locales/platform/hu/visual-editor.json
- packages/visual-editor/locales/platform/pl/visual-editor.json
- packages/visual-editor/locales/platform/it/visual-editor.json
- packages/visual-editor/locales/platform/pt/visual-editor.json
- packages/visual-editor/locales/platform/lv/visual-editor.json
- packages/visual-editor/locales/platform/sk/visual-editor.json
- packages/visual-editor/locales/platform/tr/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/es/visual-editor.json
- packages/visual-editor/locales/platform/ro/visual-editor.json
- packages/visual-editor/locales/platform/ja/visual-editor.json
- packages/visual-editor/locales/platform/da/visual-editor.json
- packages/visual-editor/locales/platform/en-GB/visual-editor.json
- packages/visual-editor/locales/platform/sv/visual-editor.json
- packages/visual-editor/locales/platform/lt/visual-editor.json
- packages/visual-editor/src/internal/puck/components/LayoutHeader.tsx
|
Can you add a screenshot of the button/message and resolve/address all comments |
packages/visual-editor/src/internal/puck/components/LayoutHeader.tsx
Outdated
Show resolved
Hide resolved
This reverts commit 57ec912.
There was a problem hiding this comment.
♻️ Duplicate comments (1)
packages/visual-editor/locales/platform/lv/visual-editor.json (1)
557-563:⚠️ Potential issue | 🟡 MinorConsider using a plural/abstract form for “updates” in Latvian.
Line 558 uses singular Atjauninājums; the UI intent is that updates/publishing are generally disabled.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/visual-editor/locales/platform/lv/visual-editor.json` around lines 557 - 563, The Latvian string for publishBlocked.deploymentInProgress uses the singular "Atjauninājums"; replace it with a plural/abstract form to match the UI intent (updates/publishing generally disabled). Locate the JSON key "publishBlocked" -> "deploymentInProgress" and update its value from "Atjauninājums ir atspējots, kamēr notiek izvietošana" to a plural/abstract phrasing such as "Atjauninājumi ir atspējoti, kamēr notiek izvietošana" (or an equivalent Latvian plural/abstract translation).
🧹 Nitpick comments (1)
packages/visual-editor/src/internal/puck/components/LayoutHeader.tsx (1)
278-298: Optional: avoid a “dead” tab stop when there’s no tooltip text.When publish is disabled solely due to no changes,
publishTooltipMessageis undefined but the wrapper still becomes focusable. Consider gating the wrapper focus/role on the tooltip text so keyboard users don’t land on an inert control.💡 Possible tweak
- tabIndex={publishDisabled ? 0 : -1} + tabIndex={publishTooltipMessage ? 0 : -1} className={publishDisabled ? "ve-cursor-not-allowed" : ""} - role={publishDisabled ? "button" : undefined} + role={publishTooltipMessage ? "button" : undefined} aria-disabled={publishDisabled || undefined}🤖 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/LayoutHeader.tsx` around lines 278 - 298, The wrapper span currently becomes a focusable/inert control even when publishTooltipMessage is undefined; update the focus/role/aria attributes and styling in LayoutHeader (the span that wraps TooltipTrigger/Button) to only make it focusable and present a disabled role when there is actual tooltip text: change tabIndex, role, and aria-disabled (and any classes like "ve-cursor-not-allowed" / "ve-pointer-events-none") to be conditional on (publishTooltipMessage && publishDisabled) instead of only publishDisabled so keyboard users won’t land on a dead tab stop when there’s no tooltip to show.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@packages/visual-editor/locales/platform/lv/visual-editor.json`:
- Around line 557-563: The Latvian string for
publishBlocked.deploymentInProgress uses the singular "Atjauninājums"; replace
it with a plural/abstract form to match the UI intent (updates/publishing
generally disabled). Locate the JSON key "publishBlocked" ->
"deploymentInProgress" and update its value from "Atjauninājums ir atspējots,
kamēr notiek izvietošana" to a plural/abstract phrasing such as "Atjauninājumi
ir atspējoti, kamēr notiek izvietošana" (or an equivalent Latvian
plural/abstract translation).
---
Nitpick comments:
In `@packages/visual-editor/src/internal/puck/components/LayoutHeader.tsx`:
- Around line 278-298: The wrapper span currently becomes a focusable/inert
control even when publishTooltipMessage is undefined; update the focus/role/aria
attributes and styling in LayoutHeader (the span that wraps
TooltipTrigger/Button) to only make it focusable and present a disabled role
when there is actual tooltip text: change tabIndex, role, and aria-disabled (and
any classes like "ve-cursor-not-allowed" / "ve-pointer-events-none") to be
conditional on (publishTooltipMessage && publishDisabled) instead of only
publishDisabled so keyboard users won’t land on a dead tab stop when there’s no
tooltip to show.
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (24)
packages/visual-editor/locales/platform/cs/visual-editor.jsonpackages/visual-editor/locales/platform/da/visual-editor.jsonpackages/visual-editor/locales/platform/en-GB/visual-editor.jsonpackages/visual-editor/locales/platform/en/visual-editor.jsonpackages/visual-editor/locales/platform/es/visual-editor.jsonpackages/visual-editor/locales/platform/et/visual-editor.jsonpackages/visual-editor/locales/platform/fi/visual-editor.jsonpackages/visual-editor/locales/platform/fr/visual-editor.jsonpackages/visual-editor/locales/platform/hr/visual-editor.jsonpackages/visual-editor/locales/platform/hu/visual-editor.jsonpackages/visual-editor/locales/platform/it/visual-editor.jsonpackages/visual-editor/locales/platform/lt/visual-editor.jsonpackages/visual-editor/locales/platform/lv/visual-editor.jsonpackages/visual-editor/locales/platform/nb/visual-editor.jsonpackages/visual-editor/locales/platform/nl/visual-editor.jsonpackages/visual-editor/locales/platform/pl/visual-editor.jsonpackages/visual-editor/locales/platform/pt/visual-editor.jsonpackages/visual-editor/locales/platform/ro/visual-editor.jsonpackages/visual-editor/locales/platform/sk/visual-editor.jsonpackages/visual-editor/locales/platform/sv/visual-editor.jsonpackages/visual-editor/locales/platform/tr/visual-editor.jsonpackages/visual-editor/src/internal/puck/components/LayoutHeader.tsxpackages/visual-editor/src/internal/puck/components/ThemeHeader.tsxpackages/visual-editor/src/utils/publishErrors.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- packages/visual-editor/src/internal/puck/components/ThemeHeader.tsx
- packages/visual-editor/locales/platform/it/visual-editor.json
- packages/visual-editor/locales/platform/tr/visual-editor.json
- packages/visual-editor/locales/platform/fr/visual-editor.json
mkilpatrick
left a comment
There was a problem hiding this comment.
Tests, otherwise lgtm
Disables the update pages button while a deployment is in progress.