Repository navigation
fix: notify onStateChange for session settings and tooth notes; keep note badges across grid rebuilds - #26
Merged
ZoliQua merged 3 commits intoSep 22, 2026
Conversation
…hange setNotesEnabled, setIcdasEnabled, setCariesDepthEnabled, setSecondaryCariesMode, setRootCariesMode, setRadiographicDepthMode, setWearDetailLevel, setDiscolorationDetailLevel and setNumberingSystem now follow the convention setPulpDetailLevel/setSurfaceNotation and the fillings setters already use: early-return when unchanged, notifyStateChange() on a real change. A host that persists the doctor's preferences through onStateChange otherwise never sees a toggle made in the Settings modal until the next tooth edit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The note editor popover wrote state.note without notifyStateChange(), so the note — part of the export payload — reached neither the localStorage autosave nor a host persisting the chart until the next unrelated edit. Only a real change notifies; re-saving the same text or deleting an empty note is a no-op. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
buildGrid() repaints every tooth from state through addTile() but creates the label cells bare, so after a re-init, an anatomy change or a perio round-trip a charted note kept its text and lost its badge. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@odontodev is attempting to deploy a commit to the ZoliQua's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ZoliQua
added a commit
that referenced
this pull request
Sep 22, 2026
…, #27) Neither PR carried its documentation, which this project requires for a new public API or a changed behaviour. - CHANGELOG 2.6.0: an Added entry for the five display settings, their controlled props and getNumberingSystem(), and a Fixed entry for the three mutations that never reached onStateChange. Both credit @odontodev. The Fixed entry also names the consequence the PR did not: onStateChange now fires for settings changes, so a subscriber persisting the export payload is woken by a Settings toggle that does not change the payload (debounced, one redundant write at most). - All twelve language READMEs: the five props in the props table, six rows in the API table (getNumberingSystem plus the five getter/setter pairs), and @odontodev's contributor line extended. - The engine's CLAUDE.md gains a "Session settings" section: where the display settings live and the contract every session setter follows (sanitize, early-return when unchanged, notify on a real change) — so the next setter added does not repeat the omission #26 fixed.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three places where a mutation skipped
notifyStateChange(), found while persisting the doctor's preferences and the chart from a host app throughonStateChange. One commit each, in the order they were found:1. Session-setting setters
setNotesEnabled,setIcdasEnabled,setCariesDepthEnabled,setSecondaryCariesMode,setRootCariesMode,setRadiographicDepthMode,setWearDetailLevel,setDiscolorationDetailLevelandsetNumberingSystemnow follow the convention the fillings setters,setPulpDetailLevelandsetSurfaceNotationalready use: early-return when unchanged,notifyStateChange()on a real change. A host persisting preferences otherwise never sees a toggle made in the Settings modal until the next tooth edit. TheonStateChangedocstring lists settings now.One existing test (
tooth-details-card.test.tsx) set the wear/discoloration level through the setter before mounting the provider, whose mount effect pushed the default back into the module; the stale DOM masked that while the setters were silent. It now passes the level as a provider prop.2. Note editor save/delete
The popover wrote
state.note— part of the export payload — without notifying, so neither the localStorage autosave nor a host saw a note until the next unrelated edit. Only a real change notifies: re-saving the same text or deleting an empty note is a no-op.3. Note badges after a grid rebuild
buildGrid()repaints every tooth from state viaaddTile()but creates the label cells bare, so after a re-init, an anatomy change or a perio round-trip a charted note kept its text and lost its badge. The label rows now get the same treatment.Tests
session-settings-setters.test.ts— one case per setter (notifies on change, silent when unchanged), modelled onfilling-settings-setters.test.ts.note-editor-notify.test.tsx— realinitOdontogram()under jsdom (same stubs astier2-rewire): save notifies once and lands in the payload, re-save is silent, delete notifies once, delete-when-empty is silent, badge survivesrebuildGrid().mainwithout its fix. Full suite,tsc -b --noEmitand eslint: clean; no golden changes.