Repository navigation
Claude/plan enhancements uabf2 - #39
Merged
Merged
Conversation
A supplier offering "25%" and a customer expecting "25%" can mean different money: same profit, different denominator. GP divides it by the selling price, markup by the cost. The button sits beside Quote and opens a two-field dialog where either value drives the other. markup = GP / (100 - GP) GP = markup / (100 + markup) Named to match what is already on screen. This app calls profit÷CP "Margin %", which is markup, so the field says so rather than introducing a third word for the same number. The result is also shown as money — buy at ₹100.00, sell at ₹125.00, profit ₹25.00 — because a percentage on its own is easy to nod along to without picturing it. "Use this calculation" seeds it from whatever is on screen, and hides itself when there is nothing to seed from. Both ends where there is no finite answer are handled rather than left to produce Infinity: a GP of 100% would mean the goods cost nothing, and a markup of -100% would mean selling for nothing. Each says which, in words. Given a switch in Settings → Features like the other header entry points. It is the only stateless feature there — it reads two numbers and stores none — so it has nothing to report or clear when switched off. 36 assertions, including seven GP/markup pairs each checked in both directions, the two undefined ends, and that the seeded markup equals the Margin % the app is showing at the time. Contrast swept in both themes, axe extended to the new dialog. 1442 assertions.
…nd make typing undoable Five changes from review of the main screen. "Disc" was the only abbreviation left on it, on the cost and selling price fields, the Quick-mode cards, the wizard and the what-if scenes. All now read "Discount". In Quick mode the prefix is printed at 20px heading weight — sized for a ₹ or a % — and the longer word took the input from ~180px down to 76px, slicing the hint to "e.g". Word prefixes now get a smaller treatment, and the placeholder is sized as the hint it is rather than as data. "Break-even SP" and "SP at GP floor" are both quoted incl GST, which the row titles said but the labels did not. Both now say so. The control-bar chips were 3px apart, so the row read as one blurred block rather than three separate choices. Chips 7px, groups 14px, and the custom-rate box given the same box as the chips it sits beside. On a phone the three Calculate chips cannot share a line, so the group label now sits level with the first of them instead of floating in the middle, and the divider — which only made sense side by side — is gone. Undo now covers typed values, and every other control. Buttons were undoable only if their handler remembered to call pushUndo, and typing never was. Both are now recorded from the one place every interaction already passes through: delegate() snapshots the state, runs the handler, and compares. Typed values are captured on focus and recorded on blur, so one field edit is one step rather than one per keystroke, and entering a field without changing it records nothing. Comparing serialised snapshots rather than watching individual fields is what makes this safe to apply to every control: anything the app persists is covered automatically, and anything that is not — opening a dialog, switching a Settings tab, the history search box — produces an identical snapshot and records nothing. Two bugs surfaced while testing it: - numStr folded '' into "field absent", so a restore could put a value into a box but never take one back out. Undoing the first entry into a blank field left the number sitting there. - A restored MRP went in as a plain number, so undo left "1000" in a box that reads "1,000" the moment it is typed into. Also drops the two data-focus handlers that pushed an undo entry on focus whether or not anything changed, regenerates the README screenshots — stale on all four counts above — and adds `npm run screenshots` so they cannot silently drift again. 1479 assertions, 0 failures. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vjNhTSno87yfot5BbyX4w
✅ Deploy Preview for sterlingcalc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
No description provided.