You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6e5aae2
Browse filesBrowse the repository at this point in the historyBrowse files
Refactor and enhance import robustness, validation rules, and UX clarity across multiple phases
- Improved handling of legacy files with space-key normalization in import repair (Phase 8).
- Updated validation rules to address false positives in orphaned file checks and added checks for associated files (Phases 8-12).
- Enhanced user experience in the Day Editor with a new layout and read-only sections for inherited metadata (Phase 15).
- Addressed first-run completeness issues in the Create-Animal wizard, ensuring required fields are populated (Phase 14).
- Refined camera calibration processes to prefill standardized hardware information (Phase 10).
- Implemented vocabulary nudges for device types and species validation (Phase 11).
- Streamlined the Day Editor's interface and interaction model, ensuring clarity and ease of use (Phase 15).
Copy file name to clipboardExpand all lines: .claude/docs/plans/v3-review-fixes/PLAN.md
+19-11Lines changed: 19 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,19 +43,27 @@ For agent invocation, **load only the slice you need**:
43
43
-[phase-6-type-safety.md](phase-6-type-safety.md) — derive the closed status unions (`DAY_STATUS`/`StepStatus`/`DAY_LIFECYCLE`) + a boundary guard.
44
44
-[phase-7-test-ci-hardening.md](phase-7-test-ci-hardening.md) — validation/migration/divergence test gaps, e2e self-skip, CI schema-sync fail-open, guard fragility.
45
45
-**Data-grounded app improvements (from the `yaml-corpus-2` study):**
46
-
-[phase-8-import-robustness.md](phase-8-import-robustness.md) — fix the list-vs-scalar `orphaned_file`/`orphaned_video` bug (blocks ~63% of real-file imports) + `YYYYMMDD_<subject>` date parsing + repairable coercions. *(highest value)*
46
+
-[phase-8-import-robustness.md](phase-8-import-robustness.md) — fix the list-vs-scalar `orphaned_file`/`orphaned_video` bug (blocks ~63% of real-file imports) + `YYYYMMDD_<subject>` date parsing + known legacy space-key normalization + repairable coercions. *(highest value)*
47
47
-[phase-9-opto-power-guard.md](phase-9-opto-power-guard.md) — `power_in_W` range warn-to-confirm (the one unguarded silent NWB corruption) + fix the misleading placeholder.
48
48
-[phase-10-camera-calibration.md](phase-10-camera-calibration.md) — `meters_per_pixel > 0`, placeholder camera names, cross-day calibration-aliasing on import (within-file aliasing already guarded).
-**UX efficiency & clarity (from the live UX walkthrough, [../../research/yaml-corpus-2/13-ux-live-walkthrough.md](../../research/yaml-corpus-2/13-ux-live-walkthrough.md)):**
51
+
-**UX efficiency & clarity (from the live UX walkthrough + Day Editor mock review: [13-ux-live-walkthrough.md](../../research/yaml-corpus-2/13-ux-live-walkthrough.md), [14-day-screen-vs-mock.md](../../research/yaml-corpus-2/14-day-screen-vs-mock.md)):**
52
52
-[phase-13-validation-presentation.md](phase-13-validation-presentation.md) — *(keystone; sequence BEFORE 8–12)* group/tier/collapse the Day Editor banner + reward-early/punish-late (use the existing `DRAFT` status for untouched days) + extend `humanizeValidationMessage` coverage + status-signal consistency. Makes the presentation absorb the new guards instead of becoming a ~20-row wall.
53
-
-[phase-14-first-run-scope.md](phase-14-first-run-scope.md) — wizard collects `experiment_description` + pre-fills lab/institution (no first day born with errors). *(Its day-view read-only task moves into Phase 15 — trim Phase 14 to the wizard.)*
54
-
-[phase-15-day-editor-ia-realign.md](phase-15-day-editor-ia-realign.md) — *(largest UX phase; the daily path)* realign the Day Editor to the finalized mock: grouped **vertical rail** (SESSION/RECORDING/FINISH), single-column sections, subject + technical params **inherited read-only**, DIO folded into RECORDING, day view scoped to the day-delta. Fixes the smushed/wrapping nav + the crammed "Day" tab at the root.
55
-
56
-
> **Sequencing note:** Phase 13 should land **before** the guard phases 8–12 — adding ~8–10 new issue
57
-
> types onto today's flat, punish-early banner would degrade the UX even as the data gets safer. Phases
58
-
> 1 is independent and can land any time; 14 is independent of the guard rules but pairs naturally with
59
-
> 13.**Phase 15 is the highest-leverage UX work** (the daily screen) and depends on Phase 13's
60
-
> per-section status model; it absorbs Phase 14's day-view read-only task. The original 1–7 keep their
61
-
> low-risk-first order.
53
+
-[phase-14-first-run-scope.md](phase-14-first-run-scope.md) — wizard collects `experiment_description` + pre-fills lab/institution (no first day born with errors).
54
+
-[phase-15-day-editor-ia-realign.md](phase-15-day-editor-ia-realign.md) — *(largest UX phase; the daily path)* realign the Day Editor to the finalized mock: grouped **vertical rail** (SESSION/RECORDING/FINISH), single-column sections, subject + rig constants inherited read-only while day-owned technical fields stay editable, DIO folded into RECORDING, day view scoped to the day-delta. Fixes the smushed/wrapping nav + the crammed "Day" tab at the root.
55
+
56
+
## Execution waves
57
+
58
+
Use these waves as the source of truth for implementation order; phase numbers remain stable for review
Copy file name to clipboardExpand all lines: .claude/docs/plans/v3-review-fixes/overview.md
+20-12Lines changed: 20 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,21 +31,24 @@ Verified against the live tree at planning time; re-confirm before editing.
31
31
32
32
-`src/validation/rules/referenceRules.ts:200-228` (`orphaned_file`) + `:146-196` (`orphaned_video`) — `taskEpochSet.has(epoch)` false-positives when the referencing `task_epochs` is a **list**`[2]`; `src/nwb_schema.json:617-623` declares the field scalar `integer`. **Phase 8** (the list-vs-scalar bug; ~63% of real imports). Cover both `associated_files` and `associated_video_files`, including singular-only `task_epoch` legacy video rows and mixed singular/plural video rows, because the corpus shows video epoch linkage is the largest downstream drop-risk if normalized incorrectly.
33
33
-`src/state/yamlImportPlan.ts:94-121` (`extractRecordingDate`) — parses only the template's `mmddYYYY_..._metadata.yml` + `session_id` ending `_YYYYMMDD`; real `YYYYMMDD_<subject>.yml` → `null` → `planImport` dead-end. **Phase 8**. (`src/state/importRepair.ts:348-420` is the normalization seam shared with **Phase 4**.)
34
+
-`src/state/importRepair.ts` — legacy files can carry schema keys with spaces (`subject id`, `electrode groups`, `ntrode electrode group channel map`, `data acq device`). Normalize only these known aliases as listed benign import repairs before validation/decision/decompose; do not rewrite arbitrary user keys. **Phase 8**.
34
35
-`src/validation/rules/optoRules.ts` — `optogeneticsRules` has **no `power_in_W` magnitude check**; `src/nwb_schema.json:36042` is the field; `src/pages/AnimalEditor/OptogeneticsStep.tsx:56` has the misleading `placeholder: 'e.g. 10'`. **Phase 9**.
35
36
-`src/validation/rules/identityRules.ts:56-60` — the camera-name divergence signature **already includes `meters_per_pixel`** (within-file aliasing is done). Gaps: `meters_per_pixel > 0` (`src/nwb_schema.json:716`), placeholder names, and the cross-day case at the `src/state/yamlImportApply.ts:270-340` catalog-merge seam (shared with **Phase 4**). **Phase 10**.
36
37
-`src/validation/rules/dandiSubjectRules.ts:24-36` — already rejects free-text `species` (`invalid_species`); add genotype-vs-strain + placeholder-`subject_id` nudges. `src/validation/rules/identityRules.ts` — add the experimenter name-shape rule (Spyglass `decompose_name`). `src/validation/rules/electrodeGroupRules.ts:105-160` — `empty_location` + the case warning; add a typo nudge. `src/ntrode/probeCatalog.ts:75-96` already has **all 12** probes (only `CLAUDE.md`'s "Current Supported Device Types" doc is stale at 8). **Phase 11**.
37
38
-`src/validation/rules/referenceRules.ts` (sibling to `orphaned_file`) — no `associated_files`*internal* checks today (duplicate name → trodes `pynwb ValueError` hard-fail; duplicate path / missing statescript description-keyword / bad path-shape → silent drop). **Phase 12**.
38
39
39
-
### Phases 13–14 — UX efficiency & clarity (from the live UX walkthrough)
40
+
### Phases 13–15 — UX efficiency & clarity (from the live UX walkthrough + Day Editor mock review)
40
41
41
42
Verified against the live tree; re-confirm line numbers before editing. Full findings:
-`src/pages/DayEditor/DayEditorFrame.tsx:144-157,407` — `readinessIssues` → the `ReadinessBar` banner (the surface to group/tier/collapse). `src/pages/ValidationSummary/index.tsx:200-302` already has the grouped/collapsed + `warningsAcknowledged` pattern to reuse. **Phase 13.**
45
47
-`src/domain/humanizeValidationMessage.ts` (+ applied at `src/viewModels/dayEditorViewModel.ts:545`) — `HUMANIZE_LABELS` misses `must have required property '<X>'` / `must NOT have fewer than 1 items`; extend **at display**, leaving raw `issue.message` intact (a downstream parser reads it — the file says so). **Phase 13.**
46
48
-`src/domain/dayLifecycle.ts:28-34` — `DAY_LIFECYCLE.DRAFT` already exists; `src/viewModels/animalWorkspaceViewModel.ts:62-170` rolls a fresh day straight to the export-gate "Needs fixing". Gate the surfacing on "touched yet?" so untouched = DRAFT. `src/pages/AnimalEditor/CamerasSection.tsx:154-158` fires the calibration warning on an empty step (same punish-early class). **Phase 13.**
47
49
-`src/pages/Home/CreateAnimalWizard.tsx:108-204` (`TeamStep`) — collects `lab`/`institution` from blank seeds; `experiment_description` collected nowhere. `src/domain/animalCreation.ts:134,149,157` has the defaults that don't reach the step. **Phase 14.**
48
-
-`src/pages/DayEditor/DayTab.tsx:400-433` — the inherited-subject-metadata disclosure that writes the animal record for all days behind a grey "UPDATES ALL DAYS" label; `src/pages/AnimalView/index.tsx` is the correct edit path. **Phase 14.**
50
+
-`src/pages/DayEditor/DayEditorFrame.tsx` + `DayEditorFrame.module.css` + `DayEditor.scss` — the day editor is mid-refactor: a horizontal tab bar is squeezed into the old 230px rail column, sections wrap/cram, and the mock's grouped vertical rail is not restored. **Phase 15.**
51
+
-`src/pages/DayEditor/DayTab.tsx:400-433` — the inherited-subject-metadata disclosure writes animal-static fields from the day view; `src/pages/AnimalView/index.tsx` is the correct edit path. `src/pages/DayEditor/DayTechnicalSection.tsx` already distinguishes rig constants (read-only inherited values) from day-owned technical fields (`default_header_file_path`, `units`). **Phase 15.**
@@ -79,6 +82,7 @@ branch order or same-PR coordination:
79
82
-**Phase 2 before/with Phase 9:** both can touch opto validation helpers; Phase 9 should reuse the Phase-2 helper shape if Phase 2 lands first.
80
83
-**Phase 13 before Phases 8-12:** Phase 13 bounds and tiers the Day Editor validation banner so the new data-quality guards do not create an attention/working-memory wall.
81
84
-**Phase 14 before or with Phase 13:** Phase 14 removes wizard-created first-day errors; Phase 13 controls when/how any remaining validation results surface.
85
+
-**Phase 15 after Phase 13:** Phase 15 renders Phase 13's per-section status model in the day-editor rail and owns the Day Editor scope/IA realignment.
82
86
-**Phase 7 before any deliberate schema migration:** this plan avoids schema changes; if one becomes unavoidable, the schema-sync and AJV/jsonschema divergence gates must already be hard.
83
87
84
88
## Metrics
@@ -108,10 +112,14 @@ branch order or same-PR coordination:
108
112
109
113
All-at-once per phase (no feature flags). `modern` is local-only and unpushed; these land on `modern`
110
114
the same way the epoch-editor phases did (branch off `modern` → full gate → independent review →
111
-
`git merge --ff-only`; do not push unless asked). Suggested order: land the original review fixes
112
-
low-risk-first (`1 → 7`), land the UX-presentation prep (`14` if convenient, then **13**), then land the
113
-
data-grounded guard fixes (`8 → 12`) with the handoffs above. If a later phase is pulled forward,
114
-
explicitly re-check its handoff partner before merging.
115
+
`git merge --ff-only`; do not push unless asked). Suggested wave order:
116
+
117
+
1.**Foundation and safety:**`1 → 6 → 7 → 2`.
118
+
2.**Core data integrity:**`3 → 4 → 5`.
119
+
3.**UX readiness for heavier validation:**`14 → 13 → 15`.
0 commit comments