fix: table row validation improvements and defensive coding#163
Merged
Conversation
Make isRowFullyEmpty more defensive by explicitly checking for 'answered' state before checking cell values. Unknown/unexpected states are now conservatively treated as NOT empty to avoid accidentally dropping rows with meaningful data. Added tests for malformed cells with unknown states to ensure defensive behavior. Closes mf-ccnu Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace 'strictly more than half' with concrete examples showing that even splits (like 2 of 4) don't trigger warnings, while 1 of 3 or 1 of 4 do trigger warnings. Makes the threshold more immediately clear. Closes mf-21q7 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Group the 4 mostly-empty row warning tests together under a
describe('mostly-empty row warnings') block for better test
organization and readability.
Closes mf-rk6m
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Extract cell emptiness logic into a shared isCellEmpty() helper used by both isRowFullyEmpty() (for row normalization) and validateTableRow() (for sparseness warnings). This ensures consistent definition of 'empty' across the codebase and eliminates logic duplication. Added comprehensive tests for isCellEmpty covering all cell states. Closes mf-33pt Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Remove resolved issue files from .tbd/workspaces/outbox after tbd sync. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
Coverage Report for packages/markform
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses code review findings from PR #161 with defensive coding improvements, refactoring, and documentation clarifications.
Changes
Defensive Coding (P1 Bug Fix):
isRowFullyEmpty()to handle unknown/malformed cell states conservativelyCode Quality (P2 Refactoring):
isCellEmpty()helper function to eliminate duplication betweenisRowFullyEmpty()andvalidateTableRow()isCellEmpty()Documentation (P3 Improvements):
Test Organization (P3):
describe('mostly-empty row warnings')blockTest Results
isCellEmpty())Closed Beads
Related
Follows up on PR #161 code review
🤖 Generated with Claude Code