Skip to content

content: total value counts the units each screen is about (shelf.nu#2823) - #233

Merged
carlosvirreira merged 2 commits into
mainfrom
content-update/pr-2823-per-surface-asset-value
Aug 11, 2026
Merged

content: total value counts the units each screen is about (shelf.nu#2823)#233
carlosvirreira merged 2 commits into
mainfrom
content-update/pr-2823-per-surface-asset-value

Conversation

@carlosvirreira

@carlosvirreira carlosvirreira commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Triggered by

  • shelf.nu PR #2823: feat(companion): QUANTITY_TRACKED display parityView PR
  • shelf.nu PR #2832: fix: SSR crash on qr link-to-kit + friendly 429 boundaryView PR (analysed, no content change needed, see Review notes)

Product change summary

#2823 fixed the last surface that was multiplying a quantity-tracked asset's per-unit value by the wrong count: the Companion app's kit screen was showing valuation × workspace stock instead of valuation × units in this kit. That server change ships with a normal webapp deploy, so live 1.2.0 installs get the corrected number without an app update.

Checking our own copy against that, the site was telling the same story the code used to: one quantity-aware total flowing through everything. It isn't one total. Each surface multiplies by the count that surface is about, and the site named "the quantity on hand" for all of them, which overstates kit, booking, custody and overdue figures by the size of the whole pool.

Content changes

Factual corrections

  • content/knowledge-base/quantity-tracked-assets-and-consumables.mdx — replaced the single "Total value counts every unit" paragraph with a per-surface table. Was: "Shelf multiplies it by the quantity on hand… That total flows through everywhere value is summed: the dashboard inventory-value tile, location and kit totals, a booking's total asset value (including the pull-list PDF), the value-based reports, and CSV exports." A booking of 5 cables from a 100-cable pool shows €10, not €200. Also added that a standard export carries Value (per-unit) and Total value (quantity-aware) side by side, while the import-ready export carries only the per-unit price.
  • content/updates/quantity-aware-asset-value.mdx — the 2026-07-02 changelog entry carried the same enumeration in its body and its description. Rewritten to name the count each surface uses, with a deep link to the new KB section. Date left at 2026-07-02: the entry is still about the same release.

Verified against source, not the PR body

Surface Multiplier Source
Dashboard tile, Asset Inventory / Distribution, Idle Assets, export Total value column Asset.quantity (workspace stock) utils/asset-value.ts getAssetTotalValue, modules/reports/helpers.server.ts:1708, utils/csv.server.ts total_value
Kit overview total AssetKit.quantity routes/_layout+/kits.$kitId.overview.tsx:94
Booking total value + pull-list PDF BookingAsset.quantity modules/booking/pdf-helpers.ts:261
Custody Snapshot report Custody.quantity modules/reports/helpers.server.ts:1913
Overdue Items value at risk booked units still out modules/reports/helpers.server.ts:1269

Column labels confirmed in modules/asset-index-settings/helpers.ts: valuation renders as Value, the synthetic export-only column as Total value.

No changelog entry, deliberately

Nothing shipped for a reader to notice. #2823's mobile half (low-stock badge, per-member kit quantity, per-slice booking rows) is not reachable by anyone yet: both stores are on 1.2.0, built 2026-07-22 with channel: None, so no installed binary can take an OTA update. Its server half is a silent correction to a number in one mobile screen. #2832 is two crash/error-presentation fixes. Both sit below the changelog bar.

Review notes

  • Location totals are deliberately absent from the table. modules/location/service.server.ts:693 sums value × Asset.quantity over every asset joined to the location pivot, so a pool of 100 cables split 60 in the stockroom and 40 in the van reports the full €200 at both locations. That looks like a bug rather than a convention, so I did not write it down as behaviour. Flagged for the app team instead. The previous copy said "location and kit totals" without distinguishing them.
  • #2823's own body suspected the web kit total shared the mobile bug. It does not. kits.$kitId.overview.tsx:94 already multiplies by AssetKit.quantity, with a comment saying so. Worth telling whoever picks up that follow-up.
  • Nothing added about the new mobile surfaces. The site does not currently claim low-stock badges or per-slice booking rows in the app, and it should not until 1.3.0 is on the stores. No premature claim to walk back.
  • #2832 produced no content change. The /qr/:qrId/link/kit SSR crash broke a flow two KB articles document (fixing-incorrectly-assigned-qr-stickers.mdx step 5, "Link to an existing kit"), but only on a hard load of that URL: reaching it by clicking from the unlinked-QR page is a client-side navigation, where the client bundle has the function. The articles describe the flow correctly and now describe it reliably. The new 429 screen ("Too many requests… wait a moment, then refresh") is not documented anywhere and does not need to be.
  • verify-content-render.mjs needs a build, so CI is the first place it runs here. check-product-claims.mjs passes locally (539 files). No screenshots: nothing new in the UI to capture.

Impact scope

  • End users affected: anyone reading a kit, booking, custody or overdue total for pooled stock and reconciling it against the dashboard
  • Prospects affected: nobody directly. No marketing page carried the claim, and no comparison page engages on value arithmetic
  • Pages modified: 2
  • Pages created: 0
  • Pages flagged for review: 1 (location totals, for the app team)

Generated by Shelf Content Intelligence — PR→Website Sync

Summary by CodeRabbit

  • Documentation
    • Clarified how asset values are calculated across stock, kits, bookings, custody, overdue items, dashboards, reports, and exports.
    • Documented the distinction between per-unit value and quantity-aware total value.
    • Clarified that standard exports include both per-unit and total values, while import-ready exports retain per-unit values only.
    • Updated the relevant documentation and release note dates.

…2823)

Triggered by: Shelf-nu/shelf.nu#2823

The quantity-value copy claimed one quantity-aware total flowing through
every surface, multiplied by 'the quantity on hand'. Verified against
source: kit totals multiply by AssetKit.quantity, booking totals and the
pull-list PDF by BookingAsset.quantity, Custody Snapshot by
Custody.quantity, Overdue value-at-risk by booked units still out. Only
the dashboard tile, Asset Inventory / Distribution / Idle Assets and the
export's Total value column use workspace stock. Replaced the sentence
with a per-surface table and corrected the changelog entry that carried
the same enumeration.
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

Preview deployment

https://04b61af0.shelf-nu.pages.dev

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@carlosvirreira, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 56bfab7b-82d1-4dd0-8e27-3bcabdac7bd2

📥 Commits

Reviewing files that changed from the base of the PR and between f64c555 and 346b33a.

📒 Files selected for processing (1)
  • content/updates/quantity-aware-asset-value.mdx

Walkthrough

The documentation defines quantity-aware asset value calculations for inventory, kits, bookings, custody, overdue items, reports, and CSV exports. It distinguishes per-unit values from quantity-based totals and updates the related release description.

Changes

Quantity-aware asset value documentation

Layer / File(s) Summary
Document quantity-aware value rules
content/knowledge-base/quantity-tracked-assets-and-consumables.mdx
The article now defines context-specific quantities for totals and distinguishes standard exports from import-ready exports.
Publish the value calculation update
content/updates/quantity-aware-asset-value.mdx
The release update summarizes quantity-aware totals across operational views and CSV exports, and links to the detailed documentation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: total value calculations now account for the units represented on each screen.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch content-update/pr-2823-per-surface-asset-value

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@content/updates/quantity-aware-asset-value.mdx`:
- Around line 12-14: Update the release entry’s CSV export paragraph to
distinguish Standard and Import-ready exports: preserve that Standard CSVs
include per-unit Value and quantity-aware Total value, and state that
Import-ready CSVs include only per-unit Value. Keep the re-import contract clear
and retain the surrounding quantity behavior unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e89a5f94-70c4-4114-8070-2fdee0bbe004

📥 Commits

Reviewing files that changed from the base of the PR and between 8c2ed02 and f64c555.

📒 Files selected for processing (2)
  • content/knowledge-base/quantity-tracked-assets-and-consumables.mdx
  • content/updates/quantity-aware-asset-value.mdx

Comment thread content/updates/quantity-aware-asset-value.mdx Outdated
… the changelog entry

Answers CodeRabbit: the update entry described the standard export's two
value columns but not the import-ready export, which carries only the
per-unit price. The KB section already had both halves.
@carlosvirreira

Copy link
Copy Markdown
Contributor Author

Addressed CodeRabbit's finding in 346b33a: the changelog entry now names the import-ready export's per-unit-only Value column alongside the standard export's two columns. Grepped the PR's other file for the same gap per usual practice; the KB section already carried both halves, so no sibling fix was needed.

Verified column labels in apps/webapp/app/modules/asset-index-settings/helpers.ts: valuation renders as Value, and the export-only synthetic total_value as Total value. The import-ready builder (apps/webapp/app/utils/import-ready-export.server.ts) emits a valuation header and no total column.

@carlosvirreira
carlosvirreira merged commit 7c2bf19 into main Aug 11, 2026
3 checks passed
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