SCIX-846 Fix List Components in Feedback Forms#871
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Risk summary: medium; the blur auto-commit behavior is targeted, but the current implementation can pull focus back into the staging rows after users intentionally move away.
This PR addresses staged feedback-form list inputs that previously lost typed-but-uncommitted values when users blurred away without clicking the add button.
Changes:
- Adds container-level blur handlers to auto-commit valid staged bibcode, URL, and missing-reference entries.
- Uses
contains(relatedTarget)guards to avoid committing while focus moves within the same add row/group. - Adds tests covering blur auto-commit and invalid/in-row focus movement cases.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/components/FeedbackForms/AssociatedArticles/AssociatedArticlesForm.tsx |
Adds blur auto-commit for associated bibcode staging input. |
src/components/FeedbackForms/AssociatedArticles/AssociatedArticlesForm.test.tsx |
Adds tests for associated bibcode blur commit behavior. |
src/components/FeedbackForms/MissingRecord/UrlsField.tsx |
Adds blur auto-commit for the staged URL row. |
src/components/FeedbackForms/MissingRecord/UrlsField.test.tsx |
Adds tests for valid, invalid, and in-row URL blur behavior. |
src/components/FeedbackForms/MissingReferences/MissingReferenceTable.tsx |
Adds blur auto-commit for the staged missing-reference row. |
src/components/FeedbackForms/MissingReferences/MissingReferenceTable.test.tsx |
Adds tests for missing-reference blur commit behavior. |
Comment on lines
+111
to
+112
| if (newReference.citing.length > 0 && newReference.cited.length > 0) { | ||
| handleAddReference(); |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #871 +/- ##
========================================
- Coverage 62.6% 61.2% -1.4%
========================================
Files 324 348 +24
Lines 38203 41371 +3168
Branches 1733 1818 +85
========================================
+ Hits 23905 25281 +1376
- Misses 14257 16046 +1789
- Partials 41 44 +3
🚀 New features to boost your workflow:
|
34cd25d to
b5b7626
Compare
… forms Three feedback form components (AssociatedTable, UrlsTable, MissingReferenceTable) used a staging-input pattern where typed values were silently discarded if the user blurred without clicking the explicit Add button. Single-entry users who typed a value and moved directly to Preview were left with an empty form and no error message. Fix: add container-level onBlur handlers with a `e.currentTarget.contains(e.relatedTarget)` guard to auto-commit staged values when focus leaves the container, while ignoring focus moves between siblings within the same row. Blur-triggered commits skip focus-restore; explicit Add button commits retain it. UrlsField also guards against premature auto-commit when the portaled react-select menu is open (onMenuOpen/onMenuClose flag). Adds unit tests for all three components covering the happy path, partial-fill no-op, and sibling-focus guard.
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.
Feedback forms that use a staging input pattern (type a value, click + to commit) silently
discard the staged value when users blur away without clicking the button. Single-entry
users who type one value and move directly to Preview find the form stuck with the button
disabled and no explanation.
UrlsTable, and the new-reference row in MissingReferenceTable
between siblings within the same row, preventing double-commits when the user clicks the
explicit Add button
Kooha-2026-05-27-14-16-52.webm