#118 ✨ Create market app with stock and price overview - #128
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (14)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughAdded a Market application with stock and price-board tabs. The implementation aggregates farm holdings, calculates market valuations, supports filtering and sorting, displays seasonal prices, and connects price data through ChangesMarket overview
Estimated code review effort: 4 (Complex) | ~60 minutes Merge Risk: ⚪ Minimal · up to This PR adds the market app and stock/price overview without any supplied merge-blocking concerns; it is merge-ready after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant MarketApp
participant VdtStore
participant MarketPanel
participant StockTable
participant PriceBoard
MarketApp->>VdtStore: collect market and farm state
MarketApp->>MarketPanel: pass five state values
MarketPanel->>StockTable: render stock overview
MarketPanel->>PriceBoard: render price board when prices load
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The implementation satisfies issue Full details: Out of Scope Changes checkExplanation The changes are within scope for issue Full details: Docstring CoverageExplanation Docstring coverage is 40.74% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 108 functions across 12 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
df0ec80 to
1be5aef
Compare
…'s own board
The Market app: two tabs over prices.json, joined with the storage, production
and husbandry channels. Prices is the board itself -- every commodity, the
stations that buy and sell it, and the twelve-month curve behind it. Stock is
the table that reads from it: everything the farm owns, what it would fetch
today and where, and what the year's peak would make of it. Nothing read
TelemetryRepository.prices until now.
ONE LINE PER COMMODITY, however many containers it is spread over. Seed on a
pallet and seed in a big bag is one answer to "how much seed have I got"; the
form moved onto the source, shows as the Type column ("Pallets + Big bags (9)")
and comes apart again in the drill-in, which names every store, how much of the
row is in it and -- where the store states one -- its capacity.
OUTPUTS ONLY. A production point's storage row counts only where a line names
that fill type as an output, and a pen's condition bar only where the game marks
it invertedBar; an input is something you bought and fed in, not stock a trailer
can come and fetch. A type that is both, as flour is to a bakery, is in the set
and counts. The pen half is exact -- PlaceableHusbandryStraw sets the flag false
on the straw it eats and true on the manure it makes. The production half is a
proxy for the loading station's fill types, which are not exported; FUTURE.md
carries what would settle it.
THE BEST MONTH IS PROJECTED, NOT QUOTED. The exported curve is the game's
economy.history, which is the hourly mean across every station accepting the
fill type, so its peak sits below what the best station pays today and printing
it beside that price would show a "maximum" under the current one. What is shown
instead is today's best station carried along the curve's shape,
price x months[peak] / months[now]: the market's shape at this station's level.
A flat curve -- every buy-only fill type has one, because the game never
re-averages what no station accepts -- claims no peak month at all. Expect the
month to sit a period either side of a table built from economy.factors, and see
peakMonth for why that is arithmetic rather than a bug.
Great demand is already inside the price the game reports, so the premium is a
label and never a second multiply. Stock nothing buys -- diesel, fertilizer,
lime -- is unpriced and stays out of the total: the buy price is what a shop
charges to replace it, which is a different question.
Filtering is a multi-token type-ahead rather than a row of chips, because what
this filters on is a defined list that grows with the save: every commodity,
every store, every station on the map. Same kind ORs, different kinds AND, so
two commodities widen and a commodity plus a barn narrows. Nothing is offered
that can only come back empty. Anything the vocabulary does not name becomes a
free-text token, which is what let the separate search box go. Escape leaves the
box: on a tablet in a cab there is often nothing else to tab to.
The whole join keys on the fill type and never on a placeable id, which is what
makes it work unchanged on a multiplayer client.
The amounts are validated -- counted by hand in game, bales included. A
third-party stock mod disagreed and is the one at fault: it ignores bales below
full capacity. The money and the MP client are still unchecked, and are in
FUTURE.md with the rest.
ViewTab moves out of FinancePanel now that it has a second caller.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1be5aef to
6793068
Compare
Resolves #118
Summary by CodeRabbit