Skip to content

Claude/plan enhancements uabf2 - #39

Merged
khaitanvaibhav merged 2 commits into
mainfrom
claude/plan-enhancements-UABF2
Aug 1, 2026
Merged

khaitanvaibhav merged 2 commits into
mainfrom
claude/plan-enhancements-UABF2

Conversation

@khaitanvaibhav

Copy link
Copy Markdown
Contributor

No description provided.

claude added 2 commits August 1, 2026 03:26
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
@netlify

netlify Bot commented Aug 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for sterlingcalc ready!

Name Link
🔨 Latest commit dd66c4b
🔍 Latest deploy log https://app.netlify.com/projects/sterlingcalc/deploys/6a6d76ba1fbc34000826d81b
😎 Deploy Preview https://deploy-preview-39--sterlingcalc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@khaitanvaibhav
khaitanvaibhav merged commit 88375bc into main Aug 1, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants