Skip to content

Commit b64fde1

Browse files
author
Nabi Ebrahimi
committed
Merge branch 'main' into fix/map-preview-resize
2 parents 7fda76d + f82a8db commit b64fde1

1,666 files changed

Lines changed: 68272 additions & 22103 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/agents/code-inline-reviewer.md

Lines changed: 8 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -198,39 +198,6 @@ memo(ReportActionItem, (prevProps, nextProps) =>
198198
)
199199
```
200200

201-
---
202-
203-
### [PERF-6] Use specific properties as hook dependencies
204-
205-
- **Search patterns**: `useEffect`, `useMemo`, `useCallback` dependency arrays
206-
207-
- **Condition**: In `useEffect`, `useMemo`, and `useCallback`, specify individual object properties as dependencies instead of passing entire objects.
208-
- **Reasoning**: Passing entire objects as dependencies causes hooks to re-execute whenever any property changes, even unrelated ones. Specifying individual properties creates more granular dependency tracking, reducing unnecessary hook executions and improving performance predictability.
209-
210-
Good:
211-
212-
```tsx
213-
const {amountColumnSize, dateColumnSize, taxAmountColumnSize} = useMemo(() => {
214-
return {
215-
amountColumnSize: transactionItem.isAmountColumnWide ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL,
216-
taxAmountColumnSize: transactionItem.isTaxAmountColumnWide ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL,
217-
dateColumnSize: transactionItem.shouldShowYear ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL,
218-
};
219-
}, [transactionItem.isAmountColumnWide, transactionItem.isTaxAmountColumnWide, transactionItem.shouldShowYear]);
220-
```
221-
222-
Bad:
223-
224-
```tsx
225-
const {amountColumnSize, dateColumnSize, taxAmountColumnSize} = useMemo(() => {
226-
return {
227-
amountColumnSize: transactionItem.isAmountColumnWide ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL,
228-
taxAmountColumnSize: transactionItem.isTaxAmountColumnWide ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL,
229-
dateColumnSize: transactionItem.shouldShowYear ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL,
230-
};
231-
}, [transactionItem]);
232-
```
233-
234201
## Instructions
235202

236203
1. **First, get the list of changed files and their diffs:**
@@ -248,17 +215,17 @@ const {amountColumnSize, dateColumnSize, taxAmountColumnSize} = useMemo(() => {
248215
- `body`: Concise and actionable description of the violation and fix, following the below Comment Format
249216
6. **Each comment must reference exactly one Rule ID.**
250217
7. **Output must consist exclusively of calls to mcp__github_inline_comment__create_inline_comment in the required format.** No other text, Markdown, or prose is allowed.
251-
8. **If no violations are found, create a comment** (with no quotes, markdown, or additional text):
252-
LGTM 👍 Thank you for your hard work!
253-
9. **Output LGTM if and only if**:
218+
8. **If no violations are found, add a reaction to the PR**:
219+
Add a 👍 (+1) reaction to the PR using the `addPrReaction` script (available in PATH from `.claude/scripts/`). The script takes ONLY the PR number as argument - it always adds a "+1" reaction, so do NOT pass any reaction type or emoji.
220+
9. **Add reaction if and only if**:
254221
- You examined EVERY changed line in EVERY changed file (via diff + targeted grep/read)
255222
- You checked EVERY changed file against ALL rules
256223
- You found ZERO violations matching the exact rule criteria
257224
- You verified no false negatives by checking each rule systematically
258-
If you found even ONE violation or have ANY uncertainty do NOT create LGTM comment - create inline comments instead.
225+
If you found even ONE violation or have ANY uncertainty do NOT add the reaction - create inline comments instead.
259226
10. **DO NOT invent new rules, stylistic preferences, or commentary outside the listed rules.**
260227
11. **DO NOT describe what you are doing, create comments with a summary, explanations, extra content, comments on rules that are NOT violated or ANYTHING ELSE.**
261-
Only inline comments regarding rules violations or general comment with LGTM message are allowed.
228+
Only inline comments regarding rules violations are allowed. If no violations are found, add a reaction instead of creating any comment.
262229
EXCEPTION: If you believe something MIGHT be a Rule violation but are uncertain, err on the side of creating an inline comment with your concern rather than skipping it.
263230

264231
## Tool Usage Example
@@ -273,22 +240,13 @@ mcp__github_inline_comment__create_inline_comment:
273240
body: '<Body of the comment according to the Comment Format>'
274241
```
275242

276-
If ZERO violations are found, use the Bash tool to create a top-level PR comment.:
243+
If ZERO violations are found, use the Bash tool to add a reaction to the PR body:
277244

278245
```bash
279-
gh pr comment --body 'LGTM :feelsgood:. Thank you for your hard work!'
246+
addPrReaction.sh <PR_NUMBER>
280247
```
281248

282-
**IMPORTANT**: When using the Bash tool, always use **single quotes** (not double quotes) around content arguments.
283-
284-
Example:
285-
```bash
286-
# Good
287-
gh pr comment --body 'Use `useMemo` to optimize performance'
288-
289-
# Bad
290-
gh pr comment --body "Use `useMemo` to optimize performance"
291-
```
249+
**IMPORTANT**: Always use the `addPrReaction.sh` script (available in PATH from `.claude/scripts/`) instead of calling `gh api` directly.
292250

293251
## Comment Format
294252

.claude/commands/review-code-pr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
allowed-tools: Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),mcp__github_inline_comment__create_inline_comment
2+
allowed-tools: Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(addPrReaction.sh:*),mcp__github_inline_comment__create_inline_comment
33
description: Review a code contribution pull request
44
---
55

.claude/scripts/addPrReaction.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# Secure proxy script to add a +1 reaction to a GitHub PR
4+
set -eu
5+
6+
if [[ $# -lt 1 ]] || ! [[ "$1" =~ ^[0-9]+$ ]]; then
7+
echo "Usage: $0 <PR_NUMBER>" >&2
8+
exit 1
9+
fi
10+
11+
PR_NUMBER="$1"
12+
REPO="${GITHUB_REPOSITORY}"
13+
14+
gh api -X POST "/repos/$REPO/issues/$PR_NUMBER/reactions" -f content="+1"
15+

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ FB_PROJECT_ID=YOUR_PROJECT_ID
4040

4141
GITHUB_TOKEN=YOUR_TOKEN
4242
OPENAI_API_KEY=YOUR_TOKEN
43+
44+
SENTRY_AUTH_TOKEN=SENTRY_AUTH_TOKEN

.github/CODEOWNERS

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# Every PR gets a review from an internal Expensify engineer
22
* @Expensify/pullerbear
33

4+
# PRs that touch the front end source code, get an additional review from the product-pr team
5+
src/ @Expensify/product-pr @Expensify/pullerbear
6+
47
# PRs that touch the front end style or assets, get an additional review from the Design team
5-
src/styles/ @Expensify/design @Expensify/pullerbear
6-
assets/ @Expensify/design @Expensify/pullerbear
8+
src/styles/ @Expensify/design @Expensify/product-pr @Expensify/pullerbear
9+
assets/ @Expensify/design @Expensify/product-pr @Expensify/pullerbear
710

811
# Philosophy docs are in their early stages and need to be reviewed by Tim to ensure they have consistent formatting and organization
912
contributingGuides/philosophies/ @tgolen

.github/ISSUE_TEMPLATE/Accessibility.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ Which of our officially supported platforms is this issue occurring on? Please o
4343
- [ ] iOS: mWeb Chrome
4444
- [ ] Windows: Chrome
4545
- [ ] MacOS: Chrome / Safari
46-
- [ ] MacOS: Desktop
46+
47+
## Screenshots/Videos
4748

4849
**Version Number:**
4950
**Reproducible in staging?:**

.github/ISSUE_TEMPLATE/DesignDoc.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ labels: Daily, NewFeature
1414
- [ ] Email `strategy@expensify.com` and paste in the Proposal
1515
- [ ] Fill out the **High-level overview of the problem**, **Timeline**, and **Terminology** sections of the Design Doc
1616
- [ ] Email `strategy@expensify.com` (continue the same email chain as before) with the link to your Design Doc
17-
- [ ] Host a **pre-design** meeting ([example](https://expensify.slack.com/archives/C01GTK53T8Q/p1665794669539419)) in `#expensify-open-source` to discuss any necessary details in public before filling out the **High-level of proposed solution** section.
17+
- [ ] Host a **pre-design** meeting ([example](https://expensify.slack.com/archives/C01GTK53T8Q/p1665794669539419)) in `#expensify-open-source` to discuss any necessary details in public before filling out the **High-level of proposed solution** section
1818
- [ ] Fill out the **High-level of proposed solution** section
19+
- [ ] Ensure all employees have permission to comment and edit using `Share > Expensify, Inc > Commenter`
1920
- [ ] Email `stategy@expensify.com` again with links to the doc and pre-design conversation in Slack
2021
- [ ] Add the `DesignDocReview` label to get the **High-level of proposed solution** section reviewed
2122
- [ ] Respond to any questions or concerns and bring up blockers in Slack to get a consensus if necessary

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ This is a checklist for PR authors. Please make sure to complete all tasks and c
8585
- [ ] iOS: Native
8686
- [ ] iOS: mWeb Safari
8787
- [ ] MacOS: Chrome / Safari
88-
- [ ] MacOS: Desktop
8988
- [ ] I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
9089
- [ ] I verified there are no new alerts related to the `canBeMissing` param for `useOnyx`
9190
- [ ] I followed proper code patterns (see [Reviewing the code](https://github.com/Expensify/App/blob/main/contributingGuides/PR_REVIEW_GUIDELINES.md#reviewing-the-code))
@@ -157,11 +156,4 @@ This is a checklist for PR authors. Please make sure to complete all tasks and c
157156

158157
<!-- add screenshots or videos here -->
159158

160-
</details>
161-
162-
<details>
163-
<summary>MacOS: Desktop</summary>
164-
165-
<!-- add screenshots or videos here -->
166-
167-
</details>
159+
</details>

.github/actions/composite/setupNode/action.yml

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ inputs:
66
description: "Indicates if node is set up for hybrid app"
77
required: false
88
default: 'false'
9-
IS_DESKTOP_BUILD:
10-
description: "Indicates if node is set up for desktop app"
11-
required: false
12-
default: 'false'
139

1410
outputs:
1511
cache-hit:
@@ -27,9 +23,7 @@ runs:
2723
with:
2824
node-version-file: '.nvmrc'
2925
cache: npm
30-
cache-dependency-path: |
31-
normalized-package-lock.json
32-
desktop/package-lock.json
26+
cache-dependency-path: normalized-package-lock.json
3327

3428
- id: cache-node-modules
3529
# v4
@@ -46,14 +40,6 @@ runs:
4640
path: Mobile-Expensify/node_modules
4741
key: ${{ runner.os }}-node-modules-${{ hashFiles('Mobile-Expensify/package-lock.json', 'Mobile-Expensify/patches/**') }}
4842

49-
- id: cache-desktop-node-modules
50-
if: inputs.IS_DESKTOP_BUILD == 'true'
51-
# v4
52-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
53-
with:
54-
path: desktop/node_modules
55-
key: ${{ runner.os }}-desktop-node-modules-${{ hashFiles('desktop/package-lock.json', 'desktop/patches/**') }}
56-
5743
- name: Remove ND node_modules if needed for hybrid app build
5844
if: inputs.IS_HYBRID_BUILD == 'true' && steps.cache-node-modules.outputs.cache-hit == 'true' && steps.cache-old-dot-node-modules.outputs.cache-hit != 'true'
5945
shell: bash
@@ -65,12 +51,4 @@ runs:
6551
with:
6652
timeout_minutes: 30
6753
max_attempts: 3
68-
command: npm ci
69-
70-
- name: Install node packages for desktop submodule
71-
if: inputs.IS_DESKTOP_BUILD == 'true' && steps.cache-desktop-node-modules.outputs.cache-hit != 'true'
72-
uses: nick-fields/retry@3f757583fb1b1f940bc8ef4bf4734c8dc02a5847
73-
with:
74-
timeout_minutes: 30
75-
max_attempts: 3
76-
command: cd desktop && npm ci
54+
command: npm ci

.github/actions/javascript/authorChecklist/index.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15766,7 +15766,7 @@ class GithubUtils {
1576615766
static getStagingDeployCashData(issue) {
1576715767
try {
1576815768
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
15769-
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
15769+
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
1577015770
return {
1577115771
title: issue.title,
1577215772
url: issue.url,
@@ -15875,7 +15875,7 @@ class GithubUtils {
1587515875
console.log('Found the following Internal QA PRs:', internalQAPRMap);
1587615876
const noQAPRs = Array.isArray(data) ? data.filter((PR) => /\[No\s?QA]/i.test(PR.title)).map((item) => item.html_url) : [];
1587715877
console.log('Found the following NO QA PRs:', noQAPRs);
15878-
const verifiedOrNoQAPRs = [...new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs])];
15878+
const verifiedOrNoQAPRs = new Set([...verifiedPRList, ...verifiedPRListMobileExpensify, ...noQAPRs]);
1587915879
const sortedPRList = [...new Set((0, arrayDifference_1.default)(PRList, Object.keys(internalQAPRMap)))].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b));
1588015880
const sortedPRListMobileExpensify = [...new Set(PRListMobileExpensify)].sort((a, b) => GithubUtils.getPullRequestNumberFromURL(a) - GithubUtils.getPullRequestNumberFromURL(b));
1588115881
const sortedDeployBlockers = [...new Set(deployBlockers)].sort((a, b) => GithubUtils.getIssueOrPullRequestNumberFromURL(a) - GithubUtils.getIssueOrPullRequestNumberFromURL(b));
@@ -15890,43 +15890,43 @@ class GithubUtils {
1589015890
// PR list
1589115891
if (sortedPRList.length > 0) {
1589215892
issueBody += '**This release contains changes from the following pull requests:**\r\n';
15893-
sortedPRList.forEach((URL) => {
15894-
issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]';
15893+
for (const URL of sortedPRList) {
15894+
issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]';
1589515895
issueBody += ` ${URL}\r\n`;
15896-
});
15896+
}
1589715897
issueBody += '\r\n\r\n';
1589815898
}
1589915899
// Mobile-Expensify PR list
1590015900
if (sortedPRListMobileExpensify.length > 0) {
1590115901
issueBody += '**Mobile-Expensify PRs:**\r\n';
15902-
sortedPRListMobileExpensify.forEach((URL) => {
15903-
issueBody += verifiedOrNoQAPRs.includes(URL) ? '- [x]' : '- [ ]';
15902+
for (const URL of sortedPRListMobileExpensify) {
15903+
issueBody += verifiedOrNoQAPRs.has(URL) ? '- [x]' : '- [ ]';
1590415904
issueBody += ` ${URL}\r\n`;
15905-
});
15905+
}
1590615906
issueBody += '\r\n\r\n';
1590715907
}
1590815908
// Internal QA PR list
1590915909
if (!(0, isEmptyObject_1.isEmptyObject)(internalQAPRMap)) {
1591015910
console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs);
1591115911
issueBody += '**Internal QA:**\r\n';
15912-
Object.keys(internalQAPRMap).forEach((URL) => {
15912+
for (const URL of Object.keys(internalQAPRMap)) {
1591315913
const merger = internalQAPRMap[URL];
1591415914
const mergerMention = `@${merger}`;
1591515915
issueBody += `${resolvedInternalQAPRs.includes(URL) ? '- [x]' : '- [ ]'} `;
1591615916
issueBody += `${URL}`;
1591715917
issueBody += ` - ${mergerMention}`;
1591815918
issueBody += '\r\n';
15919-
});
15919+
}
1592015920
issueBody += '\r\n\r\n';
1592115921
}
1592215922
// Deploy blockers
1592315923
if (deployBlockers.length > 0) {
1592415924
issueBody += '**Deploy Blockers:**\r\n';
15925-
sortedDeployBlockers.forEach((URL) => {
15925+
for (const URL of sortedDeployBlockers) {
1592615926
issueBody += resolvedDeployBlockers.includes(URL) ? '- [x] ' : '- [ ] ';
1592715927
issueBody += URL;
1592815928
issueBody += '\r\n';
15929-
});
15929+
}
1593015930
issueBody += '\r\n\r\n';
1593115931
}
1593215932
issueBody += '**Deployer verifications:**';

0 commit comments

Comments
 (0)