Repository navigation
Add a Tools menu with a currency converter, rename Margin % to Markup % - #41
Merged
Merged
Conversation
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
✅ 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.
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.
Topens 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 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