Commit Graph

59 Commits

Author SHA1 Message Date
754efdee09 feat(frontend): let the clinician pick the tooth from the candidates
An under-specified tooth was a dead end: the sheet said what was missing
and the clinician had to leave and hunt for it on the chart. The readings
are enumerable, so the review sheet now renders them as chips — the one
interactive part of an otherwise read-only confirmation step.

A pick is folded into the result by withChosenTeeth() rather than tracked
alongside it, so the rows, the mini chart, the prosthesis warning and
applyVoiceResult all keep reading a single VoiceExtractionResult and none
of them has to know the chips exist. It unions rather than toggles: a
candidate can coincidentally be a tooth the recording already produced, and
tapping it must not deselect that one.

Two things that would otherwise make the chips look functional while
applying nothing: the teeth row is ticked on the first pick (it starts
unticked when the recording produced no teeth of its own), and the apply
count is now intersected with row availability so it cannot promise to
apply a row with nothing in it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-23 23:05:30 +03:30
1be735a7ab fix(voice): say the quadrant is missing instead of "could not be read"
"ترمیم برای دندون دو" set the treatment type but reported the tooth as
unreadable. Nothing was misheard: position 2 arrived intact, with no
quadrant, because none was spoken — four teeth carry position 2 and the
resolver correctly refused to pick one. Only the label was wrong, and it
sent the clinician looking for a transcription fault.

Adds a tooth_missing_quadrant reason that names what is missing and shows
how to say it ("دو بالا راست"), and tells the model explicitly to report a
quadrant-less number with arch and side null rather than guessing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-23 23:05:30 +03:30
93c6513df6 feat(frontend): voice capture hook, API client and types
MediaRecorder handling and the API call live in lib/, not in ui/, so
TreatmentDetailsEditor can stay presentational and take only a `voice` prop.

Container choice is made at record time and needs no transcode: Chrome and
Android give webm/opus, Safari and iPad give mp4/aac, and the transcription
endpoint accepts both. Safari's `audio/mp4` is sent as `m4a`, the name the
vendor's container list actually uses, so iPad recordings do not fail while
Chrome works. Older Safari shipped MediaRecorder without isTypeSupported, so
that path lets the browser choose rather than refusing outright.

From review of this commit:

- The auto-stop at maxMs guaranteed a 413. The client measures the final length
  after the recorder has stopped, so a recording that runs to the cap always
  reports slightly over it, and the server rejected exactly the recording the
  auto-stop existed to save. The server now allows a documented 2s tolerance and
  the client keeps reporting the true length, so telemetry stays honest.
- getUserMedia is async, so a permission granted after unmount installed a live
  stream the cleanup effect had already run past — leaving the browser's
  recording indicator lit with nothing listening. Guarded with a mounted ref.
- Client-side failures are now ApiError-shaped ({code, statusCode}) rather than
  bare Errors, because getUserFacingError only resolves that shape; without it
  errors.VOICE_MIC_DENIED was dead in all three locales.

Cancelling aborts the request, which closes the connection and aborts the
metered vendor call server-side rather than letting it settle unseen. The level
meter is best-effort: a blocked AudioContext costs the meter, not the recording.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-23 23:05:30 +03:30
b1405b22b1 improvement: patient search moved to the top of treatment feature. 2026-08-22 20:11:43 +03:30
96f698be98 improvement: UI/UX improved for v1 standalone treatments/cases feature. 2026-08-19 16:07:32 +03:30
8bfa8c88fe improvement: v1 standalone treatment/case creation made possible. 2026-08-19 15:05:58 +03:30
538121d653 improvement: pdf generation added to cases feature. 2026-07-18 22:00:44 +03:30
408b2c3329 improvement: task assignment notif added to notifications feature. 2026-07-18 17:23:47 +03:30
9f6ec193d2 feature: version one notification feature implemented. 2026-07-18 01:09:54 +03:30
68fc9d5d6d improvement: treatment plan turned into a wizard. shift+click control added to FDI tooth chart for cunnected prosthesises. 2026-07-17 00:39:32 +03:30
08df2f71ea improvement: QRcode and shared link added to cases inorder to make it possible for staff users to share a case info with other staffs or other clinics. 2026-07-14 21:07:05 +03:30
d383a4abc3 improvement: some new gadgets added to dashboard. some new functionality added to existed gadgets. 2026-07-14 03:06:56 +03:30
27eae25f61 improvement: lab/clinic commiunication flow completely overhauled. no more shit. 2026-07-13 22:53:23 +03:30
2ad572f4c8 improvement: notify counter badge added to treatment and tasks tabs for upadted and edited cases. 2026-07-13 17:44:44 +03:30
08a1f34c4f improvement: duedate added for shipped cases. cases and tasks ui and ux updated accordingly. 2026-07-13 16:30:36 +03:30
a391eee15f improvement: task assignment flow added. cases and tasks feature updated accordingly. 2026-07-13 15:47:32 +03:30
0d073f1ec0 improvement: sorts and filters updated for tasks feature. 2026-07-13 13:22:38 +03:30
4e6ed75844 improvement: tasks feature UX fully overhauled. 2026-07-13 02:09:49 +03:30
f28cd06615 improvement: treatment UX fully overhauled. 2026-07-13 01:03:26 +03:30
abf0371a5b improvement: appointment dialog UX improved. 2026-07-12 22:07:11 +03:30
1cdf853d32 improvement: appointments history component added to patients feature. 2026-07-12 18:56:01 +03:30
fab5111aa8 improvement: error handeling structure changed and unified all across the app. user no longer sees inappropriate messages. 2026-07-12 18:27:38 +03:30
901d838a2c bugfix: organization not selected problem fixed. being logged out too often fixed. 2026-07-12 17:51:31 +03:30
0f1004a34a Case completion and tasks completion gadgets added. 2026-07-12 02:08:54 +03:30
d79aab907c Some functionality added to dashboard gadgets. 2026-07-12 00:28:43 +03:30
83f6003a2b Positioning, sizing and sorting of the gadgets improved. 2026-07-11 22:32:37 +03:30
ed8ff61205 Shitty gadgets removed. Some useful gadgets added. 2026-07-11 03:12:56 +03:30
3f2b332bd3 Add Today action lists and clickable KPI links (Phase 3).
Show upcoming appointments for the rest of today and link each KPI card to its relevant dashboard tab.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-11 00:48:35 +03:30
10959e3183 Add Recharts bar charts to Today dashboard summary.
Extend the Today summary API with treatment mix and workflow task breakdowns, and render permission-aware chart cards on the Today page using Recharts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-11 00:34:38 +03:30
22466490bf Add Today dashboard foundation with permission-aware KPI summary API.
Replace hardcoded Today cards with a backend summary endpoint and composable frontend widgets filtered by org type and tab permissions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-11 00:07:48 +03:30
be4ac3426e Merge branch 'master' into feature/cases 2026-07-10 15:26:36 +03:30
8d334833ff improvement: all demo bugs fixed. give me more baby. 2026-07-08 02:53:47 +03:30
86b1e3afff improvement: attachment selection for lab dispatch added. attachment preview added to cases feature. 2026-07-07 18:43:10 +03:30
b2d40b3e97 improvement: users can now comment on a case and it's details and have an option to make it visible for clinics too. 2026-07-07 17:14:31 +03:30
cb63ced4e3 improvement: tasks and cases feature updated based on the new prosthesis types and their steps. the whole assignment proccess removed from the flow. 2026-07-07 15:31:09 +03:30
ed7e7b1d8f improvement: all clinic side ui components related to treatment types updated based on the new real world data. 2026-07-07 13:13:04 +03:30
667b08ed0c TreatmentType and ProsthesisType database shcema and data updated. Lab dispatch wired through new data. 2026-07-06 20:40:19 +03:30
3f7364dbf0 forgot password in login page and account info implemented, sms.ir service works fine with sandbox key. 2026-07-04 00:01:58 +03:30
2f95559087 remember me with max age 30 days :). 2026-07-02 17:59:49 +03:30
2a48946a51 feature: Tasks tab added for lab organizations. tasks now can be assigned and their status can be updated by the assignee. 2026-06-28 22:56:56 +03:30
feb0b26ad0 improvement: treatment preview and treatment history components overhauled. draft & completed status for treatment plan completely removed from the flow. 2026-06-28 21:45:33 +03:30
478cfa085a feature: Phase5 - Lab Cases inbox + task board 2026-06-28 17:49:40 +03:30
7b19d6953c feature: Phase4 - Clinic two-step treatment UI 2026-06-28 17:14:02 +03:30
21f545ebdb feature: Phase3 - Task templates + generation on send 2026-06-28 16:46:42 +03:30
8b4ef6195d feature: Phase 2- splitting the treatment schema into TreatmentDetail and LabCase. 2026-06-28 15:34:56 +03:30
64c7e5a257 feature: phase0 - Global patients + mobile normalization 2026-06-28 14:49:37 +03:30
284fbd08aa feature: localization's first implmentation 2026-06-20 12:37:38 +03:30
48ecfd05e1 feature: users with treatment edit permission should now have working hours defined. the appointment grid is now being drawn based on the doctor's working hours. 2026-06-10 19:44:09 +03:30
633c939560 feature: treatment frontend wired with the newly implemented backend. no mocked data no more. 2026-05-19 23:43:43 +03:30
f743046b38 feature: a minimal v1 backend implemented for treatments feature. 2026-05-19 22:29:29 +03:30