Repository navigation
Market shares, adjustments and calculations on the landing page - #77
Merged
Merged
Conversation
Add a landing section that explains splitting by shares, signed adjustments and calculations in amount fields, with an example expense whose amounts are computed by the same money allocation the expense form uses, so the figures add up to the total exactly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hero paragraph, the "Spend in your currency" step and the page's meta description described only currency conversion and repayments. Each now says expenses can be split evenly or by shares. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hero's Dinner out example now gives Sam's plus-one two shares and adds Alex's champagne as an adjustment, and Shared home splits electricity by room size with 1.5 shares. Each example has its own caption, and expenses show your share and a note on how they were split. The example data moves to example-splits.ts, which splits each expense with the expense form's calculateShareAmounts and works out repayments with the split page's simplifyDebts instead of hard-coding them. A test checks that every example splits exactly and settles up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each hero example now shows only its total, the expenses with how they were split, and the repayments, instead of a scrolling copy of the split page. All examples share one grid cell so the card keeps the height of the tallest and switching examples does not shift the page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Move expense-amounts from routes/split to domain, since the landing page now uses calculateShareAmounts too. - Split the shares example with calculateShareAmounts instead of a copy of its logic, and correct the comment on the rounding cent. - Calculate the hero examples once at load, drop the balances only the test used, and work them out in the test instead. - Keep repayments at the bottom of the hero card, so shorter examples leave their spare space above them. - Add ExampleFrame, ExampleCard and ExampleCaption components for the styling the hero and shares sections share. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Adds a landing page section that markets splitting expenses by shares, adjustments and calculations, next to the existing currency-conversion and repayment features.
=in an amount field. The arithmetic is exact and rounds once, at the end.SharesExample): a "Birthday dinner" with the total entered as118 + 24.50, split 2/1/1 by shares with +€18 and −€6 adjustments. The figures come fromM.calculateand the expense form's owncalculateShareAmounts, so the rounding cent goes where the app would put it and the amounts add up to €142.50 exactly.expense-amounts.ts(with its test) moves fromroutes/splittodomain, since the landing page now uses it too.ExampleFrame,ExampleCardandExampleCaptioncomponents hold the styling the hero and shares sections share.example-splits.ts. It splits each expense with the expense form'scalculateShareAmountsand works out repayments with the split page'ssimplifyDebts, replacing the hard-coded payments. The examples are calculated once at load.example-splits.test.tschecks that every example splits exactly and settles up, and pins the Dinner out and Shared home figures.smthe Adjustment column header shortens to "Adj." so the table fits at 375px.Verification
pnpm testpasses: common 24, data 88, web 211, infra 27, plus format, lint and types.pnpm --filter @tasan/web devat desktop 1440×1000 and mobile 375×812, in light and dark mode, covering the new section, the hero, the steps and each example split's expense list. Nothing scrolls sideways at 375px. The expense form, which now importsexpense-amountsfromdomain, needs a Cognito login and was not exercised in the browser; type checks and its unit tests cover the move.Known nit: on mobile the short notes under each name, such as "Plus partner", wrap onto two lines.
🤖 Generated with Claude Code