Let decision-approaches wrap at narrow widths and sync key-resource scopes.
The info-box checkboxes overflowed in a squeezed column; wrapping them and offering those scopes as chips on every approach keeps the sidebar and Applicable Scope selection in sync without publishing unchecked keys as defaults. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import type {
|
||||
} from "../../app/components/type/CommunityRule/CommunityRule.types";
|
||||
import type { PublishedMethodSelections } from "./buildPublishPayload";
|
||||
import type { CustomMethodCardFieldBlock } from "./customMethodCardFieldBlocks";
|
||||
import { decisionApproachScopeForPublish } from "./decisionApproachKeyResources";
|
||||
import { templateCategoryToGroupKey } from "./templateReviewMapping";
|
||||
|
||||
/** Uses filename extension and/or URL path so uploads render as `<img>` vs file link on read-only surfaces. */
|
||||
@@ -243,9 +244,14 @@ export function sectionFromDecision(
|
||||
for (const m of ms) {
|
||||
const sec = m.sections as unknown as Record<string, unknown>;
|
||||
const merged: Record<string, unknown> = { ...sec };
|
||||
const scope =
|
||||
formatScopePayload(sec.selectedApplicableScope) ??
|
||||
formatScopePayload(sec.applicableScope);
|
||||
const scope = formatScopePayload(
|
||||
decisionApproachScopeForPublish(
|
||||
Array.isArray(sec.applicableScope) ? sec.applicableScope : [],
|
||||
Array.isArray(sec.selectedApplicableScope)
|
||||
? sec.selectedApplicableScope
|
||||
: [],
|
||||
),
|
||||
);
|
||||
if (scope) merged.applicableScope = scope;
|
||||
delete merged.selectedApplicableScope;
|
||||
const e = communityRuleEntryFromMethodChip(m.label, merged, DEC_LABELS, {
|
||||
|
||||
Reference in New Issue
Block a user