fix(redis-stream): map displayed row index to valueList correctly in handleCellChange - #2165
fix(redis-stream): map displayed row index to valueList correctly in handleCellChange#2165Aias00 wants to merge 1 commit into
Conversation
|
The filtered-index traversal is a plausible fix, but this PR is not ready to merge without regression coverage for the mapping contract. Please add automated tests that prove the exact underlying row is updated when deleted rows occur before the target and between visible rows, and include existing |
Rebased + tests addedRebased onto the latest Changes
Each test asserts the exact underlying row is mapped — no neighboring or deleted row is returned. The Run: |
7a3deb6 to
26ca683
Compare
openai0229
left a comment
There was a problem hiding this comment.
The mapping revision is much better and the focused cases are useful. One blocker remains: the new test is not executed by Community CI. The workflow runs an explicit list of frontend test scripts and never invokes test:create-stream-index, so the green check currently proves lint and build but not this regression contract. Please add this script to .github/workflows/ci.yml, rebase onto current main, and rerun CI.
…handleCellChange handleCellChange used valueList.slice(0, index+1).filter(DELETE).length to map a displayed (filtered) index back to valueList, but this formula only counts DELETE rows in the first index+1 elements — not all DELETE rows before the displayed row. Edits landed on the wrong row (or a DELETE row) and were silently lost. Walk valueList counting non-DELETE rows until the index-th one, mirroring handleDelete's accumulation. Fixes OtterMind#2161 Co-Authored-By: Claude <noreply@anthropic.com>
26ca683 to
c5d28ba
Compare
|
Added the |
Related issue
Closes #2161
Summary
CreateStream renders a filtered table (valueList.filter(item => item.action !== DELETE)) but handleCellChange mapped the displayed index back to valueList using valueList.slice(0, index+1).filter(DELETE).length — a formula that only counts DELETE rows in the first index+1 elements, not all DELETE rows before the displayed row. The realIndex was wrong, so edits landed on the wrong row (or a DELETE row) and were silently lost. Rewrote the mapping to walk valueList counting non-DELETE rows until the index-th one, mirroring handleDelete's accumulation approach.
Verification
Contributor declaration
AI assistance: The fix, verification, and PR description were produced with Claude Code assistance.