Repository navigation
Claude/plan enhancements uabf2 - #38
Merged
Merged
Conversation
Ran the Lighthouse audit. Performance reads 97 against the 98 recorded earlier; one run in five reported 77 with 740ms TBT, which the medians say is this machine rather than the app. The real finding was in the bundles. The README has described app-extra.js as holding "what-if, compare, quote, onboarding" for some time, but only quote, Quick mode and the wizard were actually there. renderWhatIf (7.5KB), renderCompare (5.5KB) and exportHistoryCSV (1.4KB) had drifted into the core bundle — two dialogs and a download behind a button, none reachable on first paint. Moved, using acorn boundaries rather than brace matching. Critical path 96.0KB -> 92.4KB gzipped; deferred share 20.0% -> 25.8%. Onboarding stayed put. It moved cleanly but obRender and OB_STEP did not come with it, and half-moving a cluster for 1.9KB is not worth the entanglement. Verified the cold path in a real browser rather than trusting jsdom, where both bundles are inlined and the shims are never exercised. The first attempt proved nothing: the service worker served app-extra.js from cache, bypassing route interception, so the implementation was already present. With service workers blocked it reads undefined at load, the what-if grid is empty while the bundle is in flight, and fills to three cards with figures once it lands. Compare and CSV export both work. No page errors. Added a guard naming each moved function, so a future move back fails here rather than quietly costing 14KB, plus a ceiling on the gzipped critical path. Two audits score zero by choice and the README now says so: unminified JS is the no-build-step trade, and unused JS is mostly the deferred bundle being warmed during idle so first use is instant. The dominant main-thread cost is Style & Layout at ~325ms against 70ms of scripting — 1,043 nodes, 809 CSS rules and thirteen :has() selectors, which exist to show a keyboard-only focus ring. 1387 assertions.
The previous commit pushed the code but its README edit aborted partway on a line that had already been reworded, so the docs went in stale — still claiming Performance 98, LCP 2.1s and onboarding in the deferred bundle. Now says what the audit actually measured: Performance 97, LCP 2.5s, TBT 0–10ms, and that a single TBT reading is worth little here — one run in five reported 740ms against a median of 0. Also records what the audit taught rather than only the scores. The dominant main-thread cost is Style & Layout at ~325ms against 70ms of scripting: 1,043 nodes, 809 CSS rules, thirteen :has() selectors. And the two audits that score zero do so by choice — unminified JS is the no-build-step trade, unused JS is mostly the deferred bundle being warmed during idle.
Indexing is on. Removing the noindex alone would have scored 100 while leaving metadata that described the wrong thing — the title, description and share cards all said "automotive parts distribution, Sterling Spares", which is not what someone searching for a margin calculator is looking for. They now say what the tool does. Added a canonical URL, og:image and og:url so a shared link renders, a robots.txt and a sitemap. SEO 60 -> 100. The tour was the bigger problem. It was a feature list — "Default Mode", "Summary & What-If" — that assumed you already knew what MRP, GP% and an incentive were, and its first line said the app was built for one company. That is fine for a colleague and useless to a stranger from a search result, who is now the likeliest visitor. Six steps, rewritten to explain rather than enumerate: what the sum is, the sum on real numbers, the off-invoice rebates that catch people out, that GP % and Margin % are different figures, that the tax rate and currency are yours to set, and where the rest lives. Step two offers to fill the example in. An empty calculator teaches nothing and a newcomer will not invent numbers to try, so the tour now has something to point at and the screen is already working when it ends. Every figure the copy quotes is asserted against what the app renders — 150 of profit, 20.00% GP, 25.00% margin, and 168 once the two incentives are on. A tour that misstates the numbers is worse than no tour. Those four assertions failed first time at $149.20 and 19.90%, which was leftover state from an earlier block rather than bad copy: freshCalc resets neither the display currency nor the landed-cost fields, and 0.80 of outbound freight was still set. Also removed a placeholder assertion I had left returning true, and the stale "SEO is capped by noindex" note the audit script still printed. Service worker cache bumped so the new markup replaces the old. 1406 assertions. Performance 97, Accessibility 100, Best Practices 100, SEO 100.
✅ 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.