Skip to content

teams page: show a team's total live cost, as a figure of its own - #1916

Draft
ZeroPoint95 wants to merge 1 commit into
devfrom
zeropoint95/1878-teams-page-show-a-team-s-total-live-cost
Draft

ZeroPoint95 wants to merge 1 commit into
devfrom
zeropoint95/1878-teams-page-show-a-team-s-total-live-cost

Conversation

@ZeroPoint95

Copy link
Copy Markdown
Collaborator

Changes

  • The teams page draws a team's own total live cost — all time, every team under it, whole conversation chains, and money following the conversation across membership changes — on each rail row, in the selected team's pane body, and in the Settings card beside each member's share, with the $1.20 of $5 today cap reading left alone in the header strip.
  • A new Teams.Total delegation door behind the additive Welcome.TeamsTotal flag answers the same stamp as the day's spend so a quiet ledger costs no read, and Member.LeftAt is stamped at removal so the team keeps a former member's spend while they were in it and nothing after; a removal written before the field existed counts from JoinedAt on.
  • Store and draw tests cover the whole definition — subtree roll-up counting each conversation once at the root, sub-task chains of any depth landing on the owning member, exact same-day [JoinedAt, LeftAt) and Made boundaries from per-line runs, and a ledger that appears after a missing read folding instead of panicking — and every changed package builds clean under go vet, gofmt and the full test suite.
  • Final change: 19 files, +1043/−17.

Closes #1878.

Validation

  • Passed locally: cd . && go test ./internal/tui3/ -run 'TeamsRailRowCarriesTheTeamsOwnTotal|TeamsPaneBodyDrawsTheTotalBesideTheDaysSpend|TeamsSettingsCardShowsTheTotalAndThePerMemberShare|TeamsWithNoTotalDoorDrawsNoTotals|TestLowCreditReadSwapsOnlyAnUntouchedImplicitConversation' -count=1 -v 2>&1 | grep -E '^(--- PASS|--- FAIL|ok |FAIL)' ; echo "target-exit=$?".
  • Passed locally: cd . && go test ./internal/teams/ -run 'TestTeamTotalWholeChainsMembershipAndSubtree|TestTeamTotalOfALedgerThatAppearsAfterAMissingRead|TestTeamTotalLegacyFormerMemberWithoutLeftAtCountsFromJoinedAt|TestRemoveMemberStampsLeftAt|TestMemberLeftAtRoundTripKeepsUnknownFields' -count=1 -v 2>&1 | grep -E '^(--- PASS|--- FAIL|ok |FAIL)'; echo "named-exit=$?".
  • Passed locally: tail -3 /tmp/proof-tui3-full.log && grep -c '^--- FAIL' /tmp/proof-tui3-full.log; echo "---"; cd . && go test ./cmd/codeaf/ -run 'TestTheTotalDoorCrossesHostOnlyWhenTheEngineSaysSo|TestAnOlderEngineGetsNoTeamsSeam' -count=1 -v 2>&1 | grep -E '^(--- PASS|--- FAIL|ok |FAIL)'; echo "doors-exit=$?".
  • Proof · 8 of 8 claims shown locally. GitHub CI is checked after publishing.
  • ✓ The definition holds in code and proof: the 14-line one-day fixture totals harbor $8.60 (8 calls), sub $3.00 (before-JoinAt excluded), twins $2.00 (a conversation in two teams counts in each), root $9.20 with e's line counted once in the root, exact same-day half-open [10:00,13:00) boundary (13:00 excluded), Made floor (07:30 and 06:30 excluded), whole chains (a's task and its sub-task land on a: $1.35), ByMember sums equal USD, an unknown team totals $0, and a quiet ledger costs no re-read (spendCache.bytes() unchanged) — all asserted in TestTeamTotalWholeChainsMembershipAndSubtree and passing.
  • ✓ RemoveMember stamps LeftAt while keeping JoinedAt; SetManager/SetHome never move it (a replaced manager stays a Member); left_at survives marshal/unmarshal and unknown fields round-trip — TestRemoveMemberStampsLeftAt and TestMemberLeftAtRoundTripKeepsUnknownFields pass.
  • ✓ The draw surface is proven: the rail row carries the team's own $67.46/$12 and never the cap's 'of $' figure; the pane body draws total $67.46 · $1.20 of $5 today for an open team and total $67.46 · $1.20 today for a closed one while the strip keeps the cap piece; the Settings card draws 'Total cost $67.46' plus each member's share including a former member's ($1.99 under @gone); and over a seam without the Total door (older engine) the page asks for, folds and draws no totals while the day's spend still crosses.

by codeaf factory

Factory-Approval: evt_24be7e0f @ZeroPoint95 a1eb97e

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.

teams page: show a team's total live cost, as a figure of its own

1 participant