Implement enhanced Inventory Display with equipment details and item quality indicators #238

Open
opened 2026-03-16 01:40:21 +00:00 by freemo · 0 comments
Owner

Metadata

Key Value
Parent Epic #226 — Skill UI & Commands
Legendary #198 — Character Progression & Skills
Branch feature/m4-enhanced-inventory-display
Commit Message feat(skills): implement enhanced Inventory Display with equipment details and quality indicators
Points 5
Priority Medium
MoSCoW Should Have

Background and Context

The existing inventory display in Aethyr shows a basic list of items. With the introduction of the skill and progression system, equipment becomes more meaningful — items have quality tiers, stat bonuses tied to crafting skill levels, and durability that matters for combat calculations. The enhanced inventory display surfaces this information clearly.

This issue upgrades the inventory command output to show equipment details (stat bonuses, durability, quality tier) and uses color-coded quality indicators following the standard RPG quality tier convention.

Expected Behavior

  1. InventoryRenderer class at lib/aethyr/core/render/inventory_renderer.rb:

    • render(player) — returns an array of strings representing the enhanced inventory display.
  2. Quality Tiers (with color coding):

    • Poor (gray): Base stats, no bonuses.
    • Common (white): Standard items.
    • Uncommon (green): Slight stat bonuses.
    • Rare (blue): Notable stat bonuses.
    • Epic (purple): Significant stat bonuses.
    • Legendary (orange/gold): Maximum stat bonuses.
  3. Inventory Display Format:

    ══════════ INVENTORY ══════════
    Equipped:
      [Weapon] Iron Longsword        [Uncommon]  +5 ATK  Dur: 80/100
      [Armor]  Leather Vest           [Common]    +3 DEF  Dur: 45/50
      [Shield] (empty)
      [Ring]   Silver Band            [Rare]      +2 WIS
      [Amulet] (empty)
    
    Backpack (12/20 slots):
      Iron Ore x5                     [Common]    Material
      Health Potion x3                [Uncommon]  Consumable
      Wolf Pelt x2                    [Common]    Material
      Mysterious Scroll               [Rare]      Quest Item
      Bread x10                       [Poor]      Consumable
    ═══════════════════════════════
    Weight: 34/100 lbs
    Gold: 1,250
    
  4. Features:

    • Equipped Section: Shows each equipment slot with item name, quality tier, primary stat bonus, and durability (current/max) where applicable.
    • Backpack Section: Shows item name, stack count (if stackable), quality tier, and item category.
    • Capacity Indicator: Shows used/total backpack slots.
    • Weight: Total carried weight vs. max capacity.
    • Gold: Current gold amount with thousands separator.
    • Empty slots show "(empty)" in dim text.
  5. Quality Color Coding uses ANSI escape codes:

    • The quality tier tag ([Uncommon], [Rare], etc.) is rendered in the appropriate color.
    • Item names are also tinted by quality.
  6. Command Update:

    • The existing inventory (and aliases inv, i) command uses the new renderer.
    • The old display logic is replaced, not duplicated.

Acceptance Criteria

  • InventoryRenderer class exists at lib/aethyr/core/render/inventory_renderer.rb.
  • render(player) returns correctly formatted inventory output.
  • Equipped section shows all equipment slots with details or "(empty)".
  • Quality tier tags are displayed with correct color coding.
  • Stat bonuses are shown for equipped items.
  • Durability is shown as current/max for items that have it.
  • Backpack section shows items with stack counts, quality, and category.
  • Capacity indicator shows used/total slots.
  • Weight shows current/max with unit.
  • Gold displays with thousands separator.
  • inventory, inv, i commands all use the new renderer.
  • Empty inventory renders cleanly without errors.

Subtasks

  • Create lib/aethyr/core/render/inventory_renderer.rb with the InventoryRenderer class.
  • Implement equipped section rendering with slot labels, item details, and empty slot handling.
  • Implement quality tier color coding using ANSI escape codes.
  • Implement stat bonus formatting for equipped items.
  • Implement durability display as current/max.
  • Implement backpack section with item listing, stack counts, and categories.
  • Implement capacity indicator (used/total slots).
  • Implement weight display (current/max lbs).
  • Implement gold display with thousands separator formatting.
  • Update inventory/inv/i command handlers to use InventoryRenderer.
  • Remove or deprecate old inventory display logic.
  • Handle edge cases: empty inventory, no equipped items, single item, max capacity.
  • Docs: Update YARD comments on affected classes and methods. Update relevant Docusaurus documentation pages if applicable.
  • Tests (Cucumber): Add tests/unit/inventory_renderer.feature covering full inventory rendering, equipped section with items, empty equipment slots, quality tier color coding, stat bonus formatting, durability display, backpack with stacked items, capacity indicator, weight display, gold formatting, empty inventory, command alias handling.
  • Tests (Cucumber Integration): Add integration feature in tests/integration/ for Enhanced inventory display and inventory command interaction.
  • Tests (Profiling): Run bundle exec rake unit_profile and verify no performance regressions.
  • Quality: Verify coverage >=97% via bundle exec rake unit. If coverage is <97% then review the current unit test coverage report at build/tests/unit/coverage/ and use it to write new Cucumber based unit tests to improve code coverage. Specifically, write Cucumber/Gherkin style unit tests that are descriptively named and specifically improve coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun bundle exec rake unit to verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%.
  • Quality: Run bundle exec rake (default task: unit tests with coverage) and bundle exec rake integration, fix any errors if needed ensuring both pass across entire code base, do not ignore any failure even if it seems unrelated to this commit, fix it.

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
## Metadata | Key | Value | |-----|-------| | **Parent Epic** | #226 — Skill UI & Commands | | **Legendary** | #198 — Character Progression & Skills | | **Branch** | `feature/m4-enhanced-inventory-display` | | **Commit Message** | `feat(skills): implement enhanced Inventory Display with equipment details and quality indicators` | | **Points** | 5 | | **Priority** | Medium | | **MoSCoW** | Should Have | ## Background and Context The existing inventory display in Aethyr shows a basic list of items. With the introduction of the skill and progression system, equipment becomes more meaningful — items have quality tiers, stat bonuses tied to crafting skill levels, and durability that matters for combat calculations. The enhanced inventory display surfaces this information clearly. This issue upgrades the `inventory` command output to show equipment details (stat bonuses, durability, quality tier) and uses color-coded quality indicators following the standard RPG quality tier convention. ## Expected Behavior 1. **InventoryRenderer** class at `lib/aethyr/core/render/inventory_renderer.rb`: - `render(player)` — returns an array of strings representing the enhanced inventory display. 2. **Quality Tiers** (with color coding): - **Poor** (gray): Base stats, no bonuses. - **Common** (white): Standard items. - **Uncommon** (green): Slight stat bonuses. - **Rare** (blue): Notable stat bonuses. - **Epic** (purple): Significant stat bonuses. - **Legendary** (orange/gold): Maximum stat bonuses. 3. **Inventory Display Format:** ``` ══════════ INVENTORY ══════════ Equipped: [Weapon] Iron Longsword [Uncommon] +5 ATK Dur: 80/100 [Armor] Leather Vest [Common] +3 DEF Dur: 45/50 [Shield] (empty) [Ring] Silver Band [Rare] +2 WIS [Amulet] (empty) Backpack (12/20 slots): Iron Ore x5 [Common] Material Health Potion x3 [Uncommon] Consumable Wolf Pelt x2 [Common] Material Mysterious Scroll [Rare] Quest Item Bread x10 [Poor] Consumable ═══════════════════════════════ Weight: 34/100 lbs Gold: 1,250 ``` 4. **Features:** - **Equipped Section**: Shows each equipment slot with item name, quality tier, primary stat bonus, and durability (current/max) where applicable. - **Backpack Section**: Shows item name, stack count (if stackable), quality tier, and item category. - **Capacity Indicator**: Shows used/total backpack slots. - **Weight**: Total carried weight vs. max capacity. - **Gold**: Current gold amount with thousands separator. - Empty slots show "(empty)" in dim text. 5. **Quality Color Coding** uses ANSI escape codes: - The quality tier tag (`[Uncommon]`, `[Rare]`, etc.) is rendered in the appropriate color. - Item names are also tinted by quality. 6. **Command Update:** - The existing `inventory` (and aliases `inv`, `i`) command uses the new renderer. - The old display logic is replaced, not duplicated. ## Acceptance Criteria - [ ] `InventoryRenderer` class exists at `lib/aethyr/core/render/inventory_renderer.rb`. - [ ] `render(player)` returns correctly formatted inventory output. - [ ] Equipped section shows all equipment slots with details or "(empty)". - [ ] Quality tier tags are displayed with correct color coding. - [ ] Stat bonuses are shown for equipped items. - [ ] Durability is shown as current/max for items that have it. - [ ] Backpack section shows items with stack counts, quality, and category. - [ ] Capacity indicator shows used/total slots. - [ ] Weight shows current/max with unit. - [ ] Gold displays with thousands separator. - [ ] `inventory`, `inv`, `i` commands all use the new renderer. - [ ] Empty inventory renders cleanly without errors. ## Subtasks - [ ] Create `lib/aethyr/core/render/inventory_renderer.rb` with the `InventoryRenderer` class. - [ ] Implement equipped section rendering with slot labels, item details, and empty slot handling. - [ ] Implement quality tier color coding using ANSI escape codes. - [ ] Implement stat bonus formatting for equipped items. - [ ] Implement durability display as current/max. - [ ] Implement backpack section with item listing, stack counts, and categories. - [ ] Implement capacity indicator (used/total slots). - [ ] Implement weight display (current/max lbs). - [ ] Implement gold display with thousands separator formatting. - [ ] Update `inventory`/`inv`/`i` command handlers to use `InventoryRenderer`. - [ ] Remove or deprecate old inventory display logic. - [ ] Handle edge cases: empty inventory, no equipped items, single item, max capacity. - [ ] Docs: Update YARD comments on affected classes and methods. Update relevant Docusaurus documentation pages if applicable. - [ ] Tests (Cucumber): Add `tests/unit/inventory_renderer.feature` covering full inventory rendering, equipped section with items, empty equipment slots, quality tier color coding, stat bonus formatting, durability display, backpack with stacked items, capacity indicator, weight display, gold formatting, empty inventory, command alias handling. - [ ] Tests (Cucumber Integration): Add integration feature in `tests/integration/` for Enhanced inventory display and inventory command interaction. - [ ] Tests (Profiling): Run `bundle exec rake unit_profile` and verify no performance regressions. - [ ] Quality: Verify coverage >=97% via `bundle exec rake unit`. If coverage is <97% then review the current unit test coverage report at `build/tests/unit/coverage/` and use it to write new Cucumber based unit tests to improve code coverage. Specifically, write Cucumber/Gherkin style unit tests that are descriptively named and specifically improve coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun `bundle exec rake unit` to verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%. - [ ] Quality: Run `bundle exec rake` (default task: unit tests with coverage) and `bundle exec rake integration`, fix any errors if needed ensuring both pass across **entire** code base, do not ignore any failure even if it seems unrelated to this commit, fix it. ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done.
freemo added this to the v1.3.0 milestone 2026-03-16 01:40:21 +00:00
freemo self-assigned this 2026-03-16 01:40:21 +00: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.

Reference: aethyr/Aethyr#238
No description provided.