Skip to content

fix(core,types): fix Map content type — schema/component API mismatch, missing tests, schema hygiene#449

Merged
perasperaactual merged 1 commit into
devfrom
fix/map-content-type-crash
May 19, 2026
Merged

fix(core,types): fix Map content type — schema/component API mismatch, missing tests, schema hygiene#449
perasperaactual merged 1 commit into
devfrom
fix/map-content-type-crash

Conversation

@perasperaactual
Copy link
Copy Markdown
Contributor

What broke

The map content type was registered, documented, and agent-writable but silently crashed on render. contentRenderer spreads YAML fields as flat props; the Map component expected a pre-assembled config: MapConfig sub-object that never arrived. config was always undefined at runtime.

What was fixed

  • Map.tsx: now assembles MapConfig from flat YAML props (center, zoom, markers, layers, view, terrain) before passing to the MapProvider. label and type are explicitly absorbed so they don't pollute ...rest → DOM.
  • Moved Map.tsx from the orphaned content/ directory to base/ (where all other schema-backed content components live). Updated all imports in componentRegistry.ts, base/index.ts, core/src/index.ts.
  • mapLayerSchema.data: z.any()z.unknown() (philosophy: escape hatches should be explicit, not invisible)
  • Duplicate ZodLike interface declaration in plugin.ts removed
  • TASK-1.4-COMPLETE.md task artifact deleted from packages/types/
  • checkForPlaintextSecret: entropy threshold corrected — entropy > 4.5 was warning on high-entropy random values (wrong direction); fixed to entropy < 3.8 which catches weak plaintext passwords like password123 (entropy ≈ 3.59) while leaving higher-entropy generated values alone (entropy ≈ 3.91+). Follow-up issue filed in beads for bi-directional detection (stackwright-wao).

Tests added

  • packages/types/test/map-content.test.ts — 28 schema validation tests (markers, layers, mapContent, boundary zoom values, all optional fields, view enum coverage)
  • packages/core/test/components/map.test.tsx — 22 component tests (config assembly from flat props, DOM attribute hygiene for label/type, dimension defaults, theming)

Test suite

1,147 tests, 0 failures across 13 packages.

Changeset

.changeset/fix-map-component-api.md@stackwright/types patch, @stackwright/core patch.

@github-actions
Copy link
Copy Markdown
Contributor

✅ Visual Regression Test Results

Status: ✅ All visual tests passed!

All screenshots match the baseline. No visual regressions detected! 🎉

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 2026

⚡ Performance Benchmark Results

✅ Build Time Benchmarks: PASSED

✅ Bundle Size Benchmarks: PASSED

❌ Runtime Vitals Benchmarks: FAILED

📝 Note: Detailed results are available in the job logs.

🎯 Performance Budgets:

  • Build time: <70s total
  • First-load JS: <100KB gzipped
  • FCP: <1.5s, LCP: <2.5s, TTI: <3s

Updated: 2026-05-19T01:50:49.106Z

…hygiene, tests

- Map.tsx: assemble MapConfig from flat YAML props (center, zoom, markers, etc.)
  instead of expecting a pre-built config object that never arrived at runtime;
  absorb label and type so they don't pollute ...rest spread to DOM
- Move Map.tsx from orphaned content/ to base/ alongside other schema components;
  update all imports in componentRegistry.ts, base/index.ts, core/src/index.ts
- mapLayerSchema.data: z.any() → z.unknown() (explicit escape hatch)
- plugin.ts: remove duplicate ZodLike interface declaration
- secret-detection.ts: fix entropy threshold direction — warn on low-entropy
  plaintext passwords (< 3.8 bits/char) not high-entropy random values
- Delete TASK-1.4-COMPLETE.md task artifact from packages/types/
- Add changeset: @stackwright/types patch, @stackwright/core patch
- packages/types/test/map-content.test.ts: 28 new schema tests
- packages/core/test/components/map.test.tsx: 22 new component tests
- Full suite: 1,147 tests, 0 failures
@perasperaactual perasperaactual force-pushed the fix/map-content-type-crash branch from 1b3259d to 47360f0 Compare May 19, 2026 01:47
@github-actions
Copy link
Copy Markdown
Contributor

✅ Visual Regression Test Results

Status: ✅ All visual tests passed!

All screenshots match the baseline. No visual regressions detected! 🎉

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 2026

♿ Accessibility Test Results

Overall Status: ✅ 0/0 tests passed

🦮 WCAG 2.1 AA Compliance

No WCAG test results available

⌨️ Keyboard Navigation

No keyboard navigation test results available


⚠️ No accessibility tests were executed. Check the workflow logs for setup issues.

📊 Detailed Report

Download the full HTML accessibility report from the workflow artifacts for:

  • Detailed WCAG violation descriptions
  • Specific element selectors and fixes
  • Color contrast issues
  • Keyboard navigation flow analysis

🔍 Testing Checklist

Our accessibility tests verify:

  • ✅ WCAG 2.1 Level AA compliance
  • ✅ Color contrast in light and dark modes
  • ✅ Tab key navigation through all interactive elements
  • ✅ Focus indicators are visible
  • ✅ No keyboard traps
  • ✅ Skip links and ARIA landmarks
  • ✅ Screen reader compatibility

Powered by @axe-core/playwright and Playwright

@perasperaactual perasperaactual merged commit be7f767 into dev May 19, 2026
14 of 15 checks passed
@perasperaactual perasperaactual deleted the fix/map-content-type-crash branch May 19, 2026 01:55
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.

1 participant