Give MultiSelect chips accessible names and start creation fields empty.
Catalog chips now announce Select or Deselect so they are named for assistive tech. Method and value modals open blank; Generate draft inserts the catalog copy that used to be prefilled, and Customize still keeps the section headings. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
fd9f82ea19
commit
20ea4a2f30
35 files changed
+498
-156
No files matched your search
@@ -89,46 +89,6 @@ function clampPercent(n: number): number {
|
||||
return Math.min(100, Math.max(1, Math.round(n)));
|
||||
}
|
||||
|
||||
function facetPrefillHasContent(prefill: MethodCardWizardFacetPrefill): boolean {
|
||||
switch (prefill.group) {
|
||||
case "communication":
|
||||
return (
|
||||
hasTrimmedText(prefill.draft.corePrinciple) ||
|
||||
hasTrimmedText(prefill.draft.logisticsAdmin) ||
|
||||
hasTrimmedText(prefill.draft.codeOfConduct)
|
||||
);
|
||||
case "membership":
|
||||
return (
|
||||
hasTrimmedText(prefill.draft.eligibility) ||
|
||||
hasTrimmedText(prefill.draft.joiningProcess) ||
|
||||
hasTrimmedText(prefill.draft.expectations)
|
||||
);
|
||||
case "decisionApproaches":
|
||||
return (
|
||||
hasTrimmedText(prefill.draft.corePrinciple) ||
|
||||
hasTrimmedText(prefill.draft.stepByStepInstructions) ||
|
||||
hasTrimmedText(prefill.draft.objectionsDeadlocks) ||
|
||||
prefill.draft.applicableScope.length > 0 ||
|
||||
prefill.draft.selectedApplicableScope.length > 0
|
||||
);
|
||||
case "conflictManagement":
|
||||
return (
|
||||
hasTrimmedText(prefill.draft.corePrinciple) ||
|
||||
hasTrimmedText(prefill.draft.processProtocol) ||
|
||||
hasTrimmedText(prefill.draft.restorationFallbacks) ||
|
||||
formatConflictApplicableScopeForTextarea(
|
||||
prefill.draft.selectedApplicableScope,
|
||||
prefill.draft.applicableScope,
|
||||
).trim().length > 0
|
||||
);
|
||||
case "coreValues":
|
||||
return (
|
||||
hasTrimmedText(prefill.draft.meaning) ||
|
||||
hasTrimmedText(prefill.draft.signals)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function mapFacetPrefillToWizardFieldBlocks(
|
||||
prefill: MethodCardWizardFacetPrefill,
|
||||
): CustomMethodCardFieldBlock[] {
|
||||
@@ -198,7 +158,11 @@ function mapFacetPrefillToWizardFieldBlocks(
|
||||
);
|
||||
if (
|
||||
typeof prefill.draft.consensusLevel === "number" &&
|
||||
facetPrefillHasContent(prefill)
|
||||
(hasTrimmedText(prefill.draft.corePrinciple) ||
|
||||
hasTrimmedText(prefill.draft.stepByStepInstructions) ||
|
||||
hasTrimmedText(prefill.draft.objectionsDeadlocks) ||
|
||||
prefill.draft.applicableScope.length > 0 ||
|
||||
prefill.draft.selectedApplicableScope.length > 0)
|
||||
) {
|
||||
blocks.push({
|
||||
kind: "proportion",
|
||||
@@ -260,14 +224,12 @@ function mapFacetPrefillToWizardFieldBlocks(
|
||||
|
||||
/**
|
||||
* Map a method card's facet editors onto wizard field blocks so Customize
|
||||
* can show and edit the same sections on step 3.
|
||||
* can show and edit the same sections on step 3. Empty copy still yields
|
||||
* the catalog headings so authors can fill them in the wizard.
|
||||
*/
|
||||
export function facetDetailsToWizardFieldBlocks(
|
||||
prefill: MethodCardWizardFacetPrefill,
|
||||
): CustomMethodCardFieldBlock[] {
|
||||
if (!facetPrefillHasContent(prefill)) {
|
||||
return [];
|
||||
}
|
||||
return mapFacetPrefillToWizardFieldBlocks(prefill);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user