Exclude built-in title field from duplicate workspace report fields count#90340
Exclude built-in title field from duplicate workspace report fields count#90340MelvinBot wants to merge 5 commits into
Conversation
… workspace confirmation page The report fields count on the duplicate workspace confirmation page includes the built-in text_title field, which should be excluded (matching WorkspaceReportsPage behavior). This causes the count to show 1 even when all custom report fields have been pending-deleted offline. Co-authored-by: Sobit Neupane <sobitneupane@users.noreply.github.com>
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
sobitneupane
left a comment
There was a problem hiding this comment.
Screenshots/Videos
MacOS: Chrome / Safari
Screen.Recording.2026-05-15.at.21.03.21.mov
|
@MelvinBot When I disable the Report fields in offline and then duplicate the workspace, the Report fields become enabled in the duplicated workspace. Could you please ensure that the Report fields remain disabled in the duplicated workspace as well? |
…plicate form When report fields are disabled offline, the toggle should not appear in the duplication features form, matching the pattern used by distanceRates and invoices. Co-authored-by: Sobit Neupane <sobitneupane@users.noreply.github.com>
|
Fixed — the duplication form now also checks When report fields are disabled offline, the toggle won't appear in the feature selection list, so |
|
@MelvinBot This will block users from copying Reports entirely. Should we instead set App/src/libs/actions/Policy/Policy.ts Line 3295 in 8f3ca19 |
Instead of hiding the Reports toggle when areReportFieldsEnabled is false (which blocks copying Reports entirely), preserve the source policy's areReportFieldsEnabled value in buildOptimisticDuplicatePolicy. Co-authored-by: Sobit Neupane <sobitneupane@users.noreply.github.com>
|
Good call — reverted the form change and instead updated |
|
All CI checks are passing. The only "failing" check is PR Author Checklist, which is an informational reminder to complete the checklist — not a code issue. All other checks (ESLint, Prettier, typecheck, all 8 test jobs, builds, spellcheck, storybook, CLA, etc.) pass successfully. |
|
The Failure: Why it's unrelated: This PR only touches The only other failing check is the PR Author Checklist, which is informational. All code-related checks (ESLint, Prettier, typecheck, all 8 test jobs, builds) pass. |
Can we just make it count the report fields & exclude the title? Since thats not a field? |
| areRulesEnabled: isRulesFeatureSelected, | ||
| areWorkflowsEnabled: isWorkflowsFeatureSelected, | ||
| areReportFieldsEnabled: isReportsFeatureSelected, | ||
| areReportFieldsEnabled: isReportsFeatureSelected ? sourcePolicy?.areReportFieldsEnabled : false, |
There was a problem hiding this comment.
The duplicated workspace will have report fields enabled regardless of the original workspace state if we don’t include this change.
|
The Failing test: Why it's unrelated: This PR only modifies Evidence: The same Reassure perf test is failing across many unrelated PRs right now (e.g., branches No code fix is needed on this PR for this check. |
@JS00001 We can do that, but if we go that route, the report title won’t be included when duplicating the workspace in cases where there are no other report fields. However, if there is at least one report field, the report title will be included, which leads to inconsistent behavior. |
|
The Failing test: Why it's unrelated: This PR only changes The other two failing checks ( |
|
@JS00001 Just a gentle bump on these comments when you get a chance: #90340 (comment) and #90340 (comment). Thanks! |
Can you explain this more please? |
|
@sobitneupane lets include it as a report field then |
|
@JS00001 This is the existing behavior. For report title and 2 report fields, we currently display "3 report fields". The separate issue we are trying to address here is that a duplicated workspace has report fields enabled regardless of the original workspace's state However, this wasn't reported in the original issue. Should we proceed with only this latter change? |
|
Yeah lets ignore the report title issues then |
| const reportFields = | ||
| Object.values(getReportFieldsByPolicyID(policyID) ?? {}).filter( | ||
| (field) => field.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE && field.fieldID !== CONST.REPORT_FIELD_TITLE_FIELD_ID, | ||
| ).length ?? 0; |
There was a problem hiding this comment.
@MelvinBot Let's revert the change made in WorkspaceDuplicateSelectFeaturesForm. We decided to include CONST.REPORT_FIELD_TITLE_FIELD_ID in the reportFields.
Per reviewer feedback, the built-in title field should be included in the reportFields count on the duplicate workspace confirmation page. Co-authored-by: Sobit Neupane <sobitneupane@users.noreply.github.com>
|
Reverted the |
|
The checks on this PR are not failing — the latest run (triggered a few minutes ago) is still in progress with all checks queued or running. The only historical failures on this branch are If checks fail once the current run completes, feel free to tag me again and I'll investigate. |
|
@MelvinBot Please merge main |
…xcludeTitleFieldFromDuplicateWSCount Co-authored-by: Sobit Neupane <sobitneupane@users.noreply.github.com>
|
Merged |
|
The ESLint failure is unrelated to this PR. Error: Why it's unrelated: This PR only changes |
|
MelvinBot has made 5 consecutive commits trying to fix CI failures. Automatic CI fix dispatches are now paused for this PR. Next steps: A human should review the recent commits and resolve the conflicting CI errors manually. |
|
@MelvinBot Please complete the author checklist with all items checked (no N/A). I have manually verified that all the items can be checked. Also, update the Tests, Offline tests and QA steps with the following:
|
|
No code fix needed — the
The other failing check ( To resolve: Re-run the failed job, or push an empty change to trigger a new CI run. The remaining test jobs are still in progress and may pass. |
|
Updated the PR body:
|
|
@JS00001 For the issue I mentioned above ("a duplicated workspace has report fields enabled regardless of the original workspace's state"), the backend currently always set |
So we want the report fields to be enabled or disabled based on the previous workspace? OR based on the user selection? |
|
PR open for this here: https://github.com/Expensify/Web-Expensify/pull/53201/ |
If the user has selected "Reports" feature in "Select features to copy" ( |
|
Agreed, sounds good |


Explanation of Change
The report fields count on the duplicate workspace confirmation page (
WorkspaceDuplicateSelectFeaturesForm.tsx) included the built-intext_titlefield, which is always present inpolicy.fieldListand has nopendingAction. This caused the count to be inflated by 1 — showing1even when all custom report fields were pending deletion offline.This adds a
fieldID !== CONST.REPORT_FIELD_TITLE_FIELD_IDfilter to exclude the built-in title field, matching the existing behavior inWorkspaceReportsPage.tsxwhich already filters it out.Fixed Issues
$ #89716
PROPOSAL: #89716 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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