fix(ui): key user-editable lists by index, not value #102

Merged
zaelgohary merged 1 commit from fix/dup-key-101 into development 2026-04-21 12:56:37 +00:00
Member

Summary

User-editable lists (tags, acceptance criteria, deliverables) used each item's string value as its Dioxus key. Duplicate values collided and Dioxus 0.7's keyed-diff hard-asserts on unique keys, crashing the WASM with an unreachable trap on the next re-render (e.g. when deleting a story with duplicate acceptance criteria). Switch those loops to enumerate-based keys.

Closes #101

Changes

  • archipelagos/productivity/stories/src/views/story_detail_view.rs
    • acceptance-criteria loop: key by enumerate index
  • archipelagos/productivity/sprints/src/views/milestone_detail_view.rs
    • deliverables loop: key by enumerate index
  • archipelagos/productivity/tasks/src/views/task_detail_view.rs
    • tags loop: key by enumerate index
  • archipelagos/productivity/tasks/src/views/task_item.rs
    • tags-badges loop: key by enumerate index
  • archipelagos/productivity/projects/src/views/project_detail_view.rs
    • tags loop: key by enumerate index

Test Results

  • cargo check -p hero_archipelagos_{tasks,stories,projects,sprints}: pass
  • cargo fmt: pass

UI-only change; logic covered by manual verification below.

Manual verification

  • Create a story with acceptance_criteria = ["a", "b", "a"], open detail, click Delete — no panic, story removed
  • Create a task with tags ["bug", "ui", "bug"], open detail — renders without console error
  • Create a milestone with deliverables = ["x", "x"], open detail — renders cleanly
  • Regression: single-value lists (no duplicates) still render + reorder correctly
## Summary User-editable lists (tags, acceptance criteria, deliverables) used each item's string value as its Dioxus `key`. Duplicate values collided and Dioxus 0.7's keyed-diff hard-asserts on unique keys, crashing the WASM with an `unreachable` trap on the next re-render (e.g. when deleting a story with duplicate acceptance criteria). Switch those loops to enumerate-based keys. ## Related Issue Closes https://forge.ourworld.tf/lhumina_code/hero_archipelagos/issues/101 ## Changes - `archipelagos/productivity/stories/src/views/story_detail_view.rs` - acceptance-criteria loop: key by enumerate index - `archipelagos/productivity/sprints/src/views/milestone_detail_view.rs` - deliverables loop: key by enumerate index - `archipelagos/productivity/tasks/src/views/task_detail_view.rs` - tags loop: key by enumerate index - `archipelagos/productivity/tasks/src/views/task_item.rs` - tags-badges loop: key by enumerate index - `archipelagos/productivity/projects/src/views/project_detail_view.rs` - tags loop: key by enumerate index ## Test Results - `cargo check -p hero_archipelagos_{tasks,stories,projects,sprints}`: pass - `cargo fmt`: pass UI-only change; logic covered by manual verification below. ## Manual verification - [ ] Create a story with `acceptance_criteria = ["a", "b", "a"]`, open detail, click Delete — no panic, story removed - [ ] Create a task with tags `["bug", "ui", "bug"]`, open detail — renders without console error - [ ] Create a milestone with `deliverables = ["x", "x"]`, open detail — renders cleanly - [ ] Regression: single-value lists (no duplicates) still render + reorder correctly
fix(ui): key user-editable lists by index, not value (#101)
All checks were successful
Build and Test / build (pull_request) Successful in 5m57s
c3aebab0c9
Tags, acceptance criteria and deliverables used each item string as its
Dioxus key. Duplicate values collide and the 0.7 diff hard-asserts on
unique keys, crashing the WASM on the next re-render. Switch those loops
to enumerate-based keys so duplicate user input no longer freezes the UI.
zaelgohary merged commit f1320496ad into development 2026-04-21 12:56:37 +00:00
zaelgohary deleted branch fix/dup-key-101 2026-04-21 12:56:37 +00:00
Sign in to join this conversation.
No reviewers
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
lhumina_code/hero_archipelagos!102
No description provided.