Fix category rules regressions from the contextual Category rules section - #97729
Open
Krishna2323 wants to merge 4 commits into
Open
Fix category rules regressions from the contextual Category rules section#97729Krishna2323 wants to merge 4 commits into
Krishna2323 wants to merge 4 commits into
Conversation
…tion Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Krishna2323
marked this pull request as ready for review
August 3, 2026 21:10
melvin-bot
Bot
requested review from
heyjennahay and
situchan
and removed request for
a team
August 3, 2026 21:10
This was referenced Aug 3, 2026
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b1f329d57
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
…rules test Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
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.
Explanation of Change
This PR fixes three regressions introduced by the contextual Category rules section in the category details RHP.
1. Creating a rule didn't preload existing category settings
Creating a new Field requirements or Flag for review rule opened an empty form, even when the category already had that rule.
Since both rule types are limited to one per category, re-selecting the same values counted as no change:
The Add pages now pass
categoryNamewhenever the category already has that rule, so the form is prefilled the same way as when editing from the category RHP. They continue passinginitialCategoryName, so saving still returns to the category details page instead of the New rule hub.2. Optimistically deleted rules remained interactive
Rules pending deletion could still be opened.
Both rule types now expose
isDisabledwhenpendingAction === DELETE, making the menu item non-interactive and removing the chevron.3. Pending-delete Field requirements disappeared
A deleted Field requirements rule disappeared instead of remaining visible with a strikethrough.
getCategoryContextualRulesnow mirrorsgetRequireFieldsTableData:shouldIncludePendingDeleteFieldsso the summary continues to render.Fixed Issues
$ #97560
$ #97561
$ #97563
PROPOSAL:
Tests
#97560 Rules - "Please select at least one field" is shown when all fields are selected
Offline tests
#97561 Rules - Deleted flag for review rule can be opened in offline mode
#97563 Rules - Deleted field requirements rule disappears instead of showing crossed-out in offline
QA Steps
Same as tests
Verify that no errors appear in the JS console
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
web_chrome.mp4