Let an existing pack be given its tablet size - #131
Merged
suskozaver merged 1 commit intoSep 17, 2026
Merged
Conversation
The tablets feature shipped with one way to record how big a tablet is: the add form, and only when the compound was already marked as tablets. Everything else arrived without it. A pack added before the compound was described that way, a row entered as an ordinary vial, anything imported: all of them visible on the shelf, none of them countable, and the Log a dose form saying "Add the tablet size to the pack first" with nowhere to do it. So the Stock row offers it. For a pack, and also for an ordinary row of a compound the library calls tablets, which is how such a row becomes a pack at all. It asks for both numbers, because a pack's strengthMg is the mass of the whole pack and is the product of the two, and it says what the row will read once saved, including any dose already taken. When identical vials are grouped it writes to every member, unlike the buttons beside it. Those change one vial's state and the group is meant to split; this changes what the row has always been, and writing it to one member would leave a pack with a size beside a shelf of identical packs without one. The log hint also told two different stories with one sentence. No pack in stock at all and a pack with no size recorded both read as an instruction to go and edit a pack, which in the first case does not exist. Three states, three sentences.
|
Someone is attempting to deploy a commit to the Arun's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Reported straight after the tablets feature went out: the Log a dose form shows Add the tablet size to the pack first, and there is nowhere to add it.
That is right.
mgPerTabletwas only ever written in one place, the add form, and only when the compound was already markedpreparation: "tablet". Every other way a pack can exist arrives without it:All of them are visible on the shelf, none of them can be counted, and the instruction to fix it points at a screen that does not offer it.
What this adds
A Set tablet size button on the Stock row, and a small form under it in the same shape as Reconstitute and Add diluent. Offered for a pack, and also for an ordinary row of a compound the library calls tablets, which is how such a row becomes a pack at all: it writes
container: "pack"along with the size.It asks for both numbers, the size and the tablets in the pack, because
strengthMgon a pack is the mass of the whole pack and is the product of the two. Asking for the size alone would leave the mass saying whatever it said when the row was entered as a vial. The count means the pack as bought, not what is left in it, and the form says so by showing what the row will read once saved, tablets already taken included.When Group identical vials is on it writes to every member of the group, unlike the buttons beside it. Those change one vial's state and the group is meant to split; this changes what the row has always been, and writing it to the oldest alone would leave one pack with a size beside a shelf of identical packs without one.
The hint, split
log_no_tablet_sizewas doing two jobs. No pack of the compound in stock at all, and a pack with no size recorded, both produced the same sentence, and in the first case it asked the reader to go and edit something that does not exist. Three states now say three things: no pack in stock, a pack with no size (pointing at Stock), or the size itself.Checks
npx tsc --noEmitclean,npx next lintclean, 1684 tests pass. No new keys left untranslated: de, sl and pl are written, and the parity test would have failed otherwise.