Skip to content

Comments

mounts for translations forms#6239

Draft
lkostrowski wants to merge 1 commit intomainfrom
translations-mounts
Draft

mounts for translations forms#6239
lkostrowski wants to merge 1 commit intomainfrom
translations-mounts

Conversation

@lkostrowski
Copy link
Member

Scope of the change

  • I confirm I added ripples for changes (see src/ripples) or my feature doesn't contain any user-facing changes
  • I used analytics "trackEvent" for important events

Copilot AI review requested due to automatic review settings December 19, 2025 11:44
@changeset-bot
Copy link

changeset-bot bot commented Dec 19, 2025

⚠️ No Changeset found

Latest commit: e9c25b3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

Differences Found

✅ No packages or licenses were added.

Summary

Expand
License Name Package Count Packages
0BSD 1
Packages
  • tslib
CC0-1.0 1
Packages
  • type-fest
MIT/X11 1
Packages
  • nub
MPL-1.1 1
Packages
  • harmony-reflect
MPL-2.0 1
Packages
  • dompurify
Public Domain 1
Packages
  • jsonify
Python-2.0 1
Packages
  • argparse
WTFPL 1
Packages
  • utf8-byte-length
<<missing>> 2
Packages
  • busboy
  • streamsearch
CC-BY-4.0 2
Packages
  • @saleor/macaw-ui
  • caniuse-lite
SEE LICENSE IN LICENSE 2
Packages
  • posthog-js
  • spawndamnit
BlueOak-1.0.0 4
Packages
  • glob
  • lru-cache
  • minimatch
  • path-scurry
BSD-2-Clause 23
Packages
  • browser-process-hrtime
  • css-select
  • css-what
  • domelementtype
  • domhandler
  • domutils
  • dotenv
  • dotenv-expand
  • entities
  • escodegen
  • eslint-scope
  • espree
  • esprima
  • esrecurse
  • estraverse
  • esutils
  • nth-check
  • regjsparser
  • stringify-object
  • terser
  • And 3 more...
BSD-3-Clause 42
Packages
  • @saleor/app-sdk
  • @sentry/cli
  • @sentry/cli-darwin
  • @sentry/cli-linux-arm
  • @sentry/cli-linux-arm64
  • @sentry/cli-linux-i686
  • @sentry/cli-linux-x64
  • @sentry/cli-win32-arm64
  • @sentry/cli-win32-i686
  • @sentry/cli-win32-x64
  • @sinonjs/commons
  • @sinonjs/fake-timers
  • abab
  • asn1js
  • babel-plugin-istanbul
  • chroma-js
  • dataloader
  • diff
  • esquery
  • exenv
  • And 22 more...
ISC 47
Packages
  • @istanbuljs/load-nyc-config
  • anymatch
  • boolbase
  • cli-width
  • cliui
  • electron-to-chromium
  • fastq
  • flatted
  • fs.realpath
  • get-caller-file
  • get-own-enumerable-property-symbols
  • glob
  • glob-parent
  • graceful-fs
  • inflight
  • inherits
  • ini
  • isexe
  • knip
  • lru-cache
  • And 27 more...
Apache-2.0 54
Packages
  • @editorjs/editorjs
  • @eslint/config-array
  • @eslint/config-helpers
  • @eslint/core
  • @eslint/object-schema
  • @eslint/plugin-kit
  • @humanfs/core
  • @humanfs/node
  • @humanwhocodes/module-importer
  • @humanwhocodes/retry
  • @opentelemetry/api
  • @opentelemetry/semantic-conventions
  • @playwright/test
  • @pollyjs/adapter
  • @pollyjs/core
  • @pollyjs/persister
  • @pollyjs/utils
  • @swc/core
  • @swc/core-darwin-arm64
  • @swc/core-darwin-x64
  • And 34 more...
MIT 1293
Packages
  • @adobe/css-tools
  • @apollo/client
  • @ardatan/relay-compiler
  • @ardatan/sync-fetch
  • @babel/code-frame
  • @babel/compat-data
  • @babel/core
  • @babel/generator
  • @babel/helper-annotate-as-pure
  • @babel/helper-compilation-targets
  • @babel/helper-create-class-features-plugin
  • @babel/helper-globals
  • @babel/helper-member-expression-to-functions
  • @babel/helper-module-imports
  • @babel/helper-module-transforms
  • @babel/helper-optimise-call-expression
  • @babel/helper-plugin-utils
  • @babel/helper-replace-supers
  • @babel/helper-skip-transparent-expression-wrappers
  • @babel/helper-string-parser
  • And 1273 more...

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds app extension form mount support for the category translations page, enabling external apps to interact with translation form data through the app extension framework.

  • Adds form state emission to the category translation page using the app extension context
  • Updates the @saleor/app-sdk package to a pre-release version to support new form payload types
  • Implements data flow from the translation form to mounted app extensions

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 8 comments.

File Description
src/translations/components/TranslationsCategoriesPage/TranslationsCategoriesPage.tsx Adds useEffect hook to emit category translation form data to app extensions, including field values for category name, description, and SEO fields
package.json Updates @saleor/app-sdk to pre-release version 0.0.0-pr-20251218133314

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +71 to +92
currentValue: "todo",
originalValue: data.category.name,
},
categoryDescription: {
type: "editorjs",
fieldName: "categoryDescription",
translatedValue: data.translation.description,
currentValue: "todo",
originalValue: data.category.description,
},
seoName: {
type: "short-text",
fieldName: "seoName",
translatedValue: data.translation.seoTitle,
currentValue: "todo",
originalValue: data.category.seoTitle,
},
seoDescription: {
type: "short-text",
fieldName: "seoDescription",
translatedValue: data.translation.seoDescription,
currentValue: "todo",
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The currentValue is hardcoded as "todo" which is a placeholder. This should contain the actual current value of the field being edited, similar to how the TranslationsProductsPage uses cachedProductSeoName and other cached values to track changes.

Suggested change
currentValue: "todo",
originalValue: data.category.name,
},
categoryDescription: {
type: "editorjs",
fieldName: "categoryDescription",
translatedValue: data.translation.description,
currentValue: "todo",
originalValue: data.category.description,
},
seoName: {
type: "short-text",
fieldName: "seoName",
translatedValue: data.translation.seoTitle,
currentValue: "todo",
originalValue: data.category.seoTitle,
},
seoDescription: {
type: "short-text",
fieldName: "seoDescription",
translatedValue: data.translation.seoDescription,
currentValue: "todo",
currentValue: data.translation.name,
originalValue: data.category.name,
},
categoryDescription: {
type: "editorjs",
fieldName: "categoryDescription",
translatedValue: data.translation.description,
currentValue: data.translation.description,
originalValue: data.category.description,
},
seoName: {
type: "short-text",
fieldName: "seoName",
translatedValue: data.translation.seoTitle,
currentValue: data.translation.seoTitle,
originalValue: data.category.seoTitle,
},
seoDescription: {
type: "short-text",
fieldName: "seoDescription",
translatedValue: data.translation.seoDescription,
currentValue: data.translation.seoDescription,

Copilot uses AI. Check for mistakes.
Comment on lines +71 to +92
currentValue: "todo",
originalValue: data.category.name,
},
categoryDescription: {
type: "editorjs",
fieldName: "categoryDescription",
translatedValue: data.translation.description,
currentValue: "todo",
originalValue: data.category.description,
},
seoName: {
type: "short-text",
fieldName: "seoName",
translatedValue: data.translation.seoTitle,
currentValue: "todo",
originalValue: data.category.seoTitle,
},
seoDescription: {
type: "short-text",
fieldName: "seoDescription",
translatedValue: data.translation.seoDescription,
currentValue: "todo",
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The currentValue is hardcoded as "todo" which is a placeholder. This should contain the actual current value of the field being edited, similar to how the TranslationsProductsPage uses cachedProductSeoDescription and other cached values to track changes.

Suggested change
currentValue: "todo",
originalValue: data.category.name,
},
categoryDescription: {
type: "editorjs",
fieldName: "categoryDescription",
translatedValue: data.translation.description,
currentValue: "todo",
originalValue: data.category.description,
},
seoName: {
type: "short-text",
fieldName: "seoName",
translatedValue: data.translation.seoTitle,
currentValue: "todo",
originalValue: data.category.seoTitle,
},
seoDescription: {
type: "short-text",
fieldName: "seoDescription",
translatedValue: data.translation.seoDescription,
currentValue: "todo",
currentValue: data.translation?.name,
originalValue: data.category.name,
},
categoryDescription: {
type: "editorjs",
fieldName: "categoryDescription",
translatedValue: data.translation.description,
currentValue: data.translation?.description,
originalValue: data.category.description,
},
seoName: {
type: "short-text",
fieldName: "seoName",
translatedValue: data.translation.seoTitle,
currentValue: data.translation?.seoTitle,
originalValue: data.category.seoTitle,
},
seoDescription: {
type: "short-text",
fieldName: "seoDescription",
translatedValue: data.translation.seoDescription,
currentValue: data.translation?.seoDescription,

Copilot uses AI. Check for mistakes.
}),
);
}
}, [active, data?.category, data?.category?.id]);
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The useEffect dependency array is incomplete. It should include languageCode, data?.translation, attachFormState, and the individual data fields being accessed (data.translation.name, data.translation.description, etc.) since these values are used within the effect. Currently, changes to these values won't trigger the effect to re-run as expected.

Suggested change
}, [active, data?.category, data?.category?.id]);
}, [
active,
attachFormState,
languageCode,
data?.category?.id,
data?.category?.name,
data?.category?.description,
data?.category?.seoTitle,
data?.category?.seoDescription,
data?.translation?.name,
data?.translation?.description,
data?.translation?.seoTitle,
data?.translation?.seoDescription,
]);

Copilot uses AI. Check for mistakes.
"@graphql-eslint/eslint-plugin": "^4.4.0",
"@playwright/test": "1.56.1",
"@saleor/app-sdk": "1.5.0",
"@saleor/app-sdk": "0.0.0-pr-20251218133314",
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The version "0.0.0-pr-20251218133314" appears to be a pre-release or PR-specific version. This should not be committed to the main branch and should instead use a stable, published version of the package.

Suggested change
"@saleor/app-sdk": "0.0.0-pr-20251218133314",
"@saleor/app-sdk": "^0.61.0",

Copilot uses AI. Check for mistakes.
languageEntityUrl,
TranslatableEntities,
} from "@dashboard/translations/urls";
import { DashboardEventFactory } from "@saleor/app-sdk/app-bridge";
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

This import is unnecessary since attachFormState should receive the payload directly without wrapping it in DashboardEventFactory.createFormEvent. The createFormEvent transformation is handled internally by the framework.

Copilot uses AI. Check for mistakes.
Comment on lines +71 to +92
currentValue: "todo",
originalValue: data.category.name,
},
categoryDescription: {
type: "editorjs",
fieldName: "categoryDescription",
translatedValue: data.translation.description,
currentValue: "todo",
originalValue: data.category.description,
},
seoName: {
type: "short-text",
fieldName: "seoName",
translatedValue: data.translation.seoTitle,
currentValue: "todo",
originalValue: data.category.seoTitle,
},
seoDescription: {
type: "short-text",
fieldName: "seoDescription",
translatedValue: data.translation.seoDescription,
currentValue: "todo",
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The currentValue is hardcoded as "todo" which is a placeholder. This should contain the actual current value of the field being edited, similar to how the TranslationsProductsPage uses cachedProductName and other cached values to track changes.

Suggested change
currentValue: "todo",
originalValue: data.category.name,
},
categoryDescription: {
type: "editorjs",
fieldName: "categoryDescription",
translatedValue: data.translation.description,
currentValue: "todo",
originalValue: data.category.description,
},
seoName: {
type: "short-text",
fieldName: "seoName",
translatedValue: data.translation.seoTitle,
currentValue: "todo",
originalValue: data.category.seoTitle,
},
seoDescription: {
type: "short-text",
fieldName: "seoDescription",
translatedValue: data.translation.seoDescription,
currentValue: "todo",
currentValue: data.translation.name,
originalValue: data.category.name,
},
categoryDescription: {
type: "editorjs",
fieldName: "categoryDescription",
translatedValue: data.translation.description,
currentValue: data.translation.description,
originalValue: data.category.description,
},
seoName: {
type: "short-text",
fieldName: "seoName",
translatedValue: data.translation.seoTitle,
currentValue: data.translation.seoTitle,
originalValue: data.category.seoTitle,
},
seoDescription: {
type: "short-text",
fieldName: "seoDescription",
translatedValue: data.translation.seoDescription,
currentValue: data.translation.seoDescription,

Copilot uses AI. Check for mistakes.
Comment on lines +60 to +97
attachFormState(
// @ts-ignore - wtf with types
DashboardEventFactory.createFormEvent({
form: "category-translate",
categoryId: data.category.id,
translationLanguage: languageCode,
fields: {
categoryName: {
type: "short-text",
fieldName: "categoryName",
translatedValue: data.translation.name,
currentValue: "todo",
originalValue: data.category.name,
},
categoryDescription: {
type: "editorjs",
fieldName: "categoryDescription",
translatedValue: data.translation.description,
currentValue: "todo",
originalValue: data.category.description,
},
seoName: {
type: "short-text",
fieldName: "seoName",
translatedValue: data.translation.seoTitle,
currentValue: "todo",
originalValue: data.category.seoTitle,
},
seoDescription: {
type: "short-text",
fieldName: "seoDescription",
translatedValue: data.translation.seoDescription,
currentValue: "todo",
originalValue: data.category.seoDescription,
},
},
}),
);
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The DashboardEventFactory.createFormEvent is being used incorrectly. Based on the codebase patterns (ProductUpdatePage and TranslationsProductsPage), attachFormState should receive the payload directly without wrapping it in DashboardEventFactory.createFormEvent. The createFormEvent is applied internally by the hook when posting to the extension.

Copilot uses AI. Check for mistakes.
Comment on lines +71 to +92
currentValue: "todo",
originalValue: data.category.name,
},
categoryDescription: {
type: "editorjs",
fieldName: "categoryDescription",
translatedValue: data.translation.description,
currentValue: "todo",
originalValue: data.category.description,
},
seoName: {
type: "short-text",
fieldName: "seoName",
translatedValue: data.translation.seoTitle,
currentValue: "todo",
originalValue: data.category.seoTitle,
},
seoDescription: {
type: "short-text",
fieldName: "seoDescription",
translatedValue: data.translation.seoDescription,
currentValue: "todo",
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The currentValue is hardcoded as "todo" which is a placeholder. This should contain the actual current value of the field being edited, similar to how the TranslationsProductsPage uses cachedProductDescription and other cached values to track changes.

Suggested change
currentValue: "todo",
originalValue: data.category.name,
},
categoryDescription: {
type: "editorjs",
fieldName: "categoryDescription",
translatedValue: data.translation.description,
currentValue: "todo",
originalValue: data.category.description,
},
seoName: {
type: "short-text",
fieldName: "seoName",
translatedValue: data.translation.seoTitle,
currentValue: "todo",
originalValue: data.category.seoTitle,
},
seoDescription: {
type: "short-text",
fieldName: "seoDescription",
translatedValue: data.translation.seoDescription,
currentValue: "todo",
currentValue: data.translation.name,
originalValue: data.category.name,
},
categoryDescription: {
type: "editorjs",
fieldName: "categoryDescription",
translatedValue: data.translation.description,
currentValue: data.translation.description,
originalValue: data.category.description,
},
seoName: {
type: "short-text",
fieldName: "seoName",
translatedValue: data.translation.seoTitle,
currentValue: data.translation.seoTitle,
originalValue: data.category.seoTitle,
},
seoDescription: {
type: "short-text",
fieldName: "seoDescription",
translatedValue: data.translation.seoDescription,
currentValue: data.translation.seoDescription,

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.96%. Comparing base (f7ef997) to head (e9c25b3).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...tionsCategoriesPage/TranslationsCategoriesPage.tsx 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6239      +/-   ##
==========================================
- Coverage   40.97%   40.96%   -0.02%     
==========================================
  Files        2432     2432              
  Lines       40949    40961      +12     
  Branches     9409     9415       +6     
==========================================
  Hits        16779    16779              
- Misses      22932    22943      +11     
- Partials     1238     1239       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant