[codex] Extract marker detail editing workflows#456
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR refactors the marker detail editing logic out of
Confidence Score: 4/5The module split is clean and the re-export shim keeps all existing call sites intact; the main risk is in the insulin bidirectional handling inside marker-detail-editing.js. Both value-mutation gaps (missing _rememberManualOriginal for the mirror key in editMarkerValue, and no diabetes.insulin_d to hormones.insulin cascade in save/edit/delete/revert) can leave the two insulin category views showing inconsistent data and disable the revert button on the diabetes side. Note operations already handle both directions, confirming the diabetes view is interactive, so these omissions affect real user flows. js/marker-detail-editing.js — specifically the insulin cascade logic in editMarkerValue, saveManualEntry, deleteMarkerValue, and revertMarkerValue Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as Category UI
participant MDE as marker-detail-editing.js
participant MDM as marker-detail-modal.js
participant State as state.importedData
UI->>MDM: onclick handler (e.g. saveManualEntry)
MDM->>MDE: re-exported call
MDE->>State: write entry.markers[dotKey]
alt "dotKey === 'hormones.insulin'"
MDE->>State: mirror write to entry.markers['diabetes.insulin_d']
MDE->>State: mirror manualValues['diabetes.insulin_d:date']
MDE->>State: recalculateHOMAIR
end
Note over MDE,State: No reverse path implemented
MDE->>MDM: configureMarkerDetailEditing callback
MDM->>UI: showDetailModal / navigate
Reviews (2): Last reviewed commit: "Fix insulin manual mirror cleanup" | Re-trigger Greptile |
Summary
marker-detail-editing.js.marker-detail-modal.jsfocused on rendering/detail modal form surfaces while re-exporting the existing inline handler API.version.jsto1.8.284.diabetes.insulin_dmanualValues key when deletinghormones.insulin.Validation
Initial extraction:
node --check js/marker-detail-modal.jsnode --check js/marker-detail-editing.jsnode tests/test-manual-entry-flow.jsnode tests/test-marker-value-notes.jsnode tests/test-provenance.jsnode tests/test-multi-unit.jsnode tests/test-audit.js./run-tests.shGreptile fix:
node --check js/marker-detail-editing.jsnode tests/test-marker-value-notes.jsnode tests/test-manual-entry-flow.jsgit diff --check