Skip to content

chore(deps): update @codaco packages to fresco-ui 4.0 / interview 3.0#834

Merged
jthrilly merged 3 commits into
nextfrom
chore/update-codaco-packages
Jul 15, 2026
Merged

chore(deps): update @codaco packages to fresco-ui 4.0 / interview 3.0#834
jthrilly merged 3 commits into
nextfrom
chore/update-codaco-packages

Conversation

@jthrilly

Copy link
Copy Markdown
Member

Updates all @codaco/* packages to their latest versions and implements the required downstream changes.

Version bumps

Package From To
@codaco/fresco-ui 3.0.1 4.0.0 (major)
@codaco/interview 2.0.1 3.0.0 (major)
@codaco/protocol-validation 11.8.1 11.9.0
@codaco/protocol-utilities 2.1.1 2.2.0
@codaco/shared-consts 5.4.0 5.5.0
@codaco/tailwind-config 1.0.2 1.1.0
@codaco/network-exporters 1.1.2 1.1.3
tailwindcss 4.3.1 4.3.2 (new peer minimum of fresco-ui 4 / interview 3)

@codaco/interview 3.0.0's major bump is driven by its peer on fresco-ui 4; its own changes are minor/patch (skip destination routing, exit confirmation, Sociogram QoL, autosave durability). All other peer requirements (react 19.2.7, motion 12.40, zod 4.4, zustand 5.0.14, @base-ui/react ^1.4, @tanstack/react-table ^8.21.3) were already satisfied.

Required code changes

onFocus event typing (fresco-ui 4)

Field components now type onFocus/onBlur as generic React.FocusEvent, so event.target is no longer HTMLInputElement. UpdateSettingsValue now narrows with instanceof before calling .select().

Settings heading spacing (fresco-ui 4)

Heading margin="none" changed from mb-0 to m-0!. The !important shorthand is not in the same tailwind-merge conflict group as mb-*, so the consumer margins in SettingsCard and SettingsNavigation were silently defeated (every settings card title lost its gap — verified against the built CSS). Switched both to padding (pb-*), which the important margin reset cannot override.

Protocol normalization data preservation (protocol-validation 11.9.0)

11.9.0 tightened CurrentProtocolSchema (OrdinalBin prompt colors restricted to the ord-color-seq-1..10 palette; orphaned CategoricalBin otherOptionLabel/otherVariablePrompt rejected; locked value sets enforced for read-only ordinal variables; FamilyPedigree ego identifier validation). Stored v8 protocols imported under ≤11.8.1 can now fail isConformantV8 and be routed through normalizeMislabelledV8 at deploy time — and the v7→v8 re-migration is not idempotent on genuine v8 bodies:

  • it unconditionally resets every node type's shape to { default: 'circle' }, wiping authored shape configs; and
  • it adds required: true to any variable with a min* validator and no explicit required (correct for v7 semantics preservation, but a silent behavior change for v8-authored optional fields).

normalizeMislabelledV8 now snapshots the stored codebook before migrating (the migration mutates nested input objects in place), restores authored node shape configs and original validation.required state onto the migration output, and persists the restored body only if it still passes the strict schema — otherwise it falls back to the plain migration output with a warning. Regression tests cover both paths.

Audited, no change needed

A multi-agent audit verified the remaining changelog items against Fresco usage (empirically, against the installed dists and prior tarballs):

  • InputField className now wrapper-only: all 9 className-passing call sites audited; font classes reach the input via CSS inheritance, layout classes were wrapper-targeted all along.
  • SegmentedSwitcher/SegmentedToolbar restyling: Fresco has no direct usages; the only consumer is @codaco/interview itself, which was authored against the new defaults.
  • NetcanvasInflationLimitError (zip-bomb cap in extractProtocol): unreachable — Fresco's import flow uses JSZip directly and maps validation errors via a discriminated union.
  • shared-consts 5.5.0: runtime export diff shows only additive site-locale exports; NcNetworkSchema/StageMetadataSchema behavior is identical across versions.
  • Read path (lib/db): stored protocols newly failing the stricter schema are repaired by the deploy-time migration on both deploy paths (Vercel build:platform and Docker migrate-and-start.sh). Residual gap is dev-only (pnpm dev never runs the migration), where an affected protocol reads back stage-less with a console warning.

Known behavioral notes (no code change)

  • Theme tokens changed upstream (tailwind-config 1.1.0): light-theme --text (near-black → cyber grape), --accent (violet → slate blue), and surface colors are now derived from the page background. Expect Chromatic diffs on dashboard stories — these are the intended upstream design-system change and need baseline acceptance. The interview theme CSS is byte-identical between versions.
  • Browser Back on protocols using the new skipLogic.destination feature: interview 3.0.0 recovers forward for bypassed stages. With Fresco's history: 'push' URL state, pressing browser Back onto a bypassed step index bounces forward again (a no-op loop; the in-UI back button is unaffected and correct). A selective fix isn't possible today because the package's onStepChange gives no way to distinguish recovery from user navigation — if this matters, the fix is an upstream discriminator in the step-change meta. Legacy destination-less skips keep the old backward recovery.

Verification

  • pnpm typecheck, pnpm lint, pnpm test (363 tests, 42 files, includes browser-mode) all pass
  • pnpm build (production) passes
  • Migration behavior empirically verified against both 11.8.1 and 11.9.0 (parse-acceptance diffs, non-idempotency repro, hash consistency with the import flow)

Bump @codaco/fresco-ui 3.0.1->4.0.0, @codaco/interview 2.0.1->3.0.0,
@codaco/protocol-validation 11.8.1->11.9.0, @codaco/protocol-utilities
2.1.1->2.2.0, @codaco/shared-consts 5.4.0->5.5.0, @codaco/tailwind-config
1.0.2->1.1.0, @codaco/network-exporters 1.1.2->1.1.3, and tailwindcss
4.3.1->4.3.2 (new peer minimum).

Downstream changes required by the upgrade:

- UpdateSettingsValue: field onFocus is now typed as a generic
  React.FocusEvent, so narrow event.target before calling select().
- SettingsCard/SettingsNavigation: Heading margin="none" now emits m-0!
  (important), which defeats consumer mb-* utilities; use padding for
  the title gap instead.
- migrate-protocols-to-v8: protocol-validation 11.9.0 tightened the v8
  schema, so stored v8 protocols imported under 11.8.x can newly fail
  isConformantV8 and be re-run through the v7->v8 migration, which is
  not idempotent on genuine v8 bodies (it resets node shape configs and
  adds required:true next to min* validators). Snapshot the stored
  codebook before migrating, restore authored shape/required state onto
  the migration output, and persist the restored body only when it
  still passes the strict schema.
Copilot AI review requested due to automatic review settings July 15, 2026 18:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: dc35c211-f9c8-4fa2-82ce-ef5821ad77bf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/update-codaco-packages

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 293fb3f3a9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/migrate-protocols-to-v8.ts
Comment thread package.json
Comment thread scripts/migrate-protocols-to-v8.ts
jthrilly added 2 commits July 15, 2026 20:21
- Reconstruct the asset manifest in both isConformantV8 and the
  restored-body re-parse: the whole-protocol schema cross-references
  roster/geospatial dataSource ids against the manifest, so without it
  every asset-referencing protocol failed conformance, re-normalized on
  each deploy, and lost its authored state to the fallback path.
- Only remove the migration-added required:true for minValue-only
  variables. Fresco's legacy form engine failed empty values for
  minLength/minSelected (effectively required) but passed them for
  minValue, so this preserves the validation behaviour participants
  actually observed. Explicit required values are restored verbatim.
@jthrilly jthrilly merged commit ec96e64 into next Jul 15, 2026
11 checks passed
@jthrilly jthrilly deleted the chore/update-codaco-packages branch July 15, 2026 18:30
jthrilly added a commit that referenced this pull request Jul 15, 2026
Schema 8 evolved during development but was never released, so the current
schema 8 (protocol-validation 11.9+) is the only version that exists.
Remove the authored-state restoration machinery from normalizeMislabelledV8
that #834 added to protect data authored under interim v8 iterations;
non-conformant schemaVersion-8 rows are dev-era data and are mechanically
coerced by the plain v7->v8 re-migration. The asset-manifest reconstruction
in isConformantV8 stays (current-schema fix for roster/geospatial protocols).
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.

2 participants