8000 Market shares, adjustments and calculations on the landing page by Hilzu · Pull Request #77 · Hilzu/tasan · GitHub
[go: up one dir, main page]

Skip to content

Market shares, adjustments and calculations on the landing page - #77

Merged
Hilzu merged 5 commits into
mainfrom
landing-shares
Nov 6, 2026
Merged

Hilzu merged 5 commits into
mainfrom
landing-shares

Conversation

@Hilzu
@Hilzu Hilzu commented Nov 6, 2026 •
Copy link
Copy Markdown
Owner

Summary

Adds a landing page section that markets splitting expenses by shares, adjustments and calculations, next to the existing currency-conversion and repayment features.

  • Copy: "Not every split is even. Every cent still adds up." Three points follow:
    • Shares: any weight, decimals included.
    • Adjustments: applied first, then the rest is split by shares.
    • Calculations: tap = in an amount field. The arithmetic is exact and rounds once, at the end.
  • Example card (SharesExample): a "Birthday dinner" with the total entered as 118 + 24.50, split 2/1/1 by shares with +€18 and −€6 adjustments. The figures come from M.calculate and the expense form's own calculateShareAmounts, so the rounding cent goes where the app would put it and the amounts add up to €142.50 exactly.
  • Copy elsewhere on the page: the hero paragraph, the "Spend in your currency" step and the meta description now say expenses can be split "evenly or by shares". The headline, the eyebrow and the two feature columns are unchanged.
  • Hero example splits: "Dinner out" gives Sam's plus-one two shares and adds Alex's champagne as an adjustment. "Shared home" splits electricity by room size (Alex 1.5 shares), which leaves a rounding cent for the payer. "Weekend away" is still an even split about currencies. Each example has its own caption.
  • Compact hero examples: each example now shows only its total, the expenses with a note on how each was split, and the repayments, so nothing needs scrolling. All three share one grid cell, which keeps the card the same height when you switch examples. Repayments sit at the bottom of the card, so shorter examples leave their spare space above them.
  • Shared pieces: expense-amounts.ts (with its test) moves from routes/split to domain, since the landing page now uses it too. ExampleFrame, ExampleCard and ExampleCaption components hold the styling the hero and shares sections share.
  • Example data moved to example-splits.ts. It splits each expense with the expense form's calculateShareAmounts and works out repayments with the split page's simplifyDebts, replacing the hard-coded payments. The examples are calculated once at load. example-splits.test.ts checks that every example splits exactly and settles up, and pins the Dinner out and Shared home figures.
  • Mobile: below sm the Adjustment column header shortens to "Adj." so the table fits at 375px.

Verification

  • pnpm test passes: common 24, data 88, web 211, infra 27, plus format, lint and types.
  • Checked in the browser against pnpm --filter @tasan/web dev at 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 imports expense-amounts from domain, needs a Cognito login and was not exercised in the browser; type checks and its unit tests cover the move.
  • Screenshots of every view in all four combinations were shared in the authoring session. They aren't attached here.

Known nit: on mobile the short notes under each name, such as "Plus partner", wrap onto two lines.

🤖 Generated with Claude Code

Hilzu and others added 5 commits November 6, 2026 15:45
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>
@Hilzu
Hilzu merged commit 287273e into main Nov 6, 2026
1 check passed
@Hilzu
Hilzu deleted the landing-shares branch November 6, 2026 14:17
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.

1 participant

0