improvement: fdi tooth chart selection modes polished. bugs related to teeth selecyion fixed.

This commit is contained in:
2026-07-18 00:02:40 +03:30
parent 4b2349228a
commit 0740493384
23 changed files with 384 additions and 161 deletions

View File

@@ -23,7 +23,7 @@ interface FdiToothChartProps {
selected: ReadonlySet<FdiToothId>;
/** Teeth that belong to a connected selection span (dots above/below). */
connectedTeeth?: ReadonlySet<FdiToothId>;
onToggle?: (fdi: FdiToothId, event: { shiftKey: boolean; ctrlKey: boolean }) => void;
onToggle?: (fdi: FdiToothId, event: { shiftKey: boolean }) => void;
disabled?: boolean;
/** Non-interactive display (Cases / connection history). */
readOnly?: boolean;
@@ -144,7 +144,7 @@ export function FdiToothChart({
return accent ? { color: accent } : undefined;
};
/** Dots + thin links — only for Shift-connected spans (not plain / Ctrl singles). */
/** Dots + thin links — only for Shift-connected spans (not plain singles). */
const ConnectedRail = ({ teeth, upper }: { teeth: FdiToothId[]; upper?: boolean }) => {
const hasConnected = teeth.some((fdi) => connectedTeeth?.has(fdi));
if (!hasConnected) return null;
@@ -221,15 +221,12 @@ export function FdiToothChart({
type="button"
disabled={isDisabled}
onMouseDown={(e) => {
// Modifier+click otherwise triggers browser text-selection / sticky focus boxes.
if (e.shiftKey || e.ctrlKey || e.metaKey) e.preventDefault();
// Shift+click otherwise triggers browser text-selection / sticky focus boxes.
if (e.shiftKey) e.preventDefault();
}}
onClick={(e) => {
e.preventDefault();
onToggle?.(fdi, {
shiftKey: e.shiftKey,
ctrlKey: e.ctrlKey || e.metaKey,
});
onToggle?.(fdi, { shiftKey: e.shiftKey });
}}
style={{ transform: `translateY(${offsetY}px) rotate(${rotate}deg)` }}
className={`