From d77c6c01458b7e3a94225173729e232654a8d728 Mon Sep 17 00:00:00 2001
From: Blazej Kustra <blazej.kustra@swmansion.com>
Date: Mon, 27 Jan 2025 11:42:00 +0100
Subject: [PATCH 1/8] Add more details and reorganise HybridApp docs

---
 Mobile-Expensify |   2 +-
 README.md        | 174 +++++++++++++++++++++++++++++------------------
 2 files changed, 107 insertions(+), 69 deletions(-)

diff --git a/Mobile-Expensify b/Mobile-Expensify
index e8427456032e..724af847c83d 160000
--- a/Mobile-Expensify
+++ b/Mobile-Expensify
@@ -1 +1 @@
-Subproject commit e8427456032e803863da64610f17a2ea948b9b75
+Subproject commit 724af847c83d5c6b2a342eaca12db3cb3c03dc6b
diff --git a/README.md b/README.md
index 42d96ea06dbc..44b66df440e0 100644
--- a/README.md
+++ b/README.md
@@ -463,19 +463,40 @@ You can only build HybridApp if you have been granted access to [`Mobile-Expensi
     [url "https://github.com/"]
         insteadOf = ssh://git@github.com/
     ```
-3. The first time you build the app you will need to build YAPL (OldDot javascript logic). Simply run `npm run grunt:build:shared` from the `Mobile-Expensify` submodule
-    - The following runtime error often indicates that YAPL has not been built correctly: `undefined is not an object (evaluating'Store.ReportHistory.bindCacheClearingEvents')`
 
-At this point, the default behavior of some `npm` scripts will change to target HybridApp:
-- `npm run android` - build HybridApp for Android
-- `npm run ios` - build HybridApp for iOS
-- `npm run ipad` - build HybridApp for iPad
-- `npm run ipad-sm` - build HybridApp for small iPad
-- `npm run pod-install` - install pods for HybridApp
-- `npm run clean` - clean native code of HybridApp
+> [!Note]  
+> #### For external contributors
+>
+> 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:
+>
+> `cd Mobile-Expensify && git remote set-url origin <YOUR_FORK_URL>`
+>
+> This way, you'll attach the submodule to your fork repository.
+
+- Before building the app, you need to install dependencies. Run `npm install` from `Expensify/App` (this will also install dependencies for `Mobile-Expensify`)
+
+**At this point, the default behavior of some `npm` scripts will change to target HybridApp:**
+| Command               | Description                        |
+| --------------------- | ---------------------------------- |
+| `npm run android`     | Build **HybridApp** for Android    |
+| `npm run ios`         | Build **HybridApp** for iOS        |
+| `npm run ipad`        | Build **HybridApp** for iPad       |
+| `npm run ipad-sm`     | Build **HybridApp** for small iPad |
+| `npm run pod-install` | Install pods for **HybridApp**     |
+| `npm run clean`       | Clean native code of **HybridApp** |
 
 If for some reason, you need to target the standalone NewDot application, you can append `*-standalone` to each of these scripts (eg. `npm run ios-standalone` will build NewDot instead of HybridApp). The same concept applies to the installation of standalone NewDot node modules. To skip the installation of HybridApp-specific patches and node modules, use `npm run i-standalone` or `npm run install-standalone`.
 
+| Command                          | Description                                                 |
+| -------------------------------- | ----------------------------------------------------------- |
+| `npm run install-standalone`     | Install standalone **NewDot** node modules (`npm install`). |
+| `npm run clean-standalone`       | Clean native code for standalone **NewDot**.                |
+| `npm run android-standalone`     | Build **NewDot** for Android in standalone mode.            |
+| `npm run ios-standalone`         | Build **NewDot** for iOS in standalone mode.                |
+| `npm run pod-install-standalone` | Install pods for standalone **NewDot**.                     |
+| `npm run ipad-standalone`        | Build **NewDot** for iPad in standalone mode.               |
+| `npm run ipad-sm-standalone`     | Build **NewDot** for small iPad in standalone mode.         |
+
 ## Working with HybridApp
 Day-to-day work with HybridApp shouldn't differ much from the work on the standalone NewDot repo. 
 
@@ -488,24 +509,41 @@ Additionally, If you'd like to open the HybridApp project in Android Studio or X
 - Android: `./Mobile-Expensify/Android`
 - iOS: `./Mobile-Expensify/iOS/Expensify.xcworkspace`
 
-### Updating the Mobile-Expensify submodule
+### Working with HybridApp vs Standalone NewDot
 
-`Mobile-Expensify` directory is a git submodule. It means, that it points to a specific commit on the `Mobile-Expensify` repository. If you'd like to download the most recent changes from `main`, please use the following command:
+Day-to-day work with **HybridApp** shouldn't differ much from working on the standalone **NewDot** repository.  
+The primary difference is that the native code, which runs React Native, is located in the following directories:  
 
-`git submodule update --remote`
+- `./Mobile-Expensify/Android`
+- `./Mobile-Expensify/iOS`
 
-### Modifying Mobile-Expensify code
+### Important Notes:
+1. **Root Folders Do Not Affect HybridApp Builds:**
+   Changes made to the `./android` and `./ios` folders at the root of the repository **won't affect the HybridApp build**.  
 
-It's important to emphasise 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. 
+2. **Modifying iOS Code for HybridApp:**
+   - If you need to remove `Pods`, you must do it in the **`./Mobile-Expensify/iOS`** directory.
 
-> [!Note]  
-> #### For external contributors
->
-> 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:
->
-> `cd Mobile-Expensify && git remote set-url origin <YOUR_FORK_URL>`
->
-> This way, you'll attach the submodule to your fork repository.
+3. **Modifying Android Builds for HybridApp:**
+   - If you'd like to delete files such as `.cxx`, `build`, or `.gradle` directories, you need to navigate to **`./Mobile-Expensify/android`**.
+
+4. **Opening the HybridApp Project in IDEs:**
+   To open the HybridApp project in **Android Studio** or **Xcode**, you **must select the workspace located in the `Mobile-Expensify` directory**:
+   - **Android**: `./Mobile-Expensify/Android`
+   - **iOS**: `./Mobile-Expensify/iOS/Expensify.xcworkspace`
+
+### Updating the `Mobile-Expensify` Submodule
+
+The `Mobile-Expensify` directory is a **Git submodule**. This means it points to a specific commit on the `Mobile-Expensify` repository.  
+
+If you'd like to download the most recent changes from the `main` branch, please use the following command:
+```bash
+git submodule update --remote
+```
+
+### Modifying Mobile-Expensify code
+
+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. 
 
 ### Adding HybridApp-related patches
 
@@ -607,22 +645,22 @@ Updated rules for managing members across all types of chats in New Expensify.
 - **Excepting the above, anybody can remove themselves from any object**
 
 1. ### DM
-    |  | Member
-    | :---: | :---:
-    | **Invite** | ❌
-    | **Remove** | ❌
-    | **Leave**  | ❌
-    | **Can be removed**  | ❌
+    |                    | Member |
+    | :----------------: | :----: |
+    |     **Invite**     |   ❌    |
+    |     **Remove**     |   ❌    |
+    |     **Leave**      |   ❌    |
+    | **Can be removed** |   ❌    |
 - DM always has two participants. None of the participant can leave or be removed from the DM. Also no additional member can be invited to the chat.
 
 2. ### Workspace
     1. #### Workspace
-        |   |  Creator  |  Member(Employee/User) | Admin |  Auditor?
-        | :---: | :---:  |  :---: | :---: | :---:
-        | **Invite** | ✅ |  ❌ |  ✅ | ❌
-        | **Remove** | ✅ |  ❌ |  ✅ | ❌
-        | **Leave**  | ❌ |  ✅ |  ❌ | ✅
-        | **Can be removed**  | ❌ |  ✅ | ✅ | ✅
+        |                    | Creator | Member(Employee/User) | Admin | Auditor? |
+        | :----------------: | :-----: | :-------------------: | :---: | :------: |
+        |     **Invite**     |    ✅    |           ❌           |   ✅   |    ❌     |
+        |     **Remove**     |    ✅    |           ❌           |   ✅   |    ❌     |
+        |     **Leave**      |    ❌    |           ✅           |   ❌   |    ✅     |
+        | **Can be removed** |    ❌    |           ✅           |   ✅   |    ✅     |
 
         - Creator can't leave or be removed from their own workspace
         - Admins can't leave from the workspace
@@ -631,43 +669,43 @@ Updated rules for managing members across all types of chats in New Expensify.
         - Members and Auditors cannot invite or remove anyone from the workspace
 
     2. #### Workspace #announce room
-        |   |  Member(Employee/User) | Admin |  Auditor?
-        | :---: | :---:  |  :---: | :---:
-        | **Invite** | ❌ |  ❌ |  ❌
-        | **Remove** | ❌ |  ❌ |  ❌
-        | **Leave**  | ❌ |  ❌ |  ❌
-        | **Can be removed**  | ❌ |  ❌ |  ❌ |
+        |                    | Member(Employee/User) | Admin | Auditor? |
+        | :----------------: | :-------------------: | :---: | :------: |
+        |     **Invite**     |           ❌           |   ❌   |    ❌     |
+        |     **Remove**     |           ❌           |   ❌   |    ❌     |
+        |     **Leave**      |           ❌           |   ❌   |    ❌     |
+        | **Can be removed** |           ❌           |   ❌   |    ❌     |
 
        - No one can leave or be removed from the #announce room
 
     3. #### Workspace #admin room
-        |   |  Admin |
-        | :---: | :---:
-        | **Invite** | ❌
-        | **Remove** | ❌
-        | **Leave**  | ❌
-        | **Can be removed**  | ❌
+        |                    | Admin |
+        | :----------------: | :---: |
+        |     **Invite**     |   ❌   |
+        |     **Remove**     |   ❌   |
+        |     **Leave**      |   ❌   |
+        | **Can be removed** |   ❌   |
 
         - Admins can't leave or be removed from #admins
 
     4. #### Workspace rooms
-        |   |  Creator | Member | Guest(outside of the workspace)
-        | :---: | :---:  |  :---: | :---:
-        | **Invite** | ✅ | ✅ | ✅
-        | **Remove** | ✅ | ✅ | ❌
-        | **Leave**  | ✅ | ✅ | ✅
-        | **Can be removed**  | ✅ | ✅ | ✅
+        |                    | Creator | Member | Guest(outside of the workspace) |
+        | :----------------: | :-----: | :----: | :-----------------------------: |
+        |     **Invite**     |    ✅    |   ✅    |                ✅                |
+        |     **Remove**     |    ✅    |   ✅    |                ❌                |
+        |     **Leave**      |    ✅    |   ✅    |                ✅                |
+        | **Can be removed** |    ✅    |   ✅    |                ✅                |
 
         - Everyone can be removed/can leave from the room including creator
         - Guests are not able to remove anyone from the room
 
     4. #### Workspace chats
-        |   |  Admin | Member(default) | Member(invited)
-        | :---: | :---:  |  :---:  |  :---:
-        | **Invite** | ✅ |  ✅ | ❌
-        | **Remove** | ✅ |  ✅ | ❌
-        | **Leave**  | ❌ |  ❌  | ✅
-        | **Can be removed**  | ❌ | ❌ | ✅
+        |                    | Admin | Member(default) | Member(invited) |
+        | :----------------: | :---: | :-------------: | :-------------: |
+        |     **Invite**     |   ✅   |        ✅        |        ❌        |
+        |     **Remove**     |   ✅   |        ✅        |        ❌        |
+        |     **Leave**      |   ❌   |        ❌        |        ✅        |
+        | **Can be removed** |   ❌   |        ❌        |        ✅        |
 
         - Admins are not able to leave/be removed from the workspace chat
         - Default members(automatically invited) are not able to leave/be removed from the workspace chat
@@ -676,20 +714,20 @@ Updated rules for managing members across all types of chats in New Expensify.
         - Default members and admins are able to remove invited members
 
 3. ### Domain chat
-    |   |  Member
-    | :---: | :---:
-    | **Remove** | ❌
-    | **Leave**  | ❌
-    | **Can be removed**  | ❌
+    |                    | Member |
+    | :----------------: | :----: |
+    |     **Remove**     |   ❌    |
+    |     **Leave**      |   ❌    |
+    | **Can be removed** |   ❌    |
 
 - Domain members can't leave or be removed from their domain chat
 
 4. ### Reports
-    |   |  Submitter | Manager
-    | :---: | :---:  | :---:
-    | **Remove** | ❌ | ❌
-    | **Leave**  | ❌ | ❌
-    | **Can be removed**  | ❌ | ❌
+    |                    | Submitter | Manager |
+    | :----------------: | :-------: | :-----: |
+    |     **Remove**     |     ❌     |    ❌    |
+    |     **Leave**      |     ❌     |    ❌    |
+    | **Can be removed** |     ❌     |    ❌    |
 
 - Report submitters can't leave or be removed from their reports (eg, if they are the report.accountID)
 - Report managers can't leave or be removed from their reports (eg, if they are the report.managerID)

From ef0fb082b68ff1ddf9a3b6327ca4349c48b2563b Mon Sep 17 00:00:00 2001
From: Blazej Kustra <blazej.kustra@swmansion.com>
Date: Mon, 27 Jan 2025 11:47:22 +0100
Subject: [PATCH 2/8] Remove a section that was edited

---
 README.md | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/README.md b/README.md
index 44b66df440e0..502ff4987aa4 100644
--- a/README.md
+++ b/README.md
@@ -497,18 +497,6 @@ If for some reason, you need to target the standalone NewDot application, you ca
 | `npm run ipad-standalone`        | Build **NewDot** for iPad in standalone mode.               |
 | `npm run ipad-sm-standalone`     | Build **NewDot** for small iPad in standalone mode.         |
 
-## Working with HybridApp
-Day-to-day work with HybridApp shouldn't differ much from the work on the standalone NewDot repo. 
-
-The main difference is that the native code which runs React Native is located in `./Mobile-Expensify/Android` and `./Mobile-Expensify/iOS` directories. It means, that changes in `./android` and `./ios` folders in the root **won't affect the HybridApp build**. 
-
-In that case, if you'd like to eg. remove `Pods`, you need to do it in `./Mobile-Expensify/iOS`. The same rule applies to Android builds - if you'd like to delete `.cxx`, `build` or `.gradle` directories, you need to go to `./Mobile-Expensify/android` first. 
-
-Additionally, If you'd like to open the HybridApp project in Android Studio or XCode, you **must choose a workspace located in the `Mobile-Expensify`** directory:
-
-- Android: `./Mobile-Expensify/Android`
-- iOS: `./Mobile-Expensify/iOS/Expensify.xcworkspace`
-
 ### Working with HybridApp vs Standalone NewDot
 
 Day-to-day work with **HybridApp** shouldn't differ much from working on the standalone **NewDot** repository.  

From f7da5d34d3bef17a6c43a0f9a1229532feb9b31e Mon Sep 17 00:00:00 2001
From: Blazej Kustra <blazej.kustra@swmansion.com>
Date: Mon, 27 Jan 2025 11:49:14 +0100
Subject: [PATCH 3/8] Improve README formatting for HybridApp documentation

---
 README.md | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index 502ff4987aa4..63f58cb81904 100644
--- a/README.md
+++ b/README.md
@@ -507,7 +507,7 @@ The primary difference is that the native code, which runs React Native, is loca
 
 ### Important Notes:
 1. **Root Folders Do Not Affect HybridApp Builds:**
-   Changes made to the `./android` and `./ios` folders at the root of the repository **won't affect the HybridApp build**.  
+   - Changes made to the `./android` and `./ios` folders at the root of the repository **won't affect the HybridApp build**.  
 
 2. **Modifying iOS Code for HybridApp:**
    - If you need to remove `Pods`, you must do it in the **`./Mobile-Expensify/iOS`** directory.
@@ -516,9 +516,9 @@ The primary difference is that the native code, which runs React Native, is loca
    - If you'd like to delete files such as `.cxx`, `build`, or `.gradle` directories, you need to navigate to **`./Mobile-Expensify/android`**.
 
 4. **Opening the HybridApp Project in IDEs:**
-   To open the HybridApp project in **Android Studio** or **Xcode**, you **must select the workspace located in the `Mobile-Expensify` directory**:
-   - **Android**: `./Mobile-Expensify/Android`
-   - **iOS**: `./Mobile-Expensify/iOS/Expensify.xcworkspace`
+   - To open the HybridApp project in **Android Studio** or **Xcode**, you **must select the workspace located in the `Mobile-Expensify` directory**:
+     - **Android**: `./Mobile-Expensify/Android`
+     - **iOS**: `./Mobile-Expensify/iOS/Expensify.xcworkspace`
 
 ### Updating the `Mobile-Expensify` Submodule
 
@@ -529,8 +529,6 @@ If you'd like to download the most recent changes from the `main` branch, please
 git submodule update --remote
 ```
 
-### Modifying Mobile-Expensify code
-
 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. 
 
 ### Adding HybridApp-related patches

From 61b87ddd032b3aaa19e7841f6d038aa5f23930f9 Mon Sep 17 00:00:00 2001
From: Blazej Kustra <blazej.kustra@swmansion.com>
Date: Mon, 27 Jan 2025 11:51:44 +0100
Subject: [PATCH 4/8] Reset Mobile-Expensify commit

---
 Mobile-Expensify | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Mobile-Expensify b/Mobile-Expensify
index 724af847c83d..8485e9ef0913 160000
--- a/Mobile-Expensify
+++ b/Mobile-Expensify
@@ -1 +1 @@
-Subproject commit 724af847c83d5c6b2a342eaca12db3cb3c03dc6b
+Subproject commit 8485e9ef0913ba6a3e449de3d91dbfba81c55ed3

From 8bdbcf15a578c75b862ca23e5e4c2c31089fa5a5 Mon Sep 17 00:00:00 2001
From: Blazej Kustra <blazej.kustra@swmansion.com>
Date: Mon, 27 Jan 2025 11:53:01 +0100
Subject: [PATCH 5/8] Revert this time for real

---
 Mobile-Expensify | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Mobile-Expensify b/Mobile-Expensify
index 8485e9ef0913..e8427456032e 160000
--- a/Mobile-Expensify
+++ b/Mobile-Expensify
@@ -1 +1 @@
-Subproject commit 8485e9ef0913ba6a3e449de3d91dbfba81c55ed3
+Subproject commit e8427456032e803863da64610f17a2ea948b9b75

From 42915c862fe4349775adeb5ca110f5c185355b62 Mon Sep 17 00:00:00 2001
From: Blazej Kustra <blazej.kustra@swmansion.com>
Date: Mon, 27 Jan 2025 17:29:37 +0100
Subject: [PATCH 6/8] Update README with HybridApp script reference

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 63f58cb81904..c07e7fc8a771 100644
--- a/README.md
+++ b/README.md
@@ -475,7 +475,7 @@ You can only build HybridApp if you have been granted access to [`Mobile-Expensi
 
 - Before building the app, you need to install dependencies. Run `npm install` from `Expensify/App` (this will also install dependencies for `Mobile-Expensify`)
 
-**At this point, the default behavior of some `npm` scripts will change to target HybridApp:**
+**At this point, the default behavior of some `npm` scripts will change to target HybridApp (the script that determines whether to use HybridApp or standalone scripts can be found in `scripts/is-hybrid-app.sh`):**
 | Command               | Description                        |
 | --------------------- | ---------------------------------- |
 | `npm run android`     | Build **HybridApp** for Android    |

From b098504c025041df54109b4af3a3f5f495b27d22 Mon Sep 17 00:00:00 2001
From: Blazej Kustra <blazej.kustra@swmansion.com>
Date: Tue, 28 Jan 2025 10:45:20 +0100
Subject: [PATCH 7/8] Add Git configuration tip for Mobile-Expensify submodule

---
 README.md | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/README.md b/README.md
index c07e7fc8a771..963191aad331 100644
--- a/README.md
+++ b/README.md
@@ -463,6 +463,13 @@ You can only build HybridApp if you have been granted access to [`Mobile-Expensi
     [url "https://github.com/"]
         insteadOf = ssh://git@github.com/
     ```
+- To prevent `Mobile-Expensify` submodule commit hash changes from appearing in `git status`, configure Git to ignore them by adding this to your local `.git/config`:
+    ```
+    [submodule "Mobile-Expensify"]
+        ignore = all
+    ```
+    This ensures that submodule changes are ignored unless you deliberately update them.
+
 
 > [!Note]  
 > #### For external contributors

From c7e10c0af37ed65cd597e9ad0f3de68dffa29aff Mon Sep 17 00:00:00 2001
From: Blazej Kustra <blazej.kustra@swmansion.com>
Date: Tue, 28 Jan 2025 11:28:15 +0100
Subject: [PATCH 8/8] Update README contributor guidance note

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 963191aad331..3b55f54bead2 100644
--- a/README.md
+++ b/README.md
@@ -472,7 +472,7 @@ You can only build HybridApp if you have been granted access to [`Mobile-Expensi
 
 
 > [!Note]  
-> #### For external contributors
+> #### For external agencies and C+ contributors only
 >
 > 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:
 >
