fix: address Copilot review round 10 — structural const match, deep-link constants

- selectBranchIndex compares a discriminator structurally: a `const` may be
  an object or array, and deep-link arguments arrive as freshly parsed
  instances that could never be reference-equal to the schema's own.
- New applySchemaConstants, applied by InspectorView AFTER the deep link's
  `appArgs` are spread over the seeded defaults. The form renders a pinned
  field read-only, so a link disagreeing with one would otherwise auto-open an
  App with a hidden value contradicting the shape on screen.

Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
cliffhall 2026-08-26 04:23:14 -04:00
commit 775fec0f6a

View file

@ -605,7 +605,12 @@ export function selectBranchIndex<T extends RootUnionSchema>(
const supplied = pinned.filter(([name]) => values[name] !== undefined);
if (
supplied.length > 0 &&
supplied.every(([name, constValue]) => values[name] === constValue)
// Structural, not reference: a `const` may be an object or an array, and
// deep-link arguments arrive as freshly parsed instances that could never
// be `===` the schema's own.
supplied.every(([name, constValue]) =>
sameValue(values[name], constValue),
)
) {
matches.push(index);
}