Skip to content

Commit

Permalink
Merge branch 'Expensify:main' into fixN3-49974-attachment-infinite-lo…
Browse files Browse the repository at this point in the history
…ading
  • Loading branch information
Kalydosos authored Nov 12, 2024
2 parents 6207c96 + 8a1052a commit 17c7206
Show file tree
Hide file tree
Showing 205 changed files with 4,044 additions and 2,008 deletions.
10 changes: 9 additions & 1 deletion .well-known/assetlinks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,12 @@
"package_name": "com.expensify.chat",
"sha256_cert_fingerprints": ["2E:65:6F:1C:34:F5:7E:BF:FC:C0:2D:A3:14:0E:83:FE:61:51:F2:9B:5D:59:58:61:C4:4D:A9:99:0C:CA:F4:8E"]
}
}]
},
{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "org.me.mobiexpensifyg",
"sha256_cert_fingerprints": ["87:03:DC:2B:20:99:CB:F7:AF:39:0C:8F:F2:E4:78:F2:61:E9:D1:7E:F4:AF:E5:02:D9:72:F2:4D:1F:29:FF:65"]
}
}]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* [Expensify Code of Conduct](CODE_OF_CONDUCT.md)
* [Contributor License Agreement](contributingGuides/CLA.md)
* [React StrictMode](contributingGuides/STRICT_MODE.md)
* [Left Hand Navigation(LHN)](contributingGuides/LEFT_HAND_NAVIGATION.md)

----

Expand Down
5 changes: 5 additions & 0 deletions __mocks__/@react-native-firebase/analytics.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default function analytics() {
return {
logEvent: jest.fn(),
};
}
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1009005803
versionName "9.0.58-3"
versionCode 1009006000
versionName "9.0.60-0"
// Supported language variants must be declared here to avoid from being removed during the compilation.
// This also helps us to not include unnecessary language variants in the APK.
resConfigs "en", "es"
Expand Down
2 changes: 1 addition & 1 deletion config/webpack/webpack.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const getCommonConfiguration = ({file = '.env', platform = 'web'}: Environment):
isWeb: platform === 'web',
isProduction: file === '.env.production',
isStaging: file === '.env.staging',
useThirdPartyScripts: process.env.USE_THIRD_PARTY_SCRIPTS === 'true' || (platform === 'web' && file === '.env.production'),
useThirdPartyScripts: process.env.USE_THIRD_PARTY_SCRIPTS === 'true' || (platform === 'web' && ['.env.production', '.env.staging'].includes(file)),
}),
new PreloadWebpackPlugin({
rel: 'preload',
Expand Down
1 change: 1 addition & 0 deletions contributingGuides/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ You can create as many accounts as needed in order to test your changes directly

1. When testing chat functionality in the app please do this between accounts you or your fellow contributors own - **do not test chatting with Concierge**, as this diverts to our customer support team. Thank you.
2. A member of our customer onboarding team gets auto-assigned to every new policy created by a non-paying account to help them set up. Please **do not interact with these teams, ask for calls, or support on your issues.** If you do need to test functionality inside the defaultRooms (#admins & #announce) for any issues you’re working on, please let them know that you are a contributor and don’t need assistance. They will proceed to ignore the chat.
3. Please **do not post in any Expensify owned public room for testing** (e.g #exfy-roadmap, #new-expensify-feedback). These rooms include real customers and investors. You can create your own public rooms, or [use this test public room](https://staging.new.expensify.com/r/2091104345528462) on either staging or production. Thanks!

#### Generating Multiple Test Accounts
You can generate multiple test accounts by using a `+` postfix, for example if your email is [email protected], you can create multiple New Expensify accounts connected to the same email address by using [email protected], [email protected], etc.
Expand Down
44 changes: 44 additions & 0 deletions contributingGuides/LEFT_HAND_NAVIGATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## OVERVIEW

The Left Hand Navigation (LHN) is designed to show different types of reports based on their status, user settings, and specific conditions. Each report type has unique visual indicators and sorting rules to help users quickly identify and prioritize their tasks.

### Types of report displayed in the LHN

The following outlines the expected behavior regarding which reports are displayed in the LHN:

- The report currently being viewed by the user is highlighted as the active report in the LHN, making it easy for users to locate their focus point within the navigation.
If a report has unresolved issues, like an unapproved expense or outstanding violations, it will display a red dot next to it, indicating urgent action is required. These reports are displayed at the top of the LHN list (under pinned chats) and sorted alphabetically by report name for easy access.
- Reports that need user action, such as responding to a message that mentions them, completing an assigned task, or addressing an expense, will display a green dot next to them. Additionally, if a system or concierge message indicates a trial period has expired and a payment method is missing, it will prompt the user with a similar green dot. This visual indicator helps users quickly identify where their attention is required.
- If a user has started drafting a comment in a report, a pencil icon as indicator appears next to it in the LHN, letting users know there is an incomplete draft. These reports are sorted alphabetically by report name.
- Pinned reports are always displayed at the top of the LHN list and are sorted alphabetically by name, giving quick access to reports the user wants to keep top-of-mind.
- When the user has focus mode enabled, unread chat messages will display in bold in the LHN. This also applies to reports where notifications are hidden. Unread chats in focus mode are sorted alphabetically by report name to help users locate them more easily.
- Archived reports are displayed in the LHN when the user is in default mode. These reports are shown with an indication that they are archived and are sorted by the date of the last visible action, with the most recent appearing first.
- Self-DM messages will now be displayed in LHN. This allows users who want to track their own notes or messages in the LHN to do so without needing to look elsewhere.

### Types of report excluded from the LHN

Certain reports are excluded from the LHN to avoid clutter and to focus on relevant content for the user:

- Reports that are explicitly marked as hidden.
- Reports with no participants are not displayed, as they lack meaningful content.
- If the user does not have permission to access a report (due to policy restrictions), it will not be shown.
- Transaction threads that contain only one transaction are excluded.
- If a report is an empty chat, unless it's a report user is actively looking at.
- For users with domain-based email addresses, reports are hidden if the includeDomainEmail setting is disabled.
- Reports with a parent message pending deletion.
- When focus mode is enabled and there are no unread messages.

### Sorting priorities for displayed report groups

1. Pinned, RBR and attention-required (GBR) reports:
- Always sorted alphabetically by report name.
2. Error reports:
- Sorted alphabetically by report name.
3. Draft reports:
- Sorted alphabetically by report name.
4. Non-Archived reports:
- In default mode, these are sorted by the lastVisibleActionCreated date, so the most recently updated reports appear first.
- In focus mode, these reports are sorted alphabetically by name for quicker navigation.
5. Archived eports:
- In default mode, these are sorted by lastVisibleActionCreated, with recent reports displayed first.
- In focus mode, archived reports are sorted alphabetically by name.
26 changes: 14 additions & 12 deletions desktop/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {app, BrowserWindow, clipboard, dialog, ipcMain, Menu, shell} from 'electron';
import type {BrowserView, MenuItem, MenuItemConstructorOptions, WebContents, WebviewTag} from 'electron';
import type {BaseWindow, BrowserView, MenuItem, MenuItemConstructorOptions, WebContents, WebviewTag} from 'electron';
import contextMenu from 'electron-context-menu';
import log from 'electron-log';
import type {ElectronLog} from 'electron-log';
Expand Down Expand Up @@ -47,6 +47,8 @@ function pasteAsPlainText(browserWindow: BrowserWindow | BrowserView | WebviewTa
const text = clipboard.readText();

if ('webContents' in browserWindow) {
// https://github.com/sindresorhus/electron-context-menu is passing in deprecated `BrowserView` to this function
// eslint-disable-next-line deprecation/deprecation
browserWindow.webContents.insertText(text);
}
}
Expand Down Expand Up @@ -107,7 +109,7 @@ process.argv.forEach((arg) => {
return;
}

expectedUpdateVersion = arg.substr(`${EXPECTED_UPDATE_VERSION_FLAG}=`.length);
expectedUpdateVersion = arg.slice(`${EXPECTED_UPDATE_VERSION_FLAG}=`.length);
});

// Add the listeners and variables required to ensure that auto-updating
Expand All @@ -132,7 +134,7 @@ const quitAndInstallWithUpdate = () => {
};

/** Menu Item callback to trigger an update check */
const manuallyCheckForUpdates = (menuItem?: MenuItem, browserWindow?: BrowserWindow) => {
const manuallyCheckForUpdates = (menuItem?: MenuItem, browserWindow?: BaseWindow) => {
if (menuItem) {
// Disable item until the check (and download) is complete
// eslint-disable-next-line no-param-reassign -- menu item flags like enabled or visible can be dynamically toggled by mutating the object
Expand Down Expand Up @@ -427,30 +429,30 @@ const mainWindow = (): Promise<void> => {
id: 'back',
accelerator: process.platform === 'darwin' ? 'Cmd+[' : 'Shift+[',
click: () => {
browserWindow.webContents.goBack();
browserWindow.webContents.navigationHistory.goBack();
},
},
{
label: 'backWithKeyShortcut',
visible: false,
accelerator: process.platform === 'darwin' ? 'Cmd+Left' : 'Shift+Left',
click: () => {
browserWindow.webContents.goBack();
browserWindow.webContents.navigationHistory.goBack();
},
},
{
id: 'forward',
accelerator: process.platform === 'darwin' ? 'Cmd+]' : 'Shift+]',
click: () => {
browserWindow.webContents.goForward();
browserWindow.webContents.navigationHistory.goForward();
},
},
{
label: 'forwardWithKeyShortcut',
visible: false,
accelerator: process.platform === 'darwin' ? 'Cmd+Right' : 'Shift+Right',
click: () => {
browserWindow.webContents.goForward();
browserWindow.webContents.navigationHistory.goForward();
},
},
],
Expand Down Expand Up @@ -507,7 +509,7 @@ const mainWindow = (): Promise<void> => {
const denial = {action: 'deny'} as const;

// Make sure local urls stay in electron perimeter
if (url.substr(0, 'file://'.length).toLowerCase() === 'file://') {
if (url.slice(0, 'file://'.length).toLowerCase() === 'file://') {
return denial;
}

Expand Down Expand Up @@ -539,19 +541,19 @@ const mainWindow = (): Promise<void> => {
// Initiating a browser-back or browser-forward with mouse buttons should navigate history.
browserWindow.on('app-command', (e, cmd) => {
if (cmd === 'browser-backward') {
browserWindow.webContents.goBack();
browserWindow.webContents.navigationHistory.goBack();
}
if (cmd === 'browser-forward') {
browserWindow.webContents.goForward();
browserWindow.webContents.navigationHistory.goForward();
}
});

browserWindow.on('swipe', (e, direction) => {
if (direction === 'left') {
browserWindow.webContents.goBack();
browserWindow.webContents.navigationHistory.goBack();
}
if (direction === 'right') {
browserWindow.webContents.goForward();
browserWindow.webContents.navigationHistory.goForward();
}
});

Expand Down
Loading

0 comments on commit 17c7206

Please sign in to comment.