Preserve PascalCase comments when appending streamed review comments - #118
Conversation
|
What exactly was the issue, could you share a screenshot of before and after? @sayedrisat |
|
Thanks for asking. This is not a visual/layout change, so I do not have a meaningful before/after screenshot for the root cause. The issue is in the streamed review state helper. Initial review payloads can use the API-style PascalCase field Before this PR, { FilePath: 'a.go', Comments: [{ Content: 'existing' }] }and then a streamed comment arrived for Before: ['streamed'] // existing comment lostAfter: ['existing', 'streamed'] // existing API comment is preserved, streamed comment is appendedI added a regression test for that exact payload shape: appendStreamedCommentsToFiles preserves PascalCase comments from API payloadsValidation I ran:
So the before/after is a state preservation issue rather than a visible styling change: the visible symptom would be comments disappearing after streamed updates, while the test captures the exact failing case. |
|
Thanks for the clear repro and test @sayedrisat |
Summary
Preserves existing PascalCase
Commentsentries when streamed review comments are appended to file payloads.Why
Initial review payloads can use the API-style
Commentsfield while streamed comments are appended into the UI's lowercasecommentsfield. Without preserving both shapes, existing comments can disappear after a streamed update.Validation
node --test internal/staticserve/static/components/review_stream_state.test.mjsnode --test internal/staticserve/static/components/*.test.mjsgit diff --checkNote:
make test-jscould not run locally becausemakeis not installed in this PowerShell environment; the equivalent Node test command from the Makefile passed.