diff --git a/designs/aaron/i18n/en.json b/designs/aaron/i18n/en.json
index ac6fdfa0f7e..1d4412dee90 100644
--- a/designs/aaron/i18n/en.json
+++ b/designs/aaron/i18n/en.json
@@ -6,8 +6,10 @@
"neckBinding": "Neck opening knit binding"
},
"s": {
- "cutArmBinding": "Not shown: the **Arm opening knit binding**, two strips of fabric {{{ width }}} wide and {{{ length }}} long (this includes seam allowance)",
- "cutNeckBinding": "Not shown: the **Neck opening knit binding**, a strip of fabric {{{ width }}} wide and {{{ length }}} long (this includes seam allowance)",
+ "cutArmBinding.t": "The arm opening knit binding is not currently shown",
+ "cutArmBinding.d": "The **Arm opening knit binding** are two strips of fabric {{{ width }}} wide and {{{ length }}} long (this includes seam allowance). They are not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part.",
+ "cutNeckBinding.t": "The neck opening knit binding is not currently shown",
+ "cutNeckBinding.d": "The **Neck opening knit binding** is a strip of fabric {{{ width }}} wide and {{{ length }}} long (this includes seam allowance). It is not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part.",
"cutOneStripToFinishTheNeckOpening": "Cut one strip to finish the neck opening",
"cutTwoStripsToFinishTheArmholes": "Cut two strips to finish the armholes",
"length": "Length",
diff --git a/designs/aaron/src/arm-binding.mjs b/designs/aaron/src/arm-binding.mjs
index eb182eb521d..28878694f67 100644
--- a/designs/aaron/src/arm-binding.mjs
+++ b/designs/aaron/src/arm-binding.mjs
@@ -23,7 +23,8 @@ export const armBinding = {
if (!expand) {
// Expand is on, do not draw the part but flag this to the user
store.flag.note({
- msg: `aaron:cutArmBinding`,
+ title: `aaron:cutArmBinding.t`,
+ desc: `aaron:cutArmBinding.d`,
replace: {
width: units(w),
length: units(l),
diff --git a/designs/aaron/src/neck-binding.mjs b/designs/aaron/src/neck-binding.mjs
index fecc47fb20e..ee1a1f1c8ea 100644
--- a/designs/aaron/src/neck-binding.mjs
+++ b/designs/aaron/src/neck-binding.mjs
@@ -23,7 +23,8 @@ export const neckBinding = {
if (!expand) {
// Expand is on, do not draw the part but flag this to the user
store.flag.note({
- msg: `aaron:cutNeckBinding`,
+ title: `aaron:cutNeckBinding.t`,
+ desc: `aaron:cutNeckBinding.d`,
replace: {
width: units(w),
length: units(l),
diff --git a/designs/albert/i18n/en.json b/designs/albert/i18n/en.json
index 4178a4f476c..9f6be980179 100644
--- a/designs/albert/i18n/en.json
+++ b/designs/albert/i18n/en.json
@@ -8,8 +8,10 @@
},
"s": {
"attachStrap": "Attach strap",
- "cutPocket": "Not shown: the **Pocket**, a rectangle of {{{ width }}} wide and {{{ length }}} long (this includes seam allowance)",
- "cutStrap": "Not shown: the **Straps**, two rectangles of {{{ width }}} wide and {{{ length }}} long (this includes seam allowance)",
+ "cutPocket.t": "The pocket is not currently shown",
+ "cutPocket.d": "The **Pocket** is a rectangular piece of fabric {{{ width }}} wide and {{{ length }}} long (this includes seam allowance). It is not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part.",
+ "cutStrap.t": "The straps are not currently shown",
+ "cutStrap.d": "The **Straps** are two strips of fabric {{{ width }}} wide and {{{ length }}} long (this includes seam allowance). They are not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part.",
"foldHere": "Fold here"
},
"o": {
diff --git a/designs/albert/src/pocket.mjs b/designs/albert/src/pocket.mjs
index 15764f4461a..78072c72d49 100644
--- a/designs/albert/src/pocket.mjs
+++ b/designs/albert/src/pocket.mjs
@@ -22,7 +22,8 @@ export const pocket = {
if (!expand) {
// Expand is on, do not draw the part but flag this to the user
store.flag.note({
- msg: `albert:cutPocket`,
+ title: `albert:cutPocket.t`,
+ desc: `albert:cutPocket.d`,
replace: {
width: units(pocketSize * 2 + 2 * sa),
length: units(pocketSize + 2 * sa + store.get('strapWidth')),
diff --git a/designs/albert/src/strap.mjs b/designs/albert/src/strap.mjs
index cbb0bff914c..defcb2f4de8 100644
--- a/designs/albert/src/strap.mjs
+++ b/designs/albert/src/strap.mjs
@@ -41,10 +41,11 @@ export const strap = {
if (!expand) {
// Expand is on, do not draw the part but flag this to the user
store.flag.note({
- msg: `albert:cutStrap`,
+ title: `albert:cutStrap.t`,
+ desc: `albert:cutStrap.d`,
replace: {
- width: units(store.get('strapWidth') + 2 * sa),
- length: units(store.get('strapLength') + store.get('strapWidth') * 2 + 2 * sa),
+ width: units(strapWidth + 2 * sa),
+ length: units(strapLength + strapWidth * 2 + 2 * sa),
},
suggest: {
text: 'flag:show',
diff --git a/plugins/plugin-annotations/src/flag.mjs b/plugins/plugin-annotations/src/flag.mjs
index 3f87691b9e3..c5138e9560a 100644
--- a/plugins/plugin-annotations/src/flag.mjs
+++ b/plugins/plugin-annotations/src/flag.mjs
@@ -34,13 +34,13 @@ function flag(type, store, data) {
type = data.type
}
- if (!data.id && !data.msg) {
- store.log.warning(`store.flag.${type} called without an id or msg property`)
+ if (!data.id && !data.title) {
+ store.log.warn(`store.flag.${type} called without an id or title property`)
console.log(data)
return
}
- store.set([...storeRoot, type, data.id ? data.id : data.msg], data)
+ store.set([...storeRoot, type, data.id ? data.id : data.title], data)
}
/*
@@ -53,7 +53,7 @@ function flag(type, store, data) {
function unflag(type, store, id) {
if (type === 'preset' && presets[id]) {
type = presets[id].type
- id = presets[id].id || presets[id].msg
+ id = presets[id].id || presets[id].title
}
store.unset([...storeRoot, type, id])
}
@@ -64,7 +64,8 @@ function unflag(type, store, id) {
const presets = {
expand: {
type: 'tip',
- msg: 'flag:expandIsOff',
+ title: 'flag:expandIsOff.t',
+ desc: 'flag:expandIsOff.d',
suggest: {
text: 'flag:enable',
icon: 'expand',
diff --git a/sites/shared/components/accordion.mjs b/sites/shared/components/accordion.mjs
index b0e0dd9d644..25ccfad7b4d 100644
--- a/sites/shared/components/accordion.mjs
+++ b/sites/shared/components/accordion.mjs
@@ -26,22 +26,25 @@ const BaseAccordion = ({
}) => {
const [active, setActive] = useState()
+ console.log(items)
return (
)
}
diff --git a/sites/shared/components/icons.mjs b/sites/shared/components/icons.mjs
index 572f8d5d562..f770fc26893 100644
--- a/sites/shared/components/icons.mjs
+++ b/sites/shared/components/icons.mjs
@@ -318,6 +318,12 @@ export const FingerprintIcon = (props) => (
)
+export const FlagIcon = (props) => (
+
+
+
+)
+
export const FreeSewingIcon = (props) => (
diff --git a/sites/shared/components/workbench/views/draft/index.mjs b/sites/shared/components/workbench/views/draft/index.mjs
index 34de1fd3fb3..18521fa3a29 100644
--- a/sites/shared/components/workbench/views/draft/index.mjs
+++ b/sites/shared/components/workbench/views/draft/index.mjs
@@ -49,7 +49,6 @@ export const DraftView = ({
pattern: output,
setSettings,
Header: DraftHeader,
- flags: pattern.setStores?.[0]?.plugins?.['plugin-annotations']?.flags,
menu: (
),
diff --git a/sites/shared/components/workbench/views/draft/menu.mjs b/sites/shared/components/workbench/views/draft/menu.mjs
index 792b42c7db0..2f0a146e2cd 100644
--- a/sites/shared/components/workbench/views/draft/menu.mjs
+++ b/sites/shared/components/workbench/views/draft/menu.mjs
@@ -9,8 +9,12 @@ import {
import { UiSettings, ns as uiNs } from 'shared/components/workbench/menus/ui-settings/index.mjs'
import { useTranslation } from 'next-i18next'
import { nsMerge } from 'shared/utils.mjs'
-import { SettingsIcon, OptionsIcon, DesktopIcon } from 'shared/components/icons.mjs'
+import { SettingsIcon, OptionsIcon, DesktopIcon, FlagIcon } from 'shared/components/icons.mjs'
import { Accordion } from 'shared/components/accordion.mjs'
+import {
+ FlagsAccordionTitle,
+ FlagsAccordionEntries,
+} from 'shared/components/workbench/views/flags.mjs'
export const ns = nsMerge(coreMenuNs, designMenuNs, uiNs)
@@ -26,6 +30,7 @@ export const DraftMenu = ({
DynamicDocs,
view,
setView,
+ flags = false,
}) => {
const { t } = useTranslation()
const control = account.control
@@ -61,18 +66,24 @@ export const DraftMenu = ({
},
]
- return (
- [
- <>
-
,
+ ,
+ ]
+ })}
+ />
+ )
+}
diff --git a/sites/shared/i18n/flag/en.yaml b/sites/shared/i18n/flag/en.yaml
index cbb20a3c813..377e6f67bd8 100644
--- a/sites/shared/i18n/flag/en.yaml
+++ b/sites/shared/i18n/flag/en.yaml
@@ -1,5 +1,9 @@
dismiss: Dismiss
-expandIsOff: The **expand** core setting is disabled. Some parts are not fully drawn. Enable it to see them.
+expandIsOff.t: This design saves space (and trees) because expand is disabled
+expandIsOff.d: Because the **expand** core setting is currently disabled, some parts are not fully drawn or not shown at all. Typically, these are simple rectangles that only take up space. To expand all pattern parts to their full size, enable the expand setting.
enable: Enable
+flagMenu.t: Messages from the designer
+flagMenuOne.d: The designer of this pattern has flagged something about your current draft that deserves your attention.
+flagMenuMany.d: The designer of this pattern has flagged some things about your current draft that deserve your attention.
hide: Hide
show: Show