Stop clearing Description Hint when disabling Require description#82813
Conversation
The setPolicyCategoryDescriptionRequired function was resetting commentHint to an empty string whenever areCommentsRequired was set to false. This was originally acceptable when the Description Hint field was only visible while Require description was enabled. After the Description Hint was moved to always be visible when rules are enabled, this clearing became a visible bug. Remove the commentHint side effect so that toggling Require description only updates areCommentsRequired. Co-authored-by: Neil Marcellini <neil-marcellini@users.noreply.github.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@sobitneupane Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
I don't think this needs a C+ |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @neil-marcellini has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 9.3.22-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.22-4 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.22-4 🚀
|
Explanation of Change
The
setPolicyCategoryDescriptionRequiredfunction insrc/libs/actions/Policy/Category.tswas resetting thecommentHintfield to an empty string wheneverareCommentsRequiredwas toggled off. This was originally acceptable when the Description Hint field was only visible while "Require description" was enabled (so clearing was invisible cleanup). After #81908 made the Description Hint always visible when rules are enabled, this clearing became a visible bug — users see their hint text disappear when they toggle "Require description" off.This change removes the
commentHintside effect fromsetPolicyCategoryDescriptionRequiredso that toggling "Require description" only updatesareCommentsRequired. ThecommentHintfield already has its own dedicated action (setWorkspaceCategoryDescriptionHint) and API command, so there is no reason forsetPolicyCategoryDescriptionRequiredto manage it. The API parameters forSetPolicyCategoryDescriptionRequireddon't even includecommentHint— onlypolicyID,categoryName, andareCommentsRequiredare sent to the server.Fixed Issues
$ #82748
Tests
Offline tests
QA Steps
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
Changes are platform independent, only tested on web.
MacOS: Chrome / Safari
Android: Native
N/A — No UI changes, only logic removal in action function
Android: mWeb Chrome
N/A — No UI changes, only logic removal in action function
iOS: Native
N/A — No UI changes, only logic removal in action function
iOS: mWeb Safari
N/A — No UI changes, only logic removal in action function