Repository navigation
feat: expose the chart display settings and getNumberingSystem() to hosts - #27
Merged
Merged
Conversation
…osts Settings -> Odontogram chart styling (screenToothSpacing, screenToothNumberSize, selectionColor, selectionBorderStyle) and the tooth-information toggle were React state private to the provider, so a host persisting the doctor's preferences could neither read them after a change nor restore them on the next mount. They now follow the perioViewMode precedent: a module getter and an idempotent setter that notifies in src/state/displaySettings.ts, mirrored into the provider through onStateChange, and each is a controlled prop on OdontogramProvider/OdontogramShell (defined-gated like the fillings props). setNumberingSystem() had no getter, so numbering could not be persisted either; getNumberingSystem() fills that gap. The API-surface golden is re-captured for the eleven new exports; the shell DOM golden is untouched because the defaults are unchanged. 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.
Follow-up to #26, same motivation: a host app that persists the doctor's preferences through
onStateChange+ the engine getters.Problem
Five Settings-modal values are React state private to the provider — no getter, no setter, no prop, no notification:
screenToothSpacing,screenToothNumberSizeselectionColor,selectionBorderStyletoothInfoA host can neither read them after the doctor changes them nor restore them on the next mount, so they silently reset to defaults on every reload.
setNumberingSystem()also has no getter, so numbering cannot be persisted either.Change
src/state/displaySettings.tsfollowing theperioViewModeprecedent: modulelet+ getter + setter per value. Setters sanitize to the literal set (setSelectionColoraccepts#rrggbbonly and lowercases), early-return when unchanged and callnotifyStateChange()on a real change.onStateChange(same block as theperioViewModemirror), and the modalon*handlers write the engine instead of local state — so a host calling the setters directly re-renders the chart, and the modal never shows a stale value.OdontogramProvider/OdontogramShell(screenToothSpacing,screenToothNumberSize,selectionColor,selectionBorderStyle,toothInfo), defined-gated like the fillings props from feat: expose fillings settings as controlled props on OdontogramShell (issue #17) #19.getNumberingSystem().ScreenToothSpacing,ScreenToothNumberSize,SelectionBorderStyle) move to the state module;SettingsModal.tsxre-exports them, andApp.tsxexports them publicly.Defaults are unchanged, so the shell DOM golden is byte-identical. The API-surface golden is re-captured for the eleven new exports (
API_SURFACE_WRITE=1). The 19 test files that mock../odontogramwith an explicit object gain stubs for the new getters/setters.Tests
display-settings.test.tsx: each setter (default, notifies on change, silent when unchanged, sanitizing),getNumberingSystem, and the provider round-trip — defaults render as before, controlled props write the engine and the chart'sdata-screen-spacing/data-tooth-num/--odon-select-*/ tooth-info section, a host setter after mount re-renders, and the Settings modal selects write through to the engine.Full suite,
tsc -b --noEmit, eslint andnpm run build: clean.