PR #100 follow-ups: backpack README + own-art/layout test gaps #103

Closed
opened 2026-07-20 06:26:28 +02:00 by marco · 0 comments
Owner

Follow-ups from the critical review of #100 (backpack own-art + inventory rework). #100 is safe to merge as-is; these are polish items, none blocking.

Scope

  • README contradicts the shipped UIart/gump/container_backpack.README.md still tells the artist the client draws Weapon/Armor equip slots + a visible 4×4 grid "~45% down". #100 removed the equip slots and draws an invisible auto-overlap grid. Update the composition section to the current panel (no equip slots; invisible interior grid; icons overlap past capacity, weight-bounded per #99).
  • Own-art bake: assert pixel values, not just lengthOwnArtTests checks only frame.Pixels.Length. Add an assert on Pixels[0..4] (locks RGBA channel order) and a source PNG with a semi-transparent pixel (alpha 128) asserting alpha survives — the backpack interior is transparent, so this is the property that actually matters.
  • Hit-test boundary/gap untestedBackpackLayoutTests only probes cell centres + a far-outside point (100% branch coverage is misleading). Add: point exactly at TopLeft(0) hits 0; one past (+Icon) misses; a point in the inter-icon gutter returns -1.
  • OwnArt.Anchor static/tree branch uncovered — add a LoadFrame(path, "static/tree_oak") asserting anchor (width/2, height).
  • (optional) Interior grid sits ~39.5% down vs the art pocket (~45-60%); align the interior rect to the painted pocket, or regenerate the art to the code rect.

Definition of Done

  • container_backpack.README.md describes only UI that exists in the code (no equip slots, no visible 4×4 grid); a reader following it composes for the current panel.
  • OwnArtTests fails if the RGBA channel order is swapped or alpha is dropped (demonstrable by mutating the bake to emit BGRA / opaque and watching a test go red).
  • BackpackLayoutTests fails if IndexAt's inclusive-left/exclusive-right boundary or the gap→-1 behaviour regresses.
  • The static/tree anchor branch is exercised by a test.
  • Whole solution builds 0 warnings; dotnet test green.
Follow-ups from the critical review of #100 (backpack own-art + inventory rework). #100 is safe to merge as-is; these are polish items, none blocking. ## Scope - [ ] **README contradicts the shipped UI** — `art/gump/container_backpack.README.md` still tells the artist the client draws Weapon/Armor equip slots + a visible 4×4 grid "~45% down". #100 removed the equip slots and draws an *invisible* auto-overlap grid. Update the composition section to the current panel (no equip slots; invisible interior grid; icons overlap past capacity, weight-bounded per #99). - [ ] **Own-art bake: assert pixel values, not just length** — `OwnArtTests` checks only `frame.Pixels.Length`. Add an assert on `Pixels[0..4]` (locks RGBA channel order) and a source PNG with a semi-transparent pixel (alpha 128) asserting alpha survives — the backpack interior is transparent, so this is the property that actually matters. - [ ] **Hit-test boundary/gap untested** — `BackpackLayoutTests` only probes cell centres + a far-outside point (100% branch coverage is misleading). Add: point exactly at `TopLeft(0)` hits 0; one past (`+Icon`) misses; a point in the inter-icon gutter returns -1. - [ ] **`OwnArt.Anchor` `static/tree` branch uncovered** — add a `LoadFrame(path, "static/tree_oak")` asserting anchor `(width/2, height)`. - [ ] (optional) Interior grid sits ~39.5% down vs the art pocket (~45-60%); align the interior rect to the painted pocket, or regenerate the art to the code rect. ## Definition of Done - `container_backpack.README.md` describes only UI that exists in the code (no equip slots, no visible 4×4 grid); a reader following it composes for the current panel. - `OwnArtTests` fails if the RGBA channel order is swapped or alpha is dropped (demonstrable by mutating the bake to emit BGRA / opaque and watching a test go red). - `BackpackLayoutTests` fails if `IndexAt`'s inclusive-left/exclusive-right boundary or the gap→-1 behaviour regresses. - The `static/tree` anchor branch is exercised by a test. - Whole solution builds 0 warnings; `dotnet test` green.
marco closed this issue 2026-07-22 06:24:20 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marco/IsoMmo#103
No description provided.