Skip to content

Add a Tools menu with a currency converter, rename Margin % to Markup % - #41

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

khaitanvaibhav merged 1 commit into
mainfrom
claude/plan-enhancements-UABF2

Conversation

@khaitanvaibhav

Copy link
Copy Markdown
Contributor

Three changes, and two bugs found on the way.

The discount suffix goes back on one line. Nothing typed into that box runs past six characters, so the input can afford the width. Below 380px, where 264px genuinely cannot hold an 18-character label, a prefix, a number and a next button side by side, the label drops to its own row underneath rather than squeezing the input to 20px.

"Margin %" is now "Markup %" everywhere it is shown — the profit card, the summary, the sticky mobile bar, history, comparison, what-if, the CSV export, the profit-mode tab, the settings floor and the tour. The internal keys are unchanged. The README note that used to explain the naming now says the useful part instead: parts of the trade say "margin" when they mean markup, which is why it is worth asking.

Quote, GP ⇄ Markup and a new currency converter move into a Tools menu in the header. They were three buttons competing with Share, Save, Copy, PDF and Presets for one row. The menu is a disclosure rather than an ARIA menu — the items are ordinary buttons that Tab reaches while it is open, which is how the hamburger already behaves. T opens it, Escape closes it, and the button disappears when all three tools are switched off.

The currency converter converts an amount between any two of the twenty currencies at the same rates the rest of the app uses. Type into either side and the other follows; ⇄ reverses the pair, carrying the converted amount back as the new input. It is deliberately separate from the display-currency setting: that one restates the whole calculation, and this is a scratch pad. Rates are quoted per rupee, so a cross pair goes through the rupee rather than a second lookup, and a missing rate says so instead of showing a blank box.

Two bugs:

  • The solver answered "Enter MRP, CP and SP first" on the first calculation of a session with every box already filled. LAST_CP and LAST_SP were assigned at the end of calc(), but renderSolver runs from fillSummary partway through it, so the first pass solved against the previous (null) prices.
  • The converted amount was cut off at the last digit: ₹20,833.33 in a dialog sized for a yes/no confirmation.

The critical-path budget was already at 99.7KB before any of this, so seventeen things that only run when a user asks for them moved to the deferred bundle — both converters, the preset manager, the text-entry dialog, and the share/copy/PDF/WhatsApp/email exports. The target-GP solver went with them and had to come back: it is called from fillSummary on every calculation, so its shim pulled the bundle straight onto the critical path. A browser test now blocks the bundle outright and checks a first calculation still comes out complete.

That leaves 99.6KB, and Lighthouse is unmoved — 97 performance, LCP 2.5s, TBT 0ms, the same figures as at 92KB. The budget is reset to 105KB with that measurement behind it: it is a drift alarm, and the deferral assertions are the real protection.

1543 assertions, 0 failures.

Claude-Session: https://claude.ai/code/session_014vjNhTSno87yfot5BbyX4w

Three changes, and two bugs found on the way.

The discount suffix goes back on one line. Nothing typed into that box
runs past six characters, so the input can afford the width. Below
380px, where 264px genuinely cannot hold an 18-character label, a
prefix, a number and a next button side by side, the label drops to its
own row underneath rather than squeezing the input to 20px.

"Margin %" is now "Markup %" everywhere it is shown — the profit card,
the summary, the sticky mobile bar, history, comparison, what-if, the
CSV export, the profit-mode tab, the settings floor and the tour. The
internal keys are unchanged. The README note that used to explain the
naming now says the useful part instead: parts of the trade say
"margin" when they mean markup, which is why it is worth asking.

Quote, GP ⇄ Markup and a new currency converter move into a Tools menu
in the header. They were three buttons competing with Share, Save,
Copy, PDF and Presets for one row. The menu is a disclosure rather than
an ARIA menu — the items are ordinary buttons that Tab reaches while it
is open, which is how the hamburger already behaves. `T` opens it,
Escape closes it, and the button disappears when all three tools are
switched off.

The currency converter converts an amount between any two of the twenty
currencies at the same rates the rest of the app uses. Type into either
side and the other follows; ⇄ reverses the pair, carrying the converted
amount back as the new input. It is deliberately separate from the
display-currency setting: that one restates the whole calculation, and
this is a scratch pad. Rates are quoted per rupee, so a cross pair goes
through the rupee rather than a second lookup, and a missing rate says
so instead of showing a blank box.

Two bugs:

- The solver answered "Enter MRP, CP and SP first" on the first
  calculation of a session with every box already filled. LAST_CP and
  LAST_SP were assigned at the end of calc(), but renderSolver runs
  from fillSummary partway through it, so the first pass solved against
  the previous (null) prices.
- The converted amount was cut off at the last digit: ₹20,833.33 in a
  dialog sized for a yes/no confirmation.

The critical-path budget was already at 99.7KB before any of this, so
seventeen things that only run when a user asks for them moved to the
deferred bundle — both converters, the preset manager, the text-entry
dialog, and the share/copy/PDF/WhatsApp/email exports. The target-GP
solver went with them and had to come back: it is called from
fillSummary on every calculation, so its shim pulled the bundle
straight onto the critical path. A browser test now blocks the bundle
outright and checks a first calculation still comes out complete.

That leaves 99.6KB, and Lighthouse is unmoved — 97 performance, LCP
2.5s, TBT 0ms, the same figures as at 92KB. The budget is reset to
105KB with that measurement behind it: it is a drift alarm, and the
deferral assertions are the real protection.

1543 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 92b48a5
🔍 Latest deploy log https://app.netlify.com/projects/sterlingcalc/deploys/6a6d9f4f61bcaf0008c12491
😎 Deploy Preview https://deploy-preview-41--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 125aa47 into main Aug 1, 2026
9 of 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