Skip to content

Daedalus TypeScript Error Separate PR Plan (2026-04-30)

Goal

  • Separate current snap-improvement delivery from legacy TypeScript debt in frontend/src/components/Daedalus/Drafting/D_Daedalus.vue.
  • Keep snap feature PR focused and reviewable.
  • Resolve broad typing debt in a dedicated follow-up PR with safer scope control.

Scope Split

  • This PR (snap-improvement):
    • Align snap dedicated toggle + sidebar wiring.
    • Dimension align/polar behavior verification test.
    • Small local refactor (shared line-like draft predicate).
  • Separate TS debt PR:
    • Existing compile/type errors that predate this snap delivery.

Error Buckets For Separate PR

  1. EquipmentMeta missing properties
  • Examples: drawConstructionCircle, linkedEquipmentRef, linkedPartRef, linkBindingType, linkBindingUpdatedAt, drawTableCols, drawTableRows.
  • Action:
    • Expand EquipmentMeta explicitly with canonical optional fields.
    • Audit all write/read paths to avoid any-style drift.
  1. Style/layer type strictness mismatches
  • Examples: CadLineType/CadLineWeight assignments from generic string, CanonicalLayerType set membership mismatches.
  • Action:
    • Add normalizers/guards at setter boundaries.
    • Narrow conversion functions before assignment.
  1. Nullability and flow narrowing gaps
  • Examples: cursorWorldPos.value potentially null; map callbacks where eq may be null.
  • Action:
    • Add early returns and local narrowed aliases.
    • Use explicit non-null safe guards around pointer-dependent flows.
  1. Legacy pointer-branch enum drift
  • Example: comparison against 'draw-text' not compatible with QuickPrimitivePointerDownBranch.
  • Action:
    • Align branch literals and union type source-of-truth.
  1. Leader/meta object shape mismatches
  • Example: leaderNumberingIndex nullable assignment conflicts with declared type.
  • Action:
    • Decide canonical nullable contract (number | null vs number | undefined) and apply consistently.
  1. Add missing EquipmentMeta fields and nullable contracts.
  2. Fix nullability errors with minimal control-flow changes.
  3. Introduce layer/style normalizers and replace direct string assignments.
  4. Align branch union literals and cleanup unreachable comparisons.
  5. Re-run diagnostics and keep any behavior-affecting change covered by focused tests.

Validation Checklist

  • get_errors shows zero new errors outside intended touch files.
  • Existing E2E for Daedalus still green.
  • New dimension align/polar spec remains green:
    • frontend/e2e/daedalus-dimension-align-polar.spec.js

Suggested Branch Naming

  • chore/daedalus-typescript-debt-pass-1

Suggested Commit Chunking

  1. types: expand EquipmentMeta contract
  2. types: tighten layer/style assignment boundaries
  3. types: null-safety pass for pointer and map flows
  4. types: align pointer branch unions

Last updated:

この記事の著者

MECHPHAISTOS | センサーを使わない保全

Yoshitaka Notoです。保全業務に携わり、AI時代の3Kと呼ばれるメンテナンス保全をもっと楽にしたい。 そういった保全ツール開発してます。