Skip to content

Commit 3ffed16

Browse files
committed
Merge remote-tracking branch 'upstream/main' into cleanup-reportFields
2 parents 14e94bb + 2bc19b2 commit 3ffed16

376 files changed

Lines changed: 6429 additions & 4530 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.

.github/actions/javascript/proposalPoliceComment/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11639,6 +11639,7 @@ async function run() {
1163911639
console.log('commentsResponse', commentsResponse);
1164011640
core.endGroup();
1164111641
let didFindDuplicate = false;
11642+
let originalProposal;
1164211643
for (const previousProposal of commentsResponse) {
1164311644
const isProposal = !!previousProposal.body?.includes(CONST_1.default.PROPOSAL_KEYWORD);
1164411645
const previousProposalCreatedAt = new Date(previousProposal.created_at).getTime();
@@ -11664,13 +11665,14 @@ async function run() {
1166411665
if (similarityPercentage >= 90) {
1166511666
console.log(`Found duplicate with ${similarityPercentage}% similarity.`);
1166611667
didFindDuplicate = true;
11668+
originalProposal = previousProposal;
1166711669
break;
1166811670
}
1166911671
}
1167011672
}
1167111673
if (didFindDuplicate) {
1167211674
const duplicateCheckWithdrawMessage = proposalPolice_1.default.getDuplicateCheckWithdrawMessage();
11673-
const duplicateCheckNoticeMessage = proposalPolice_1.default.getDuplicateCheckNoticeMessage(newProposalAuthor);
11675+
const duplicateCheckNoticeMessage = proposalPolice_1.default.getDuplicateCheckNoticeMessage(newProposalAuthor, originalProposal?.html_url);
1167411676
// If a duplicate proposal is detected, update the comment to withdraw it
1167511677
console.log('ProposalPolice™ withdrawing duplicated proposal...');
1167611678
await GithubUtils_1.default.octokit.issues.updateComment({
@@ -12557,8 +12559,9 @@ const PROPOSAL_POLICE_TEMPLATES = {
1255712559
getDuplicateCheckWithdrawMessage: () => {
1255812560
return '#### 🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.';
1255912561
},
12560-
getDuplicateCheckNoticeMessage: (proposalAuthor) => {
12561-
return `⚠️ @${proposalAuthor} Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.`;
12562+
getDuplicateCheckNoticeMessage: (proposalAuthor, originalProposalURL) => {
12563+
const existingProposalWithURL = originalProposalURL ? `[existing proposal](${originalProposalURL})` : 'existing proposal';
12564+
return `⚠️ @${proposalAuthor} Your proposal is a duplicate of an already ${existingProposalWithURL} and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.`;
1256212565
},
1256312566
};
1256412567
exports["default"] = PROPOSAL_POLICE_TEMPLATES;

.github/actions/javascript/proposalPoliceComment/proposalPoliceComment.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {context} from '@actions/github';
44
import type {IssueCommentCreatedEvent, IssueCommentEditedEvent, IssueCommentEvent} from '@octokit/webhooks-types';
55
import {format} from 'date-fns';
66
import {toZonedTime} from 'date-fns-tz';
7+
import type {TupleToUnion} from 'type-fest';
78
import {convertToNumber} from '@github/libs/ActionUtils';
89
import CONST from '@github/libs/CONST';
910
import GithubUtils from '@github/libs/GithubUtils';
@@ -91,6 +92,7 @@ async function run() {
9192
core.endGroup();
9293

9394
let didFindDuplicate = false;
95+
let originalProposal: TupleToUnion<typeof commentsResponse> | undefined;
9496
for (const previousProposal of commentsResponse) {
9597
const isProposal = !!previousProposal.body?.includes(CONST.PROPOSAL_KEYWORD);
9698
const previousProposalCreatedAt = new Date(previousProposal.created_at).getTime();
@@ -117,14 +119,15 @@ async function run() {
117119
if (similarityPercentage >= 90) {
118120
console.log(`Found duplicate with ${similarityPercentage}% similarity.`);
119121
didFindDuplicate = true;
122+
originalProposal = previousProposal;
120123
break;
121124
}
122125
}
123126
}
124127

125128
if (didFindDuplicate) {
126129
const duplicateCheckWithdrawMessage = PROPOSAL_POLICE_TEMPLATES.getDuplicateCheckWithdrawMessage();
127-
const duplicateCheckNoticeMessage = PROPOSAL_POLICE_TEMPLATES.getDuplicateCheckNoticeMessage(newProposalAuthor);
130+
const duplicateCheckNoticeMessage = PROPOSAL_POLICE_TEMPLATES.getDuplicateCheckNoticeMessage(newProposalAuthor, originalProposal?.html_url);
128131
// If a duplicate proposal is detected, update the comment to withdraw it
129132
console.log('ProposalPolice™ withdrawing duplicated proposal...');
130133
await GithubUtils.octokit.issues.updateComment({

.github/workflows/unused-styles.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
pull_request:
66
types: [opened, synchronize]
77
branches-ignore: [staging, production]
8-
paths: ['src', '.github/workflows/unused-styles.yml', 'scripts/findUnusedStyles.ts']
8+
paths: ['src/**', '.github/workflows/unused-styles.yml', 'scripts/findUnusedStyles.ts']
99

1010
concurrency:
1111
group: ${{ github.ref == 'refs/heads/main' && format('{0}-{1}', github.ref, github.sha) || github.ref }}-unused-styles

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,6 @@ react-compiler-output.txt
153153

154154
# Generated by bob (for Nitro modules)
155155
modules/*/lib/
156+
157+
# Claude Code files
158+
.claude/

.storybook/preview.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import HTMLEngineProvider from '@src/components/HTMLEngineProvider';
1010
import {LocaleContextProvider} from '@src/components/LocaleContextProvider';
1111
import {EnvironmentProvider} from '@src/components/withEnvironment';
1212
import {KeyboardStateProvider} from '@src/components/withKeyboardState';
13+
import CONST from '@src/CONST';
14+
import IntlStore from '@src/languages/IntlStore';
1315
import ONYXKEYS from '@src/ONYXKEYS';
1416
import './fonts.css';
1517

@@ -20,6 +22,8 @@ Onyx.init({
2022
},
2123
});
2224

25+
IntlStore.load(CONST.LOCALES.EN);
26+
2327
const decorators = [
2428
(Story: React.ElementType) => (
2529
<ComposeProviders

Mobile-Expensify

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* [canBeMissing onyx param](#canbemissing-onyx-param)
2525

2626
#### Additional Reading
27+
* [Application Philosophy](contributingGuides/philosophies/INDEX.md)
2728
* [API Details](contributingGuides/API.md)
2829
* [Offline First](contributingGuides/OFFLINE_UX.md)
2930
* [Contributing to Expensify](contributingGuides/CONTRIBUTING.md)
@@ -525,7 +526,7 @@ You can only build HybridApp if you have been granted access to [`Mobile-Expensi
525526
4. Run `git config --global submodule.recurse true` in order to have the submodule updated when you pull App.
526527

527528

528-
> [!Note]
529+
> [!Note]
529530
> #### For external agencies and C+ contributors only
530531
>
531532
> If you'd like to modify the `Mobile-Expensify` source code, it is best that you create your own fork. Then, you can swap origin of the remote repository by executing this command:
@@ -560,15 +561,15 @@ If for some reason, you need to target the standalone NewDot application, you ca
560561

561562
### Working with HybridApp vs Standalone NewDot
562563

563-
Day-to-day work with **HybridApp** shouldn't differ much from working on the standalone **NewDot** repository.
564-
The primary difference is that the native code, which runs React Native, is located in the following directories:
564+
Day-to-day work with **HybridApp** shouldn't differ much from working on the standalone **NewDot** repository.
565+
The primary difference is that the native code, which runs React Native, is located in the following directories:
565566
566567
- `./Mobile-Expensify/Android`
567568
- `./Mobile-Expensify/iOS`
568569
569570
### Important Notes:
570571
1. **Root Folders Do Not Affect HybridApp Builds:**
571-
- Changes made to the `./android` and `./ios` folders at the root of the repository **won't affect the HybridApp build**.
572+
- Changes made to the `./android` and `./ios` folders at the root of the repository **won't affect the HybridApp build**.
572573

573574
2. **Modifying iOS Code for HybridApp:**
574575
- If you need to remove `Pods`, you must do it in the **`./Mobile-Expensify/iOS`** directory.
@@ -583,23 +584,23 @@ The primary difference is that the native code, which runs React Native, is loca
583584
584585
### Updating the `Mobile-Expensify` Submodule
585586
586-
The `Mobile-Expensify` directory is a **Git submodule**. This means it points to a specific commit on the `Mobile-Expensify` repository.
587+
The `Mobile-Expensify` directory is a **Git submodule**. This means it points to a specific commit on the `Mobile-Expensify` repository.
587588
588-
If you'd like to fetch the submodule while executing the `git pull` command in `Expensify/App` instead of updating it manually you can run this command in the root of the project:
589+
If you'd like to fetch the submodule while executing the `git pull` command in `Expensify/App` instead of updating it manually you can run this command in the root of the project:
589590

590591
```
591592
git config submodule.recurse true
592593
```
593594

594-
> [!WARNING]
595+
> [!WARNING]
595596
> Please, remember that the submodule will get updated automatically only after executing the `git pull` command - if you switch between branches it is still recommended to execute `git submodule update` to make sure you're working on a compatible submodule version!
596597

597598
If you'd like to download the most recent changes from the `main` branch, please use the following command:
598599
```bash
599600
git submodule update --remote
600601
```
601602

602-
It's important to emphasize that a git submodule is just a **regular git repository** after all. It means that you can switch branches, pull the newest changes, and execute all regular git commands within the `Mobile-Expensify` directory.
603+
It's important to emphasize that a git submodule is just a **regular git repository** after all. It means that you can switch branches, pull the newest changes, and execute all regular git commands within the `Mobile-Expensify` directory.
603604

604605
### Adding HybridApp-related patches
605606

@@ -805,7 +806,7 @@ Some pointers:
805806
- When working with translations that involve plural forms, it's important to handle different cases correctly.
806807

807808
For example:
808-
- zero: Used when there are no items **(optional)**.
809+
- zero: Used when there are no items **(optional)**.
809810
- one: Used when there's exactly one item.
810811
- two: Used when there's two items. **(optional)**
811812
- few: Used for a small number of items **(optional)**.

__mocks__/@ua/react-native-airship.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ enum EventType {
66
PushReceived = 'com.airship.push_received',
77
}
88

9-
// eslint-disable-next-line no-restricted-syntax
10-
enum PermissionStatus {
11-
Granted = 'granted',
12-
Denied = 'denied',
13-
NotDetermined = 'not_determined',
14-
}
15-
169
// eslint-disable-next-line @typescript-eslint/no-namespace
1710
namespace iOS {
1811
/**
@@ -78,4 +71,4 @@ const Airship: Partial<AirshipRoot> = {
7871

7972
export default Airship;
8073

81-
export {EventType, iOS, PermissionStatus};
74+
export {EventType, iOS};

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ android {
114114
minSdkVersion rootProject.ext.minSdkVersion
115115
targetSdkVersion rootProject.ext.targetSdkVersion
116116
multiDexEnabled rootProject.ext.multiDexEnabled
117-
versionCode 1009018803
118-
versionName "9.1.88-3"
117+
versionCode 1009018921
118+
versionName "9.1.89-21"
119119
// Supported language variants must be declared here to avoid from being removed during the compilation.
120120
// This also helps us to not include unnecessary language variants in the APK.
121121
resConfigs "en", "es"

contributingGuides/STYLE.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,8 +1269,10 @@ The correct approach is avoid using `ScrollView`. You can add props like `listHe
12691269
</ScrollView>
12701270
```
12711271
1272-
### Correct Approach (Using `SelectionList`)
1272+
### Correct Approach
1273+
The correct approach is to use the list component's built-in header and footer props instead of wrapping in a `ScrollView`:
12731274
1275+
- Using `SelectionList`
12741276
```jsx
12751277
<SelectionList
12761278
sections={[{item}]}
@@ -1281,6 +1283,20 @@ The correct approach is avoid using `ScrollView`. You can add props like `listHe
12811283
/>
12821284
```
12831285
1286+
- If you can't switch to `SelectionList` or `FlatList`, you can use `FlashList` as an alternative approach:
1287+
```jsx
1288+
<ScrollView>
1289+
<Text>Header Content</Text>
1290+
<FlashList
1291+
data={data}
1292+
renderItem={RadioListItem}
1293+
estimatedItemSize={variables.optionRowHeight}
1294+
keyExtractor={keyExtractor}
1295+
/>
1296+
<Button title="Submit" onPress={handleSubmit} />
1297+
</ScrollView>
1298+
```
1299+
12841300
This ensures optimal performance and avoids layout issues.
12851301
12861302

0 commit comments

Comments
 (0)