-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update policy expense chat name #56735
base: main
Are you sure you want to change the base?
Conversation
src/languages/en.ts
Outdated
@@ -2721,6 +2722,7 @@ const translations = { | |||
defaultCategory: 'Default category', | |||
viewTransactions: 'View transactions', | |||
leaveConfirmation: "Are you sure you want to leave this workspace? Once you leave, you'll lose access to all data and settings associated with this workspace.", | |||
policyExpenseChatName: ({displayName}: PolicyExpenseChatNameParams) => `${displayName}'s expense`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be expenses
not just expense
Also, I think we want just the first name or do we want the full display name of First Lastname? cc @dannymcclain for confirmation there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree about expenses
, and I'm pretty positive we're going with displayName
in case there are multiple users with the same first name 👍
Quick note about this one: we only want to do this when a user has multiple workspaces. |
@dannymcclain What happens if the user has two workspaces and delete one of them, and in this case what the policy expense chat name should be? |
I guess I would expect the little description text to go away? But cc @Expensify/design for a gut check on that one |
That makes sense to me 👍 |
@dannymcclain Also in this case that I mentioned above, what should we display the the prefix ${policyName} • |
@dannymcclain I understood the mock, the thing I need to confirm here is if we have two workspaces and we deleted one. What mock should be applied for this case? Single workspace or multiple workspace case?. The reason I asked this because when a workspace is deleted, the policy expense chat still exist. |
Ahhh I didn't realize that! Thank you for clarifying. I think in that case, where multiple exist, we should probably stick with the multi-workspace pattern and include the prepended text. Does that sound right to you @Expensify/design? |
Hmm good question... I suppose that makes sense, though I would also expect us to append |
That works for me as well. |
Updated with this expected. |
@fedirjh It's ready for review. |
Oh great catches Danny! |
@dannymcclain For the case display Lines 4601 to 4611 in e66ec9a
|
I think the workspace name would be most useful here probably. |
@dannymcclain The display in Search router is fixed now. |
@nkdengineer did you address our feedback above about using the Workspace name instead of just "Workspace" here? |
@shawnborton I just updated. |
Going to run another test build |
🚧 @dannymcclain has triggered a test build. You can view the workflow run here. |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
Nice! Feeling pretty good to me. |
Yeah, same! I say let's get this into final review @fedirjh |
}); | ||
|
||
expect(canCreate).toBe(false); | ||
}); | ||
}); | ||
|
||
it('createOptionList() localization', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fedirjh Just a note here: I deleted this localization test because it's outdated now, we will show Workspace's name
instead of Workspace
work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have a test for expenses room localization ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fedirjh I updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid. left small review.
}); | ||
|
||
expect(canCreate).toBe(false); | ||
}); | ||
}); | ||
|
||
it('createOptionList() localization', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have a test for expenses room localization ?
if (report?.isOwnPolicyExpenseChat) { | ||
return getPolicyName({report, policy, policies, reports}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't keep old behavior and early return at this point ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fedirjh What do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw that you moved this early return to the bottom of the function. I suggested to keep the early return to avoid any extra calculation.
Reviewer Checklist
|
@shawnborton @dannymcclain Just noticed that when you have many workspaces and you select one , the workspace ![]() |
Ooh great question. I don't think I have very strong feelings about this—I could honestly go either way. I guess it makes sense to remove it when filtered to a workspace, but at the same time it doesn't really bother me. @Expensify/design what about you all? |
Yeah same, I could go either way. Part of me prefers the simplification, but I also just feel like while still are things evolving we're just adding complexity, so I think I lean on just keeping the workspace appended regardless of whether you have filtered a workspace or not. |
Updated to fix this case. |
Yeah that's a good point. Probably no need to add the extra complexity right now. If we find that this pattern sticks around for the long haul, we can do a follow up to perfectly perfect it. 👍 |
Yeah, I can totally get down with that too. Then we can get some real world usage and see how it goes. I don't think many people even use the workspace filter IMO so I don't think it's the biggest deal anyways. |
Explanation of Change
${user's displayname}'s expense
${policyName} •
if we have multiple workspaceFixed Issues
$ #56123
PROPOSAL: #56123 (comment)
Tests
${Email upto @}'s Expenses
${user's displayname}'s expense
To
fieldOffline tests
Same
QA Steps
${Email upto @}'s Expenses
${user's displayname}'s expense
To
fieldPR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2025-02-12.at.14.30.02.mov
Android: mWeb Chrome
Screen.Recording.2025-02-12.at.14.31.46.mov
iOS: Native
Screen.Recording.2025-02-12.at.14.30.42.mov
iOS: mWeb Safari
Screen.Recording.2025-02-12.at.14.31.30.mov
MacOS: Chrome / Safari
Screen.Recording.2025-02-12.at.14.27.56.mov
MacOS: Desktop
Screen.Recording.2025-02-12.at.14.34.32.mov