author
int64
658
755k
date
stringlengths
19
19
timezone
int64
-46,800
43.2k
hash
stringlengths
40
40
message
stringlengths
5
490
mods
list
language
stringclasses
20 values
license
stringclasses
3 values
repo
stringlengths
5
68
original_message
stringlengths
12
491
129,187
28.06.2021 17:10:50
14,400
5452472eb96eb54f76f7a73b0c179aea767aade7
[native] Make ParentThreadHeader horizontally scrollable Test Plan: Play around with it Reviewers: atul, palys-swm Subscribers: KatPo, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/parent-thread-header.react.js", "new_path": "native/chat/parent-thread-header.react.js", "diff": "// @flow\nimport * as React from 'react';\n-import { View, Text } from 'react-native';\n+import { View, Text, ScrollView } from 'react-native';\nimport type { ThreadInfo, ThreadType } from 'lib/types/thread-types';\n@@ -28,37 +28,41 @@ function ParentThreadHeader(props: Props): React.Node {\n}, [parentThreadInfo, navigateToThread]);\nreturn (\n- <View style={styles.parentThreadRow}>\n+ <View style={styles.container}>\n+ <ScrollView\n+ contentContainerStyle={styles.contentContainer}\n+ showsHorizontalScrollIndicator={false}\n+ horizontal={true}\n+ >\n<ThreadVisibility\nthreadType={childThreadType}\ncolor={threadVisibilityColor}\n/>\n- <Text style={styles.parentThreadLabel}>within</Text>\n+ <Text style={styles.within}>within</Text>\n<Button onPress={onPressParentThread}>\n<CommunityPill community={parentThreadInfo} />\n</Button>\n+ </ScrollView>\n</View>\n);\n}\n+const height = 48;\nconst unboundStyles = {\n- parentThreadRow: {\n- alignItems: 'center',\n+ container: {\n+ height,\nbackgroundColor: 'modalSubtext',\n+ },\n+ contentContainer: {\n+ alignItems: 'center',\nflexDirection: 'row',\n- paddingLeft: 12,\n- paddingVertical: 6,\n+ paddingHorizontal: 12,\n},\n- parentThreadLabel: {\n+ within: {\ncolor: 'modalSubtextLabel',\nfontSize: 16,\npaddingHorizontal: 6,\n},\n- parentThreadName: {\n- color: 'modalForegroundLabel',\n- fontSize: 16,\n- paddingLeft: 6,\n- },\n};\nexport default ParentThreadHeader;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Make ParentThreadHeader horizontally scrollable Test Plan: Play around with it Reviewers: atul, palys-swm Reviewed By: atul, palys-swm Subscribers: KatPo, Adrian Differential Revision: https://phabricator.ashoat.com/D1528
129,184
28.06.2021 13:13:39
14,400
c0dd5b067a1bba85513cb69b6d0cd5e9d40668ea
[lib] Introduce `ReportStore` type and move `EnabledReports` to `report-types.js` Summary: Move types/constants and fixed paths in preparation for subsequent diffs Test Plan: Nothing changed functionally Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "lib/reducers/enabled-reports-reducer.js", "new_path": "lib/reducers/enabled-reports-reducer.js", "diff": "@@ -6,12 +6,12 @@ import {\nlogInActionTypes,\n} from '../actions/user-actions';\nimport { isStaff } from '../shared/user-utils';\n+import type { BaseAction } from '../types/redux-types';\nimport {\ntype EnabledReports,\ndefaultEnabledReports,\ndefaultDevEnabledReports,\n-} from '../types/enabled-reports';\n-import type { BaseAction } from '../types/redux-types';\n+} from '../types/report-types';\nimport { setNewSessionActionType } from '../utils/action-utils';\nimport { isDev } from '../utils/dev-utils';\n" }, { "change_type": "DELETE", "old_path": "lib/types/enabled-reports.js", "new_path": null, "diff": "-// @flow\n-\n-export type EnabledReports = {|\n- +crashReports: boolean,\n- +inconsistencyReports: boolean,\n- +mediaReports: boolean,\n-|};\n-\n-export type SupportedReports = $Keys<EnabledReports>;\n-\n-export const defaultEnabledReports: EnabledReports = {\n- crashReports: false,\n- inconsistencyReports: false,\n- mediaReports: false,\n-};\n-\n-export const defaultDevEnabledReports: EnabledReports = {\n- crashReports: true,\n- inconsistencyReports: true,\n- mediaReports: true,\n-};\n" }, { "change_type": "MODIFY", "old_path": "lib/types/redux-types.js", "new_path": "lib/types/redux-types.js", "diff": "@@ -13,7 +13,6 @@ import type {\nSetThreadUnreadStatusPayload,\n} from './activity-types';\nimport type { EnabledApps, SupportedApps } from './enabled-apps';\n-import type { EnabledReports } from './enabled-reports';\nimport type {\nRawEntryInfo,\nEntryStore,\n@@ -47,6 +46,7 @@ import type { RawTextMessageInfo } from './messages/text';\nimport type { BaseNavInfo } from './nav-types';\nimport type { RelationshipErrors } from './relationship-types';\nimport type {\n+ EnabledReports,\nClearDeliveredReportsPayload,\nClientReportCreationRequest,\nQueueReportsPayload,\n" }, { "change_type": "MODIFY", "old_path": "lib/types/report-types.js", "new_path": "lib/types/report-types.js", "diff": "@@ -9,6 +9,31 @@ import type { AppState, BaseAction } from './redux-types';\nimport { type RawThreadInfo } from './thread-types';\nimport type { UserInfo, UserInfos } from './user-types';\n+export type EnabledReports = {|\n+ +crashReports: boolean,\n+ +inconsistencyReports: boolean,\n+ +mediaReports: boolean,\n+|};\n+\n+export type SupportedReports = $Keys<EnabledReports>;\n+\n+export const defaultEnabledReports: EnabledReports = {\n+ crashReports: false,\n+ inconsistencyReports: false,\n+ mediaReports: false,\n+};\n+\n+export const defaultDevEnabledReports: EnabledReports = {\n+ crashReports: true,\n+ inconsistencyReports: true,\n+ mediaReports: true,\n+};\n+\n+export type ReportStore = {|\n+ +enabledReports: EnabledReports,\n+ +queuedReports: $ReadOnlyArray<ClientReportCreationRequest>,\n+|};\n+\nexport const reportTypes = Object.freeze({\nERROR: 0,\nTHREAD_INCONSISTENCY: 1,\n" }, { "change_type": "MODIFY", "old_path": "lib/utils/report-utils.js", "new_path": "lib/utils/report-utils.js", "diff": "// @flow\n-import { type SupportedReports } from '../types/enabled-reports';\n+import { type SupportedReports } from '../types/report-types';\nimport { useSelector } from './redux-utils';\nfunction useIsReportEnabled(reportType: SupportedReports): boolean {\n" }, { "change_type": "MODIFY", "old_path": "native/profile/toggle-report.react.js", "new_path": "native/profile/toggle-report.react.js", "diff": "@@ -5,7 +5,7 @@ import { Switch } from 'react-native';\nimport { useDispatch } from 'react-redux';\nimport { updateReportsEnabledActionType } from 'lib/reducers/enabled-reports-reducer';\n-import { type SupportedReports } from 'lib/types/enabled-reports';\n+import { type SupportedReports } from 'lib/types/report-types';\nimport { useIsReportEnabled } from 'lib/utils/report-utils';\ntype Props = {|\n" }, { "change_type": "MODIFY", "old_path": "native/redux/redux-setup.js", "new_path": "native/redux/redux-setup.js", "diff": "@@ -20,7 +20,6 @@ import {\ninvalidSessionRecovery,\n} from 'lib/shared/account-utils';\nimport { type EnabledApps, defaultEnabledApps } from 'lib/types/enabled-apps';\n-import { type EnabledReports } from 'lib/types/enabled-reports';\nimport { type EntryStore } from 'lib/types/entry-types';\nimport {\ntype CalendarFilter,\n@@ -30,6 +29,7 @@ import type { LifecycleState } from 'lib/types/lifecycle-state-types';\nimport type { LoadingStatus } from 'lib/types/loading-types';\nimport type { MessageStore } from 'lib/types/message-types';\nimport type { Dispatch } from 'lib/types/redux-types';\n+import { type EnabledReports } from 'lib/types/report-types';\nimport type { ClientReportCreationRequest } from 'lib/types/report-types';\nimport type { SetSessionPayload } from 'lib/types/session-types';\nimport {\n" }, { "change_type": "MODIFY", "old_path": "server/src/responders/website-responders.js", "new_path": "server/src/responders/website-responders.js", "diff": "@@ -17,9 +17,9 @@ import { mostRecentReadThread } from 'lib/selectors/thread-selectors';\nimport { mostRecentMessageTimestamp } from 'lib/shared/message-utils';\nimport { threadHasPermission } from 'lib/shared/thread-utils';\nimport { defaultWebEnabledApps } from 'lib/types/enabled-apps';\n-import { defaultEnabledReports } from 'lib/types/enabled-reports';\nimport { defaultCalendarFilters } from 'lib/types/filter-types';\nimport { defaultNumberPerThread } from 'lib/types/message-types';\n+import { defaultEnabledReports } from 'lib/types/report-types';\nimport { defaultConnectionInfo } from 'lib/types/socket-types';\nimport { threadPermissions } from 'lib/types/thread-types';\nimport type { CurrentUserInfo } from 'lib/types/user-types';\n" }, { "change_type": "MODIFY", "old_path": "web/redux/redux-setup.js", "new_path": "web/redux/redux-setup.js", "diff": "@@ -11,14 +11,16 @@ import { mostRecentReadThreadSelector } from 'lib/selectors/thread-selectors';\nimport { invalidSessionDowngrade } from 'lib/shared/account-utils';\nimport type { Shape } from 'lib/types/core';\nimport type { EnabledApps } from 'lib/types/enabled-apps';\n-import type { EnabledReports } from 'lib/types/enabled-reports';\nimport type { EntryStore } from 'lib/types/entry-types';\nimport type { CalendarFilter } from 'lib/types/filter-types';\nimport type { LifecycleState } from 'lib/types/lifecycle-state-types';\nimport type { LoadingStatus } from 'lib/types/loading-types';\nimport type { MessageStore } from 'lib/types/message-types';\nimport type { BaseAction } from 'lib/types/redux-types';\n-import type { ClientReportCreationRequest } from 'lib/types/report-types';\n+import type {\n+ EnabledReports,\n+ ClientReportCreationRequest,\n+} from 'lib/types/report-types';\nimport type { ConnectionInfo } from 'lib/types/socket-types';\nimport type { ThreadStore } from 'lib/types/thread-types';\nimport type { CurrentUserInfo, UserStore } from 'lib/types/user-types';\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Introduce `ReportStore` type and move `EnabledReports` to `report-types.js` Summary: Move types/constants and fixed paths in preparation for subsequent diffs Test Plan: Nothing changed functionally Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1510
129,184
28.06.2021 13:42:46
14,400
3a9c7dad0e3d05a0174dd0809f919943ab006a90
[lib] Include `enabledReports` in newly-created `reportStore` and rename `enabledReportsReducer` to `reportStoreReducer` Summary: refactor Test Plan: Toggled various reporting settings on/off in `privacy-preferences` and checked in redux dev tools that state was/changed as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "lib/reducers/master-reducer.js", "new_path": "lib/reducers/master-reducer.js", "diff": "@@ -11,7 +11,6 @@ import reduceCalendarFilters from './calendar-filters-reducer';\nimport reduceConnectionInfo from './connection-reducer';\nimport reduceDataLoaded from './data-loaded-reducer';\nimport reduceEnabledApps from './enabled-apps-reducer';\n-import reduceEnabledReports from './enabled-reports-reducer';\nimport { reduceEntryInfos } from './entry-reducer';\nimport reduceLifecycleState from './lifecycle-state-reducer';\nimport { reduceLoadingStatuses } from './loading-reducer';\n@@ -19,6 +18,7 @@ import reduceNextLocalID from './local-id-reducer';\nimport { reduceMessageStore } from './message-reducer';\nimport reduceBaseNavInfo from './nav-reducer';\nimport reduceQueuedReports from './report-reducer';\n+import reduceReportStore from './report-store-reducer';\nimport reduceThreadInfos from './thread-reducer';\nimport reduceUpdatesCurrentAsOf from './updates-reducer';\nimport reduceURLPrefix from './url-prefix-reducer';\n@@ -76,7 +76,7 @@ export default function baseReducer<N: BaseNavInfo, T: BaseAppState<N>>(\nconnection,\nlifecycleState: reduceLifecycleState(state.lifecycleState, action),\nenabledApps: reduceEnabledApps(state.enabledApps, action),\n- enabledReports: reduceEnabledReports(state.enabledReports, action),\n+ reportStore: reduceReportStore(state.reportStore, action),\nnextLocalID: reduceNextLocalID(state.nextLocalID, action),\nqueuedReports: reduceQueuedReports(state.queuedReports, action),\ndataLoaded: reduceDataLoaded(state.dataLoaded, action),\n" }, { "change_type": "RENAME", "old_path": "lib/reducers/enabled-reports-reducer.js", "new_path": "lib/reducers/report-store-reducer.js", "diff": "@@ -8,7 +8,7 @@ import {\nimport { isStaff } from '../shared/user-utils';\nimport type { BaseAction } from '../types/redux-types';\nimport {\n- type EnabledReports,\n+ type ReportStore,\ndefaultEnabledReports,\ndefaultDevEnabledReports,\n} from '../types/report-types';\n@@ -17,23 +17,33 @@ import { isDev } from '../utils/dev-utils';\nexport const updateReportsEnabledActionType = 'UPDATE_REPORTS_ENABLED';\n-export default function reduceEnabledReports(\n- state: EnabledReports,\n+export default function reduceReportStore(\n+ state: ReportStore,\naction: BaseAction,\n-): EnabledReports {\n+): ReportStore {\nif (action.type === updateReportsEnabledActionType) {\n- return { ...state, ...action.payload };\n+ return {\n+ ...state,\n+ enabledReports: { ...state.enabledReports, ...action.payload },\n+ };\n} else if (\naction.type === logOutActionTypes.success ||\naction.type === deleteAccountActionTypes.success ||\n(action.type === setNewSessionActionType &&\naction.payload.sessionChange.cookieInvalidated)\n) {\n- return isDev ? defaultDevEnabledReports : defaultEnabledReports;\n+ return {\n+ ...state,\n+ enabledReports: isDev ? defaultDevEnabledReports : defaultEnabledReports,\n+ };\n} else if (action.type === logInActionTypes.success) {\n- return isStaff(action.payload.currentUserInfo.id) || isDev\n+ return {\n+ ...state,\n+ enabledReports:\n+ isStaff(action.payload.currentUserInfo.id) || isDev\n? defaultDevEnabledReports\n- : defaultEnabledReports;\n+ : defaultEnabledReports,\n+ };\n}\nreturn state;\n}\n" }, { "change_type": "MODIFY", "old_path": "lib/types/redux-types.js", "new_path": "lib/types/redux-types.js", "diff": "@@ -50,6 +50,7 @@ import type {\nClearDeliveredReportsPayload,\nClientReportCreationRequest,\nQueueReportsPayload,\n+ ReportStore,\n} from './report-types';\nimport type { ProcessServerRequestsPayload } from './request-types';\nimport type { UserSearchResult } from './search-types';\n@@ -88,7 +89,7 @@ export type BaseAppState<NavInfo: BaseNavInfo> = {\nwatchedThreadIDs: $ReadOnlyArray<string>,\nlifecycleState: LifecycleState,\nenabledApps: EnabledApps,\n- enabledReports: EnabledReports,\n+ reportStore: ReportStore,\nnextLocalID: number,\nqueuedReports: $ReadOnlyArray<ClientReportCreationRequest>,\ndataLoaded: boolean,\n" }, { "change_type": "MODIFY", "old_path": "lib/utils/report-utils.js", "new_path": "lib/utils/report-utils.js", "diff": "@@ -4,7 +4,7 @@ import { type SupportedReports } from '../types/report-types';\nimport { useSelector } from './redux-utils';\nfunction useIsReportEnabled(reportType: SupportedReports): boolean {\n- return useSelector((state) => state.enabledReports[reportType]);\n+ return useSelector((state) => state.reportStore.enabledReports[reportType]);\n}\nexport { useIsReportEnabled };\n" }, { "change_type": "MODIFY", "old_path": "native/profile/toggle-report.react.js", "new_path": "native/profile/toggle-report.react.js", "diff": "@@ -4,7 +4,7 @@ import * as React from 'react';\nimport { Switch } from 'react-native';\nimport { useDispatch } from 'react-redux';\n-import { updateReportsEnabledActionType } from 'lib/reducers/enabled-reports-reducer';\n+import { updateReportsEnabledActionType } from 'lib/reducers/report-store-reducer';\nimport { type SupportedReports } from 'lib/types/report-types';\nimport { useIsReportEnabled } from 'lib/utils/report-utils';\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -236,6 +236,18 @@ const migrations = {\n},\n};\n},\n+ [27]: (state) => ({\n+ ...state,\n+ enabledReports: undefined,\n+ reportStore: {\n+ enabledReports: {\n+ crashReports: __DEV__,\n+ inconsistencyReports: __DEV__,\n+ mediaReports: __DEV__,\n+ },\n+ queuedReports: [],\n+ },\n+ }),\n};\nconst persistConfig = {\n@@ -250,7 +262,7 @@ const persistConfig = {\n'frozen',\n],\ndebug: __DEV__,\n- version: 26,\n+ version: 27,\nmigrate: createMigrate(migrations, { debug: __DEV__ }),\ntimeout: __DEV__ ? 0 : undefined,\n};\n" }, { "change_type": "MODIFY", "old_path": "native/redux/redux-setup.js", "new_path": "native/redux/redux-setup.js", "diff": "@@ -29,7 +29,7 @@ import type { LifecycleState } from 'lib/types/lifecycle-state-types';\nimport type { LoadingStatus } from 'lib/types/loading-types';\nimport type { MessageStore } from 'lib/types/message-types';\nimport type { Dispatch } from 'lib/types/redux-types';\n-import { type EnabledReports } from 'lib/types/report-types';\n+import { type ReportStore } from 'lib/types/report-types';\nimport type { ClientReportCreationRequest } from 'lib/types/report-types';\nimport type { SetSessionPayload } from 'lib/types/session-types';\nimport {\n@@ -111,7 +111,7 @@ export type AppState = {|\nwatchedThreadIDs: $ReadOnlyArray<string>,\nlifecycleState: LifecycleState,\nenabledApps: EnabledApps,\n- enabledReports: EnabledReports,\n+ reportStore: ReportStore,\nnextLocalID: number,\nqueuedReports: $ReadOnlyArray<ClientReportCreationRequest>,\n_persist: ?PersistState,\n@@ -161,11 +161,14 @@ const defaultState = ({\nwatchedThreadIDs: [],\nlifecycleState: 'active',\nenabledApps: defaultEnabledApps,\n+ reportStore: {\nenabledReports: {\ncrashReports: __DEV__,\ninconsistencyReports: __DEV__,\nmediaReports: __DEV__,\n},\n+ queuedReports: [],\n+ },\nnextLocalID: 0,\nqueuedReports: [],\n_persist: null,\n" }, { "change_type": "MODIFY", "old_path": "server/src/responders/website-responders.js", "new_path": "server/src/responders/website-responders.js", "diff": "@@ -273,7 +273,10 @@ async function websiteResponder(\nwatchedThreadIDs: [],\nlifecycleState: 'active',\nenabledApps: defaultWebEnabledApps,\n+ reportStore: {\nenabledReports: defaultEnabledReports,\n+ queuedReports: [],\n+ },\nnextLocalID: 0,\nqueuedReports: [],\ntimeZone: viewer.timeZone,\n" }, { "change_type": "MODIFY", "old_path": "web/redux/redux-setup.js", "new_path": "web/redux/redux-setup.js", "diff": "@@ -18,7 +18,7 @@ import type { LoadingStatus } from 'lib/types/loading-types';\nimport type { MessageStore } from 'lib/types/message-types';\nimport type { BaseAction } from 'lib/types/redux-types';\nimport type {\n- EnabledReports,\n+ ReportStore,\nClientReportCreationRequest,\n} from 'lib/types/report-types';\nimport type { ConnectionInfo } from 'lib/types/socket-types';\n@@ -53,7 +53,7 @@ export type AppState = {|\nwatchedThreadIDs: $ReadOnlyArray<string>,\nlifecycleState: LifecycleState,\nenabledApps: EnabledApps,\n- enabledReports: EnabledReports,\n+ reportStore: ReportStore,\nnextLocalID: number,\nqueuedReports: $ReadOnlyArray<ClientReportCreationRequest>,\ntimeZone: ?string,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Include `enabledReports` in newly-created `reportStore` and rename `enabledReportsReducer` to `reportStoreReducer` Summary: refactor Test Plan: Toggled various reporting settings on/off in `privacy-preferences` and checked in redux dev tools that state was/changed as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1511
129,184
28.06.2021 14:52:44
14,400
34032f19e444f0bbd34802c095a3e8d07adf454f
[lib] Replace `state.queuedReports` with `state.reportStore.queuedReports` Test Plan: Sent media reports and they continued to work as before. But instead of queuing/removing reports from `state.queuedReports`, they were queued/removed from `state.reportStore.queuedReports` Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "lib/reducers/master-reducer.js", "new_path": "lib/reducers/master-reducer.js", "diff": "@@ -17,7 +17,6 @@ import { reduceLoadingStatuses } from './loading-reducer';\nimport reduceNextLocalID from './local-id-reducer';\nimport { reduceMessageStore } from './message-reducer';\nimport reduceBaseNavInfo from './nav-reducer';\n-import reduceQueuedReports from './report-reducer';\nimport reduceReportStore from './report-store-reducer';\nimport reduceThreadInfos from './thread-reducer';\nimport reduceUpdatesCurrentAsOf from './updates-reducer';\n@@ -78,7 +77,6 @@ export default function baseReducer<N: BaseNavInfo, T: BaseAppState<N>>(\nenabledApps: reduceEnabledApps(state.enabledApps, action),\nreportStore: reduceReportStore(state.reportStore, action),\nnextLocalID: reduceNextLocalID(state.nextLocalID, action),\n- queuedReports: reduceQueuedReports(state.queuedReports, action),\ndataLoaded: reduceDataLoaded(state.dataLoaded, action),\n};\n}\n" }, { "change_type": "DELETE", "old_path": "lib/reducers/report-reducer.js", "new_path": null, "diff": "-// @flow\n-\n-import {\n- sendReportActionTypes,\n- sendReportsActionTypes,\n- queueReportsActionType,\n-} from '../actions/report-actions';\n-import type { BaseAction } from '../types/redux-types';\n-import type { ClientReportCreationRequest } from '../types/report-types';\n-\n-export default function reduceQueuedReports(\n- state: $ReadOnlyArray<ClientReportCreationRequest>,\n- action: BaseAction,\n-): $ReadOnlyArray<ClientReportCreationRequest> {\n- if (\n- (action.type === sendReportActionTypes.success ||\n- action.type === sendReportsActionTypes.success) &&\n- action.payload\n- ) {\n- const { payload } = action;\n- const updatedReports = state.filter(\n- (response) => !payload.reports.includes(response),\n- );\n- if (updatedReports.length === state.length) {\n- return state;\n- }\n- return updatedReports;\n- } else if (action.type === queueReportsActionType) {\n- const { reports } = action.payload;\n- return [...state, ...reports];\n- }\n- return state;\n-}\n" }, { "change_type": "MODIFY", "old_path": "lib/selectors/socket-selectors.js", "new_path": "lib/selectors/socket-selectors.js", "diff": "@@ -32,7 +32,7 @@ const queuedReports: (\n) => $ReadOnlyArray<ClientReportCreationRequest> = createSelector(\n(state: AppState) => state.threadStore.inconsistencyReports,\n(state: AppState) => state.entryStore.inconsistencyReports,\n- (state: AppState) => state.queuedReports,\n+ (state: AppState) => state.reportStore.queuedReports,\n(\nthreadInconsistencyReports: $ReadOnlyArray<ClientThreadInconsistencyReportCreationRequest>,\nentryInconsistencyReports: $ReadOnlyArray<ClientEntryInconsistencyReportCreationRequest>,\n" }, { "change_type": "MODIFY", "old_path": "lib/types/redux-types.js", "new_path": "lib/types/redux-types.js", "diff": "@@ -48,7 +48,6 @@ import type { RelationshipErrors } from './relationship-types';\nimport type {\nEnabledReports,\nClearDeliveredReportsPayload,\n- ClientReportCreationRequest,\nQueueReportsPayload,\nReportStore,\n} from './report-types';\n@@ -91,7 +90,6 @@ export type BaseAppState<NavInfo: BaseNavInfo> = {\nenabledApps: EnabledApps,\nreportStore: ReportStore,\nnextLocalID: number,\n- queuedReports: $ReadOnlyArray<ClientReportCreationRequest>,\ndataLoaded: boolean,\n};\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -238,6 +238,7 @@ const migrations = {\n},\n[27]: (state) => ({\n...state,\n+ queuedReports: undefined,\nenabledReports: undefined,\nreportStore: {\nenabledReports: {\n" }, { "change_type": "MODIFY", "old_path": "native/redux/redux-setup.js", "new_path": "native/redux/redux-setup.js", "diff": "@@ -30,7 +30,6 @@ import type { LoadingStatus } from 'lib/types/loading-types';\nimport type { MessageStore } from 'lib/types/message-types';\nimport type { Dispatch } from 'lib/types/redux-types';\nimport { type ReportStore } from 'lib/types/report-types';\n-import type { ClientReportCreationRequest } from 'lib/types/report-types';\nimport type { SetSessionPayload } from 'lib/types/session-types';\nimport {\ntype ConnectionInfo,\n@@ -113,7 +112,6 @@ export type AppState = {|\nenabledApps: EnabledApps,\nreportStore: ReportStore,\nnextLocalID: number,\n- queuedReports: $ReadOnlyArray<ClientReportCreationRequest>,\n_persist: ?PersistState,\nsessionID?: void,\ndimensions: DimensionsInfo,\n@@ -170,7 +168,6 @@ const defaultState = ({\nqueuedReports: [],\n},\nnextLocalID: 0,\n- queuedReports: [],\n_persist: null,\ndimensions: defaultDimensionsInfo,\nconnectivity: defaultConnectivityInfo,\n" }, { "change_type": "MODIFY", "old_path": "server/src/responders/website-responders.js", "new_path": "server/src/responders/website-responders.js", "diff": "@@ -278,7 +278,6 @@ async function websiteResponder(\nqueuedReports: [],\n},\nnextLocalID: 0,\n- queuedReports: [],\ntimeZone: viewer.timeZone,\nuserAgent: viewer.userAgent,\ncookie: undefined,\n" }, { "change_type": "MODIFY", "old_path": "web/redux/redux-setup.js", "new_path": "web/redux/redux-setup.js", "diff": "@@ -17,10 +17,7 @@ import type { LifecycleState } from 'lib/types/lifecycle-state-types';\nimport type { LoadingStatus } from 'lib/types/loading-types';\nimport type { MessageStore } from 'lib/types/message-types';\nimport type { BaseAction } from 'lib/types/redux-types';\n-import type {\n- ReportStore,\n- ClientReportCreationRequest,\n-} from 'lib/types/report-types';\n+import type { ReportStore } from 'lib/types/report-types';\nimport type { ConnectionInfo } from 'lib/types/socket-types';\nimport type { ThreadStore } from 'lib/types/thread-types';\nimport type { CurrentUserInfo, UserStore } from 'lib/types/user-types';\n@@ -55,7 +52,6 @@ export type AppState = {|\nenabledApps: EnabledApps,\nreportStore: ReportStore,\nnextLocalID: number,\n- queuedReports: $ReadOnlyArray<ClientReportCreationRequest>,\ntimeZone: ?string,\nuserAgent: ?string,\ndataLoaded: boolean,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Replace `state.queuedReports` with `state.reportStore.queuedReports` Test Plan: Sent media reports and they continued to work as before. But instead of queuing/removing reports from `state.queuedReports`, they were queued/removed from `state.reportStore.queuedReports` Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1513
129,184
28.06.2021 19:53:57
14,400
4724f81b47b3fb55a8f7e33a6b1885f00428213e
[lib] Move entry/thread inconsistency reports to `state.reportStore.queuedReports` Summary: Move entry/thread inconsistency reports to `state.reportStore.queuedReports` Test Plan: Going to test after diff that filters out media reports from `reportStoreReduder` Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "lib/reducers/entry-reducer.js", "new_path": "lib/reducers/entry-reducer.js", "diff": "@@ -24,10 +24,6 @@ import {\nfetchRevisionsForEntryActionTypes,\nrestoreEntryActionTypes,\n} from '../actions/entry-actions';\n-import {\n- sendReportActionTypes,\n- sendReportsActionTypes,\n-} from '../actions/report-actions';\nimport {\ndeleteThreadActionTypes,\nleaveThreadActionTypes,\n@@ -178,13 +174,8 @@ function reduceEntryInfos(\nentryStore: EntryStore,\naction: BaseAction,\nnewThreadInfos: { +[id: string]: RawThreadInfo },\n-): EntryStore {\n- const {\n- entryInfos,\n- daysToEntries,\n- lastUserInteractionCalendar,\n- inconsistencyReports,\n- } = entryStore;\n+): [EntryStore, $ReadOnlyArray<ClientEntryInconsistencyReportCreationRequest>] {\n+ const { entryInfos, daysToEntries, lastUserInteractionCalendar } = entryStore;\nif (\naction.type === logOutActionTypes.success ||\naction.type === deleteAccountActionTypes.success ||\n@@ -201,23 +192,27 @@ function reduceEntryInfos(\n? 0\n: lastUserInteractionCalendar;\nif (Object.keys(newEntryInfos).length === Object.keys(entryInfos).length) {\n- return {\n+ return [\n+ {\nentryInfos,\ndaysToEntries,\nlastUserInteractionCalendar: newLastUserInteractionCalendar,\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n}\nconst newDaysToEntries = filterExistingDaysToEntriesWithNewEntryInfos(\ndaysToEntries,\nnewEntryInfos,\n);\n- return {\n+ return [\n+ {\nentryInfos: newEntryInfos,\ndaysToEntries: newDaysToEntries,\nlastUserInteractionCalendar: newLastUserInteractionCalendar,\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (action.type === setNewSessionActionType) {\nconst authorizedThreadInfos = _pickBy(threadInFilterList)(newThreadInfos);\nconst newEntryInfos = _pickBy(\n@@ -232,19 +227,23 @@ function reduceEntryInfos(\n? 0\n: lastUserInteractionCalendar;\nif (Object.keys(newEntryInfos).length === Object.keys(entryInfos).length) {\n- return {\n+ return [\n+ {\nentryInfos,\ndaysToEntries,\nlastUserInteractionCalendar: newLastUserInteractionCalendar,\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n}\n- return {\n+ return [\n+ {\nentryInfos: newEntryInfos,\ndaysToEntries: newDaysToEntries,\nlastUserInteractionCalendar: newLastUserInteractionCalendar,\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (action.type === fetchEntriesActionTypes.success) {\nconst [updatedEntryInfos, updatedDaysToEntries] = mergeNewEntryInfos(\nentryInfos,\n@@ -252,23 +251,27 @@ function reduceEntryInfos(\naction.payload.rawEntryInfos,\nnewThreadInfos,\n);\n- return {\n+ return [\n+ {\nentryInfos: updatedEntryInfos,\ndaysToEntries: updatedDaysToEntries,\nlastUserInteractionCalendar,\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (\naction.type === updateCalendarQueryActionTypes.started &&\naction.payload &&\naction.payload.calendarQuery\n) {\n- return {\n+ return [\n+ {\nentryInfos,\ndaysToEntries,\nlastUserInteractionCalendar: Date.now(),\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (action.type === updateCalendarQueryActionTypes.success) {\nconst newLastUserInteractionCalendar = action.payload.calendarQuery\n? Date.now()\n@@ -283,12 +286,14 @@ function reduceEntryInfos(\nupdatedEntryInfos,\naction.payload.deletedEntryIDs,\n);\n- return {\n+ return [\n+ {\nentryInfos: deletionMarkedEntryInfos,\ndaysToEntries: updatedDaysToEntries,\nlastUserInteractionCalendar: newLastUserInteractionCalendar,\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (action.type === createLocalEntryActionType) {\nconst entryInfo = action.payload;\nconst localID = entryInfo.localID;\n@@ -306,12 +311,14 @@ function reduceEntryInfos(\n...daysToEntries,\n[dayString]: _union([localID])(daysToEntries[dayString]),\n};\n- return {\n+ return [\n+ {\nentryInfos: newEntryInfos,\ndaysToEntries: newDaysToEntries,\nlastUserInteractionCalendar: Date.now(),\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (action.type === createEntryActionTypes.success) {\nconst localID = action.payload.localID;\nconst serverID = action.payload.entryID;\n@@ -332,7 +339,7 @@ function reduceEntryInfos(\n)(entryInfos);\n} else {\n// This happens if the entry is deauthorized before it's saved\n- return entryStore;\n+ return [entryStore, []];\n}\nconst [updatedEntryInfos, updatedDaysToEntries] = mergeNewEntryInfos(\n@@ -342,12 +349,14 @@ function reduceEntryInfos(\nnewThreadInfos,\n);\n- return {\n+ return [\n+ {\nentryInfos: updatedEntryInfos,\ndaysToEntries: updatedDaysToEntries,\nlastUserInteractionCalendar: Date.now(),\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (action.type === saveEntryActionTypes.success) {\nconst serverID = action.payload.entryID;\nif (\n@@ -355,7 +364,7 @@ function reduceEntryInfos(\n!threadInFilterList(newThreadInfos[entryInfos[serverID].threadID])\n) {\n// This happens if the entry is deauthorized before it's saved\n- return entryStore;\n+ return [entryStore, []];\n}\nconst [updatedEntryInfos, updatedDaysToEntries] = mergeNewEntryInfos(\n@@ -365,12 +374,14 @@ function reduceEntryInfos(\nnewThreadInfos,\n);\n- return {\n+ return [\n+ {\nentryInfos: updatedEntryInfos,\ndaysToEntries: updatedDaysToEntries,\nlastUserInteractionCalendar: Date.now(),\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (action.type === concurrentModificationResetActionType) {\nconst { payload } = action;\nif (\n@@ -378,7 +389,7 @@ function reduceEntryInfos(\n!threadInFilterList(newThreadInfos[entryInfos[payload.id].threadID])\n) {\n// This happens if the entry is deauthorized before it's restored\n- return entryStore;\n+ return [entryStore, []];\n}\nconst newEntryInfos = {\n...entryInfos,\n@@ -387,12 +398,14 @@ function reduceEntryInfos(\ntext: payload.dbText,\n},\n};\n- return {\n+ return [\n+ {\nentryInfos: newEntryInfos,\ndaysToEntries,\nlastUserInteractionCalendar,\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (action.type === deleteEntryActionTypes.started) {\nconst payload = action.payload;\nconst id =\n@@ -407,12 +420,14 @@ function reduceEntryInfos(\ndeleted: true,\n},\n};\n- return {\n+ return [\n+ {\nentryInfos: newEntryInfos,\ndaysToEntries,\nlastUserInteractionCalendar: Date.now(),\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (action.type === deleteEntryActionTypes.success && action.payload) {\nconst { payload } = action;\nconst [updatedEntryInfos, updatedDaysToEntries] = mergeNewEntryInfos(\n@@ -421,12 +436,14 @@ function reduceEntryInfos(\nmergeUpdateEntryInfos([], payload.updatesResult.viewerUpdates),\nnewThreadInfos,\n);\n- return {\n+ return [\n+ {\nentryInfos: updatedEntryInfos,\ndaysToEntries: updatedDaysToEntries,\nlastUserInteractionCalendar,\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (action.type === fetchRevisionsForEntryActionTypes.success) {\nconst id = action.payload.entryID;\nif (\n@@ -434,7 +451,7 @@ function reduceEntryInfos(\n!threadInFilterList(newThreadInfos[entryInfos[id].threadID])\n) {\n// This happens if the entry is deauthorized before it's restored\n- return entryStore;\n+ return [entryStore, []];\n}\n// Make sure the entry is in sync with its latest revision\nconst newEntryInfos = {\n@@ -445,12 +462,14 @@ function reduceEntryInfos(\ndeleted: action.payload.deleted,\n},\n};\n- return {\n+ return [\n+ {\nentryInfos: newEntryInfos,\ndaysToEntries,\nlastUserInteractionCalendar,\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (action.type === restoreEntryActionTypes.success) {\nconst [updatedEntryInfos, updatedDaysToEntries] = mergeNewEntryInfos(\nentryInfos,\n@@ -458,12 +477,14 @@ function reduceEntryInfos(\nmergeUpdateEntryInfos([], action.payload.updatesResult.viewerUpdates),\nnewThreadInfos,\n);\n- return {\n+ return [\n+ {\nentryInfos: updatedEntryInfos,\ndaysToEntries: updatedDaysToEntries,\nlastUserInteractionCalendar: Date.now(),\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (action.type === logInActionTypes.success) {\nconst { calendarResult } = action.payload;\nif (calendarResult) {\n@@ -473,12 +494,14 @@ function reduceEntryInfos(\ncalendarResult.rawEntryInfos,\nnewThreadInfos,\n);\n- return {\n+ return [\n+ {\nentryInfos: updatedEntryInfos,\ndaysToEntries: updatedDaysToEntries,\nlastUserInteractionCalendar,\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n}\n} else if (action.type === incrementalStateSyncActionType) {\nconst [updatedEntryInfos, updatedDaysToEntries] = mergeNewEntryInfos(\n@@ -494,12 +517,14 @@ function reduceEntryInfos(\nupdatedEntryInfos,\naction.payload.deletedEntryIDs,\n);\n- return {\n+ return [\n+ {\nentryInfos: deletionMarkedEntryInfos,\ndaysToEntries: updatedDaysToEntries,\nlastUserInteractionCalendar,\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (\naction.type === processUpdatesActionType ||\naction.type === joinThreadActionTypes.success ||\n@@ -511,12 +536,14 @@ function reduceEntryInfos(\nmergeUpdateEntryInfos([], action.payload.updatesResult.newUpdates),\nnewThreadInfos,\n);\n- return {\n+ return [\n+ {\nentryInfos: updatedEntryInfos,\ndaysToEntries: updatedDaysToEntries,\nlastUserInteractionCalendar,\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (action.type === fullStateSyncActionType) {\nconst [updatedEntryInfos, updatedDaysToEntries] = mergeNewEntryInfos(\nentryInfos,\n@@ -524,12 +551,14 @@ function reduceEntryInfos(\naction.payload.rawEntryInfos,\nnewThreadInfos,\n);\n- return {\n+ return [\n+ {\nentryInfos: updatedEntryInfos,\ndaysToEntries: updatedDaysToEntries,\nlastUserInteractionCalendar,\n- inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (\naction.type === changeThreadSettingsActionTypes.success ||\naction.type === removeUsersFromThreadActionTypes.success ||\n@@ -540,46 +569,30 @@ function reduceEntryInfos(\n(entry: RawEntryInfo) => authorizedThreadInfos[entry.threadID],\n)(entryInfos);\nif (Object.keys(newEntryInfos).length === Object.keys(entryInfos).length) {\n- return entryStore;\n+ return [entryStore, []];\n}\nconst newDaysToEntries = filterExistingDaysToEntriesWithNewEntryInfos(\ndaysToEntries,\nnewEntryInfos,\n);\n- return {\n+ return [\n+ {\nentryInfos: newEntryInfos,\ndaysToEntries: newDaysToEntries,\nlastUserInteractionCalendar,\n- inconsistencyReports,\n- };\n- } else if (\n- (action.type === sendReportActionTypes.success ||\n- action.type === sendReportsActionTypes.success) &&\n- action.payload\n- ) {\n- const { payload } = action;\n- const updatedReports = inconsistencyReports.filter(\n- (response) => !payload.reports.includes(response),\n- );\n- if (updatedReports.length === inconsistencyReports.length) {\n- return entryStore;\n- }\n- return {\n- entryInfos,\n- daysToEntries,\n- lastUserInteractionCalendar,\n- inconsistencyReports: updatedReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (action.type === processServerRequestsActionType) {\nconst checkStateRequest = action.payload.serverRequests.find(\n(candidate) => candidate.type === serverRequestTypes.CHECK_STATE,\n);\nif (!checkStateRequest || !checkStateRequest.stateChanges) {\n- return entryStore;\n+ return [entryStore, []];\n}\nconst { rawEntryInfos, deleteEntryIDs } = checkStateRequest.stateChanges;\nif (!rawEntryInfos && !deleteEntryIDs) {\n- return entryStore;\n+ return [entryStore, []];\n}\nlet updatedEntryInfos = { ...entryInfos };\n@@ -609,14 +622,17 @@ function reduceEntryInfos(\nupdatedEntryInfos,\naction.payload.calendarQuery,\n);\n- return {\n+\n+ return [\n+ {\nentryInfos: updatedEntryInfos,\ndaysToEntries: updatedDaysToEntries,\nlastUserInteractionCalendar,\n- inconsistencyReports: [...inconsistencyReports, ...newInconsistencies],\n- };\n+ },\n+ newInconsistencies,\n+ ];\n}\n- return entryStore;\n+ return [entryStore, []];\n}\nfunction mergeUpdateEntryInfos(\n" }, { "change_type": "MODIFY", "old_path": "lib/reducers/master-reducer.js", "new_path": "lib/reducers/master-reducer.js", "diff": "@@ -27,9 +27,22 @@ export default function baseReducer<N: BaseNavInfo, T: BaseAppState<N>>(\nstate: T,\naction: BaseAction,\n): T {\n- const threadStore = reduceThreadInfos(state.threadStore, action);\n+ const [threadStore, newThreadInconsistencies] = reduceThreadInfos(\n+ state.threadStore,\n+ action,\n+ );\nconst { threadInfos } = threadStore;\n+ const [entryStore, newEntryInconsistencies] = reduceEntryInfos(\n+ state.entryStore,\n+ action,\n+ threadInfos,\n+ );\n+\n+ const newInconsistencies = [\n+ ...newEntryInconsistencies,\n+ ...newThreadInconsistencies,\n+ ];\n// Only allow checkpoints to increase if we are connected\n// or if the action is a STATE_SYNC\nlet messageStore = reduceMessageStore(\n@@ -63,7 +76,7 @@ export default function baseReducer<N: BaseNavInfo, T: BaseAppState<N>>(\nreturn {\n...state,\nnavInfo: reduceBaseNavInfo(state.navInfo, action),\n- entryStore: reduceEntryInfos(state.entryStore, action, threadInfos),\n+ entryStore,\nloadingStatuses: reduceLoadingStatuses(state.loadingStatuses, action),\ncurrentUserInfo: reduceCurrentUserInfo(state.currentUserInfo, action),\nthreadStore,\n@@ -75,7 +88,11 @@ export default function baseReducer<N: BaseNavInfo, T: BaseAppState<N>>(\nconnection,\nlifecycleState: reduceLifecycleState(state.lifecycleState, action),\nenabledApps: reduceEnabledApps(state.enabledApps, action),\n- reportStore: reduceReportStore(state.reportStore, action),\n+ reportStore: reduceReportStore(\n+ state.reportStore,\n+ action,\n+ newInconsistencies,\n+ ),\nnextLocalID: reduceNextLocalID(state.nextLocalID, action),\ndataLoaded: reduceDataLoaded(state.dataLoaded, action),\n};\n" }, { "change_type": "MODIFY", "old_path": "lib/reducers/report-store-reducer.js", "new_path": "lib/reducers/report-store-reducer.js", "diff": "@@ -16,6 +16,7 @@ import {\ntype ReportStore,\ndefaultEnabledReports,\ndefaultDevEnabledReports,\n+ type ClientReportCreationRequest,\n} from '../types/report-types';\nimport { setNewSessionActionType } from '../utils/action-utils';\nimport { isDev } from '../utils/dev-utils';\n@@ -25,10 +26,15 @@ export const updateReportsEnabledActionType = 'UPDATE_REPORTS_ENABLED';\nexport default function reduceReportStore(\nstate: ReportStore,\naction: BaseAction,\n+ newInconsistencies: $ReadOnlyArray<ClientReportCreationRequest>,\n): ReportStore {\n+ const updatedReports = state.enabledReports.inconsistencyReports\n+ ? [...state.queuedReports, ...newInconsistencies]\n+ : state.queuedReports;\n+\nif (action.type === updateReportsEnabledActionType) {\nreturn {\n- ...state,\n+ queuedReports: updatedReports,\nenabledReports: { ...state.enabledReports, ...action.payload },\n};\n} else if (\n@@ -38,12 +44,12 @@ export default function reduceReportStore(\naction.payload.sessionChange.cookieInvalidated)\n) {\nreturn {\n- ...state,\n+ queuedReports: updatedReports,\nenabledReports: isDev ? defaultDevEnabledReports : defaultEnabledReports,\n};\n} else if (action.type === logInActionTypes.success) {\nreturn {\n- ...state,\n+ queuedReports: updatedReports,\nenabledReports:\nisStaff(action.payload.currentUserInfo.id) || isDev\n? defaultDevEnabledReports\n@@ -55,16 +61,18 @@ export default function reduceReportStore(\naction.payload\n) {\nconst { payload } = action;\n- const updatedReports = state.queuedReports.filter(\n+ const unsentReports = updatedReports.filter(\n(response) => !payload.reports.includes(response),\n);\n- if (updatedReports.length === state.queuedReports.length) {\n+ if (unsentReports.length === updatedReports.length) {\nreturn state;\n}\n- return { ...state, queuedReports: updatedReports };\n+ return { ...state, queuedReports: unsentReports };\n} else if (action.type === queueReportsActionType) {\nconst { reports } = action.payload;\n- return { ...state, queuedReports: [...state.queuedReports, ...reports] };\n+ return { ...state, queuedReports: [...updatedReports, ...reports] };\n}\n- return state;\n+ return updatedReports !== state.queuedReports\n+ ? { ...state, queuedReports: updatedReports }\n+ : state;\n}\n" }, { "change_type": "MODIFY", "old_path": "lib/reducers/thread-reducer.js", "new_path": "lib/reducers/thread-reducer.js", "diff": "@@ -7,10 +7,6 @@ import {\nupdateActivityActionTypes,\n} from '../actions/activity-actions';\nimport { saveMessagesActionType } from '../actions/message-actions';\n-import {\n- sendReportActionTypes,\n- sendReportsActionTypes,\n-} from '../actions/report-actions';\nimport {\nchangeThreadSettingsActionTypes,\ndeleteThreadActionTypes,\n@@ -133,19 +129,24 @@ function findInconsistencies(\nexport default function reduceThreadInfos(\nstate: ThreadStore,\naction: BaseAction,\n-): ThreadStore {\n+): [\n+ ThreadStore,\n+ $ReadOnlyArray<ClientThreadInconsistencyReportCreationRequest>,\n+] {\nif (\naction.type === logInActionTypes.success ||\naction.type === registerActionTypes.success ||\naction.type === fullStateSyncActionType\n) {\nif (_isEqual(state.threadInfos)(action.payload.threadInfos)) {\n- return state;\n+ return [state, []];\n}\n- return {\n+ return [\n+ {\nthreadInfos: action.payload.threadInfos,\n- inconsistencyReports: state.inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (\naction.type === logOutActionTypes.success ||\naction.type === deleteAccountActionTypes.success ||\n@@ -153,12 +154,14 @@ export default function reduceThreadInfos(\naction.payload.sessionChange.cookieInvalidated)\n) {\nif (Object.keys(state.threadInfos).length === 0) {\n- return state;\n+ return [state, []];\n}\n- return {\n+ return [\n+ {\nthreadInfos: {},\n- inconsistencyReports: state.inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (\naction.type === joinThreadActionTypes.success ||\naction.type === leaveThreadActionTypes.success ||\n@@ -171,12 +174,14 @@ export default function reduceThreadInfos(\naction.type === newThreadActionTypes.success\n) {\nif (action.payload.updatesResult.newUpdates.length === 0) {\n- return state;\n+ return [state, []];\n}\n- return {\n+ return [\n+ {\nthreadInfos: reduceThreadUpdates(state.threadInfos, action.payload),\n- inconsistencyReports: state.inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (action.type === updateSubscriptionActionTypes.success) {\nconst newThreadInfos = {\n...state.threadInfos,\n@@ -188,10 +193,12 @@ export default function reduceThreadInfos(\n},\n},\n};\n- return {\n+ return [\n+ {\nthreadInfos: newThreadInfos,\n- inconsistencyReports: state.inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (action.type === saveMessagesActionType) {\nconst threadIDToMostRecentTime = new Map();\nfor (const messageInfo of action.payload.rawMessageInfos) {\n@@ -219,40 +226,26 @@ export default function reduceThreadInfos(\n};\n}\nif (Object.keys(changedThreadInfos).length !== 0) {\n- return {\n+ return [\n+ {\nthreadInfos: {\n...state.threadInfos,\n...changedThreadInfos,\n},\n- inconsistencyReports: state.inconsistencyReports,\n- };\n- }\n- } else if (\n- (action.type === sendReportActionTypes.success ||\n- action.type === sendReportsActionTypes.success) &&\n- action.payload\n- ) {\n- const { payload } = action;\n- const updatedReports = state.inconsistencyReports.filter(\n- (response) => !payload.reports.includes(response),\n- );\n- if (updatedReports.length === state.inconsistencyReports.length) {\n- return state;\n+ },\n+ [],\n+ ];\n}\n- return {\n- threadInfos: state.threadInfos,\n- inconsistencyReports: updatedReports,\n- };\n} else if (action.type === processServerRequestsActionType) {\nconst checkStateRequest = action.payload.serverRequests.find(\n(candidate) => candidate.type === serverRequestTypes.CHECK_STATE,\n);\nif (!checkStateRequest || !checkStateRequest.stateChanges) {\n- return state;\n+ return [state, []];\n}\nconst { rawThreadInfos, deleteThreadIDs } = checkStateRequest.stateChanges;\nif (!rawThreadInfos && !deleteThreadIDs) {\n- return state;\n+ return [state, []];\n}\nconst newThreadInfos = { ...state.threadInfos };\n@@ -272,13 +265,12 @@ export default function reduceThreadInfos(\nstate.threadInfos,\nnewThreadInfos,\n);\n- return {\n+ return [\n+ {\nthreadInfos: newThreadInfos,\n- inconsistencyReports: [\n- ...state.inconsistencyReports,\n- ...newInconsistencies,\n- ],\n- };\n+ },\n+ newInconsistencies,\n+ ];\n} else if (action.type === updateActivityActionTypes.success) {\nconst updatedThreadInfos = {};\nfor (const setToUnread of action.payload.result.unfocusedToUnread) {\n@@ -294,16 +286,18 @@ export default function reduceThreadInfos(\n}\n}\nif (Object.keys(updatedThreadInfos).length === 0) {\n- return state;\n+ return [state, []];\n}\n- return {\n+ return [\n+ {\nthreadInfos: { ...state.threadInfos, ...updatedThreadInfos },\n- inconsistencyReports: state.inconsistencyReports,\n- };\n+ },\n+ [],\n+ ];\n} else if (action.type === setThreadUnreadStatusActionTypes.started) {\nconst { threadID, unread } = action.payload;\n- return {\n- ...state,\n+ return [\n+ {\nthreadInfos: {\n...state.threadInfos,\n[threadID]: {\n@@ -314,21 +308,23 @@ export default function reduceThreadInfos(\n},\n},\n},\n- };\n+ },\n+ [],\n+ ];\n} else if (action.type === setThreadUnreadStatusActionTypes.success) {\nconst { threadID, resetToUnread } = action.payload;\nconst currentUser = state.threadInfos[threadID].currentUser;\nif (!resetToUnread || currentUser.unread) {\n- return state;\n+ return [state, []];\n}\nconst updatedUser = {\n...currentUser,\nunread: true,\n};\n- return {\n- ...state,\n+ return [\n+ {\nthreadInfos: {\n...state.threadInfos,\n[threadID]: {\n@@ -336,7 +332,9 @@ export default function reduceThreadInfos(\ncurrentUser: updatedUser,\n},\n},\n- };\n+ },\n+ [],\n+ ];\n}\n- return state;\n+ return [state, []];\n}\n" }, { "change_type": "MODIFY", "old_path": "lib/selectors/socket-selectors.js", "new_path": "lib/selectors/socket-selectors.js", "diff": "@@ -10,11 +10,7 @@ import {\nimport threadWatcher from '../shared/thread-watcher';\nimport type { RawEntryInfo, CalendarQuery } from '../types/entry-types';\nimport type { AppState } from '../types/redux-types';\n-import type {\n- ClientThreadInconsistencyReportCreationRequest,\n- ClientEntryInconsistencyReportCreationRequest,\n- ClientReportCreationRequest,\n-} from '../types/report-types';\n+import type { ClientReportCreationRequest } from '../types/report-types';\nimport {\nserverRequestTypes,\ntype ClientServerRequest,\n@@ -30,18 +26,10 @@ import { currentCalendarQuery } from './nav-selectors';\nconst queuedReports: (\nstate: AppState,\n) => $ReadOnlyArray<ClientReportCreationRequest> = createSelector(\n- (state: AppState) => state.threadStore.inconsistencyReports,\n- (state: AppState) => state.entryStore.inconsistencyReports,\n(state: AppState) => state.reportStore.queuedReports,\n(\n- threadInconsistencyReports: $ReadOnlyArray<ClientThreadInconsistencyReportCreationRequest>,\n- entryInconsistencyReports: $ReadOnlyArray<ClientEntryInconsistencyReportCreationRequest>,\nmainQueuedReports: $ReadOnlyArray<ClientReportCreationRequest>,\n- ): $ReadOnlyArray<ClientReportCreationRequest> => [\n- ...threadInconsistencyReports,\n- ...entryInconsistencyReports,\n- ...mainQueuedReports,\n- ],\n+ ): $ReadOnlyArray<ClientReportCreationRequest> => mainQueuedReports,\n);\nconst getClientResponsesSelector: (\n" }, { "change_type": "MODIFY", "old_path": "lib/types/entry-types.js", "new_path": "lib/types/entry-types.js", "diff": "@@ -8,7 +8,6 @@ import {\nimport type { Platform } from './device-types';\nimport { type CalendarFilter, defaultCalendarFilters } from './filter-types';\nimport type { RawMessageInfo } from './message-types';\n-import type { ClientEntryInconsistencyReportCreationRequest } from './report-types';\nimport type {\nServerCreateUpdatesResponse,\nClientCreateUpdatesResponse,\n@@ -45,7 +44,6 @@ export type EntryStore = {|\n+entryInfos: { +[id: string]: RawEntryInfo },\n+daysToEntries: { +[day: string]: string[] },\n+lastUserInteractionCalendar: number,\n- +inconsistencyReports: $ReadOnlyArray<ClientEntryInconsistencyReportCreationRequest>,\n|};\nexport type CalendarQuery = {|\n" }, { "change_type": "MODIFY", "old_path": "lib/types/thread-types.js", "new_path": "lib/types/thread-types.js", "diff": "@@ -8,7 +8,6 @@ import type {\nRawMessageInfo,\nMessageTruncationStatuses,\n} from './message-types';\n-import type { ClientThreadInconsistencyReportCreationRequest } from './report-types';\nimport type { ThreadSubscription } from './subscription-types';\nimport type { ServerUpdateInfo, ClientUpdateInfo } from './update-types';\nimport type { UserInfo, AccountUserInfo } from './user-types';\n@@ -234,7 +233,6 @@ export type ServerThreadInfo = {|\nexport type ThreadStore = {|\n+threadInfos: { +[id: string]: RawThreadInfo },\n- +inconsistencyReports: $ReadOnlyArray<ClientThreadInconsistencyReportCreationRequest>,\n|};\nexport type ThreadDeletionRequest = {|\n" }, { "change_type": "MODIFY", "old_path": "native/redux/redux-setup.js", "new_path": "native/redux/redux-setup.js", "diff": "@@ -129,11 +129,9 @@ const defaultState = ({\nentryInfos: {},\ndaysToEntries: {},\nlastUserInteractionCalendar: 0,\n- inconsistencyReports: [],\n},\nthreadStore: {\nthreadInfos: {},\n- inconsistencyReports: [],\n},\nuserStore: {\nuserInfos: {},\n" }, { "change_type": "MODIFY", "old_path": "server/src/responders/website-responders.js", "new_path": "server/src/responders/website-responders.js", "diff": "@@ -155,7 +155,7 @@ async function websiteResponder(\nconst threadStorePromise = (async () => {\nconst { threadInfos } = await threadInfoPromise;\n- return { threadInfos, inconsistencyReports: [] };\n+ return { threadInfos };\n})();\nconst messageStorePromise = (async () => {\nconst [\n@@ -175,7 +175,6 @@ async function websiteResponder(\nentryInfos: _keyBy('id')(rawEntryInfos),\ndaysToEntries: daysToEntriesFromEntryInfos(rawEntryInfos),\nlastUserInteractionCalendar: initialTime,\n- inconsistencyReports: [],\n};\n})();\nconst userStorePromise = (async () => {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Move entry/thread inconsistency reports to `state.reportStore.queuedReports` Summary: Move entry/thread inconsistency reports to `state.reportStore.queuedReports` Test Plan: Going to test after diff that filters out media reports from `reportStoreReduder` Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1514
129,184
28.06.2021 20:57:39
14,400
55fb8193983550ebe504eb6ac38709ec9642eb9f
[native] Migrate any existing reports to `state.reportStore.queuedReports` Test Plan: didn't test, didn't think it was possible to go back to 26 and "redo" the migration Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -240,13 +240,25 @@ const migrations = {\n...state,\nqueuedReports: undefined,\nenabledReports: undefined,\n+ threadStore: {\n+ ...state.threadStore,\n+ inconsistencyReports: undefined,\n+ },\n+ entryStore: {\n+ ...state.entryStore,\n+ inconsistencyReports: undefined,\n+ },\nreportStore: {\nenabledReports: {\ncrashReports: __DEV__,\ninconsistencyReports: __DEV__,\nmediaReports: __DEV__,\n},\n- queuedReports: [],\n+ queuedReports: [\n+ ...state.entryStore.inconsistencyReports,\n+ ...state.threadStore.inconsistencyReports,\n+ ...state.queuedReports,\n+ ],\n},\n}),\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Migrate any existing reports to `state.reportStore.queuedReports` Test Plan: didn't test, didn't think it was possible to go back to 26 and "redo" the migration Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1516
129,184
29.06.2021 14:21:19
14,400
e998f6b57351b4d886877d2c25b931c5af02f7c6
[native] Add unread "dot" indicator to `sidebar-item` Summary: Here's what it looks like: With alignment guides overlaid: Test Plan: Marked sidebars as read/unread and observed the unread dot appear/disappear Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list-item.react.js", "new_path": "native/chat/chat-thread-list-item.react.js", "diff": "@@ -12,6 +12,7 @@ import Button from '../components/button.react';\nimport ColorSplotch from '../components/color-splotch.react';\nimport { SingleLine } from '../components/single-line.react';\nimport ThreadAncestorsLabel from '../components/thread-ancestors-label.react';\n+import UnreadDot from '../components/unread-dot.react';\nimport { useColors, useStyles } from '../themes/colors';\nimport ChatThreadListSeeMoreSidebars from './chat-thread-list-see-more-sidebars.react';\nimport ChatThreadListSidebar from './chat-thread-list-sidebar.react';\n@@ -87,13 +88,6 @@ function ChatThreadListItem({\nconst lastActivity = shortAbsoluteDate(data.lastUpdatedTime);\nconst unreadStyle = data.threadInfo.currentUser.unread ? styles.unread : null;\n- const unreadDotStyle = React.useMemo(() => {\n- return [\n- styles.colorSplotch,\n- { opacity: data.threadInfo.currentUser.unread ? 1 : 0 },\n- ];\n- }, [data.threadInfo.currentUser.unread, styles.colorSplotch]);\n-\nreturn (\n<>\n<SwipeableThread\n@@ -110,11 +104,8 @@ function ChatThreadListItem({\niosActiveOpacity={0.85}\nstyle={styles.row}\n>\n- <View style={unreadDotStyle}>\n- <ColorSplotch\n- color={`${colors.listForegroundSecondaryLabel.slice(1)}`}\n- size=\"micro\"\n- />\n+ <View style={styles.colorSplotch}>\n+ <UnreadDot unread={data.threadInfo.currentUser.unread} />\n</View>\n<View style={styles.colorSplotch}>\n<ColorSplotch color={data.threadInfo.color} size=\"profile\" />\n" }, { "change_type": "MODIFY", "old_path": "native/chat/sidebar-item.react.js", "new_path": "native/chat/sidebar-item.react.js", "diff": "@@ -9,6 +9,7 @@ import { shortAbsoluteDate } from 'lib/utils/date-utils';\nimport Button from '../components/button.react';\nimport { SingleLine } from '../components/single-line.react';\n+import UnreadDot from '../components/unread-dot.react';\nimport { useColors, useStyles } from '../themes/colors';\nimport type { ViewStyle } from '../types/styles';\n@@ -40,6 +41,7 @@ function SidebarItem(props: Props) {\nstyle={[styles.sidebar, props.style]}\nonPress={onPress}\n>\n+ <UnreadDot unread={threadInfo.currentUser.unread} />\n<Icon name=\"align-right\" style={styles.icon} size={24} />\n<SingleLine style={[styles.name, unreadStyle]}>\n{threadInfo.uiName}\n@@ -58,15 +60,15 @@ const unboundStyles = {\nheight: 30,\nflexDirection: 'row',\ndisplay: 'flex',\n- paddingLeft: 40,\n+ paddingLeft: 6,\npaddingRight: 18,\nalignItems: 'center',\nbackgroundColor: 'listBackground',\n},\nicon: {\n- paddingLeft: 5,\n+ paddingLeft: 34,\n+ paddingRight: 5,\ncolor: 'listForegroundSecondaryLabel',\n- width: 35,\n},\nname: {\ncolor: 'listForegroundSecondaryLabel',\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/components/unread-dot.react.js", "diff": "+// @flow\n+\n+import * as React from 'react';\n+import { View } from 'react-native';\n+\n+import { useColors } from '../themes/colors';\n+import ColorSplotch from './color-splotch.react';\n+\n+type Props = {|\n+ +unread: ?boolean,\n+|};\n+function UnreadDot(props: Props): React.Node {\n+ const { unread } = props;\n+ const colors = useColors();\n+\n+ const unreadDotStyle = React.useMemo(() => {\n+ return { opacity: unread ? 1 : 0 };\n+ }, [unread]);\n+\n+ return (\n+ <View style={unreadDotStyle}>\n+ <ColorSplotch\n+ color={`${colors.listForegroundSecondaryLabel.slice(1)}`}\n+ size=\"micro\"\n+ />\n+ </View>\n+ );\n+}\n+\n+export default UnreadDot;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Add unread "dot" indicator to `sidebar-item` Summary: Here's what it looks like: https://blob.sh/atul/unread-dot-sidebar.png With alignment guides overlaid: https://blob.sh/atul/f497.png Test Plan: Marked sidebars as read/unread and observed the unread dot appear/disappear Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1531
129,184
28.06.2021 20:40:55
14,400
13d11b9a7537145644223f6f570088c3dfdb579f
[lib] Conditionally add reports to `reportStore.queuedReports` based on `state.reportStore.enabledReports` Test Plan: Toggled media reports on and off and observed whether media reports were sent in staff thread when multimedia message sent/save button pressed in `ImageModal` Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "lib/reducers/report-store-reducer.js", "new_path": "lib/reducers/report-store-reducer.js", "diff": "@@ -20,6 +20,7 @@ import {\n} from '../types/report-types';\nimport { setNewSessionActionType } from '../utils/action-utils';\nimport { isDev } from '../utils/dev-utils';\n+import { isReportEnabled } from '../utils/report-utils';\nexport const updateReportsEnabledActionType = 'UPDATE_REPORTS_ENABLED';\n@@ -28,14 +29,21 @@ export default function reduceReportStore(\naction: BaseAction,\nnewInconsistencies: $ReadOnlyArray<ClientReportCreationRequest>,\n): ReportStore {\n- const updatedReports = state.enabledReports.inconsistencyReports\n- ? [...state.queuedReports, ...newInconsistencies]\n+ const updatedReports =\n+ newInconsistencies.length > 0\n+ ? [...state.queuedReports, ...newInconsistencies].filter((report) =>\n+ isReportEnabled(report, state.enabledReports),\n+ )\n: state.queuedReports;\nif (action.type === updateReportsEnabledActionType) {\n+ const newEnabledReports = { ...state.enabledReports, ...action.payload };\n+ const filteredReports = updatedReports.filter((report) =>\n+ isReportEnabled(report, newEnabledReports),\n+ );\nreturn {\n- queuedReports: updatedReports,\n- enabledReports: { ...state.enabledReports, ...action.payload },\n+ queuedReports: filteredReports,\n+ enabledReports: newEnabledReports,\n};\n} else if (\naction.type === logOutActionTypes.success ||\n@@ -70,7 +78,13 @@ export default function reduceReportStore(\nreturn { ...state, queuedReports: unsentReports };\n} else if (action.type === queueReportsActionType) {\nconst { reports } = action.payload;\n- return { ...state, queuedReports: [...updatedReports, ...reports] };\n+ const filteredReports = [...updatedReports, ...reports].filter((report) =>\n+ isReportEnabled(report, state.enabledReports),\n+ );\n+ return {\n+ ...state,\n+ queuedReports: filteredReports,\n+ };\n}\nreturn updatedReports !== state.queuedReports\n? { ...state, queuedReports: updatedReports }\n" }, { "change_type": "MODIFY", "old_path": "lib/utils/report-utils.js", "new_path": "lib/utils/report-utils.js", "diff": "// @flow\n-import { type SupportedReports } from '../types/report-types';\n+import {\n+ type SupportedReports,\n+ type EnabledReports,\n+ type ClientReportCreationRequest,\n+ reportTypes,\n+} from '../types/report-types';\nimport { useSelector } from './redux-utils';\nfunction useIsReportEnabled(reportType: SupportedReports): boolean {\nreturn useSelector((state) => state.reportStore.enabledReports[reportType]);\n}\n-export { useIsReportEnabled };\n+function isReportEnabled(\n+ report: ClientReportCreationRequest,\n+ enabledReports: EnabledReports,\n+): boolean {\n+ return (\n+ (report.type === reportTypes.MEDIA_MISSION &&\n+ enabledReports.mediaReports) ||\n+ (report.type === reportTypes.ERROR && enabledReports.crashReports) ||\n+ ((report.type === reportTypes.ENTRY_INCONSISTENCY ||\n+ report.type === reportTypes.THREAD_INCONSISTENCY) &&\n+ enabledReports.inconsistencyReports)\n+ );\n+}\n+\n+export { useIsReportEnabled, isReportEnabled };\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Conditionally add reports to `reportStore.queuedReports` based on `state.reportStore.enabledReports` Test Plan: Toggled media reports on and off and observed whether media reports were sent in staff thread when multimedia message sent/save button pressed in `ImageModal` Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1515
129,187
29.06.2021 18:57:31
14,400
d5cf12f165de0ad192a6bf6b941d5a36293f628d
[native] Get rid of Shared Web Credentials on iOS Test Plan: Flow Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/account/native-credentials.js", "new_path": "native/account/native-credentials.js", "diff": "import { Platform } from 'react-native';\nimport {\ngetInternetCredentials,\n- requestSharedWebCredentials,\nsetInternetCredentials,\n- setSharedWebCredentials,\nresetInternetCredentials,\n} from 'react-native-keychain';\n@@ -22,7 +20,7 @@ let storedNativeKeychainCredentials: StoredCredentials = {\nstate: 'undetermined',\ncredentials: null,\n};\n-let storedSharedWebCredentials: StoredCredentials = {\n+const storedSharedWebCredentials: StoredCredentials = {\nstate: Platform.OS === 'ios' ? 'undetermined' : 'unsupported',\ncredentials: null,\n};\n@@ -55,33 +53,12 @@ function getNativeSharedWebCredentials(): ?UserCredentials {\nreturn storedSharedWebCredentials.credentials;\n}\n-async function fetchNativeSharedWebCredentials(): Promise<?UserCredentials> {\n- if (Platform.OS !== 'ios') {\n- return null;\n- }\n- if (storedSharedWebCredentials.state === 'determined') {\n- return storedSharedWebCredentials.credentials;\n- }\n- try {\n- const result = await requestSharedWebCredentials();\n- const credentials = result\n- ? { username: result.username, password: result.password }\n- : undefined;\n- storedSharedWebCredentials = { state: 'determined', credentials };\n- return credentials;\n- } catch (e) {\n- const credentials = null;\n- storedSharedWebCredentials = { state: 'unsupported', credentials };\n- return credentials;\n- }\n-}\n-\nasync function fetchNativeCredentials(): Promise<?UserCredentials> {\nconst keychainCredentials = await fetchNativeKeychainCredentials();\nif (keychainCredentials) {\nreturn keychainCredentials;\n}\n- return await fetchNativeSharedWebCredentials();\n+ return null;\n}\nasync function setNativeKeychainCredentials(credentials: UserCredentials) {\n@@ -108,54 +85,8 @@ async function setNativeKeychainCredentials(credentials: UserCredentials) {\n}\n}\n-async function setNativeSharedWebCredentials(credentials: UserCredentials) {\n- if (Platform.OS !== 'ios') {\n- return;\n- }\n- const currentKeychainCredentials = await fetchNativeKeychainCredentials();\n- // If the password entered is the same as what we've got in the native\n- // keychain, then assume that nothing has been changed. We exit early here\n- // because if there are already shared web credentials, the\n- // setSharedWebCredentials call below will pop up an alert regardless of\n- // whether the credentials we pass it are the same as what it already has.\n- if (\n- currentKeychainCredentials &&\n- credentials.username === currentKeychainCredentials.username &&\n- credentials.password === currentKeychainCredentials.password\n- ) {\n- return;\n- }\n- // You might think we should just check fetchNativeSharedWebCredentials to\n- // see if the new shared web credentials we are about to pass to\n- // setSharedWebCredentials are the same as what it already has. But it turns\n- // out that that will trigger an alert too, which isn't worth it because we're\n- // only checking it to prevent an unnecessary alert. The smart thing we can do\n- // is check our internal cache.\n- const cachedSharedWebCredentials = getNativeSharedWebCredentials();\n- if (\n- cachedSharedWebCredentials &&\n- credentials.username === cachedSharedWebCredentials.username &&\n- credentials.password === cachedSharedWebCredentials.password\n- ) {\n- return;\n- }\n- try {\n- await setSharedWebCredentials(\n- 'squadcal.org',\n- credentials.username,\n- credentials.password,\n- );\n- storedSharedWebCredentials = { state: 'determined', credentials };\n- } catch (e) {\n- storedSharedWebCredentials = { state: 'unsupported', credentials: null };\n- }\n-}\n-\nfunction setNativeCredentials(credentials: UserCredentials) {\n- return Promise.all([\n- setNativeKeychainCredentials(credentials),\n- setNativeSharedWebCredentials(credentials),\n- ]);\n+ return setNativeKeychainCredentials(credentials);\n}\nasync function deleteNativeKeychainCredentials() {\n@@ -173,31 +104,9 @@ async function deleteNativeKeychainCredentials() {\n}\n}\n-async function deleteNativeSharedWebCredentialsFor(username: string) {\n- if (Platform.OS !== 'ios') {\n- return;\n- }\n- try {\n- // This native call will display a modal iff credentials are non-null,\n- // so we don't need to worry about checking our current state\n- await setSharedWebCredentials('squadcal.org', username, undefined);\n- storedSharedWebCredentials = {\n- state: 'determined',\n- credentials: undefined,\n- };\n- } catch (e) {\n- storedSharedWebCredentials = {\n- state: 'unsupported',\n- credentials: null,\n- };\n- }\n-}\n-\n-async function deleteNativeCredentialsFor(username: string) {\n- await Promise.all([\n- deleteNativeKeychainCredentials(),\n- deleteNativeSharedWebCredentialsFor(username),\n- ]);\n+// eslint-disable-next-line no-unused-vars\n+function deleteNativeCredentialsFor(username: string) {\n+ return deleteNativeKeychainCredentials();\n}\nexport {\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Comm.entitlements", "new_path": "native/ios/Comm/Comm.entitlements", "diff": "<key>aps-environment</key>\n<string>development</string>\n<key>com.apple.developer.associated-domains</key>\n- <array>\n- <string>webcredentials:squadcal.org</string>\n- <string>webcredentials:*.squadcal.org</string>\n- </array>\n+ <array/>\n<key>keychain-access-groups</key>\n<array>\n<string>$(AppIdentifierPrefix)org.squadcal.app</string>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Get rid of Shared Web Credentials on iOS Test Plan: Flow Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1535
129,187
29.06.2021 18:58:23
14,400
31f0b444748f2acf84da93d6b76e47beca0fe92c
[native] Move iOS to app.comm bundle identifier Test Plan: We'll test after landing! Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/ios/Comm.xcodeproj/project.pbxproj", "new_path": "native/ios/Comm.xcodeproj/project.pbxproj", "diff": "ORGANIZATIONNAME = SquadCal;\nTargetAttributes = {\n13B07F861A680F5B00A75B9A = {\n- DevelopmentTeam = 6BF4H9TU5U;\n+ DevelopmentTeam = H98Y8MH53M;\nLastSwiftMigration = 1140;\nProvisioningStyle = Automatic;\nSystemCapabilities = {\nCLANG_ENABLE_MODULES = YES;\nCLANG_WARN_OBJC_ROOT_CLASS = YES;\nCODE_SIGN_ENTITLEMENTS = Comm/Comm.entitlements;\n+ CODE_SIGN_IDENTITY = \"Apple Development\";\n\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n+ CODE_SIGN_STYLE = Automatic;\nCURRENT_PROJECT_VERSION = 1;\nDEAD_CODE_STRIPPING = NO;\n- DEVELOPMENT_TEAM = 6BF4H9TU5U;\n+ DEVELOPMENT_TEAM = H98Y8MH53M;\nENABLE_BITCODE = NO;\n\"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = arm64;\nGCC_PREPROCESSOR_DEFINITIONS = (\n\"-ObjC\",\n\"-lc++\",\n);\n- PRODUCT_BUNDLE_IDENTIFIER = org.squadcal.app;\n+ PRODUCT_BUNDLE_IDENTIFIER = app.comm;\nPRODUCT_NAME = Comm;\n+ PROVISIONING_PROFILE_SPECIFIER = \"\";\nSWIFT_OBJC_BRIDGING_HEADER = \"Comm-Bridging-Header.h\";\nSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\nSWIFT_VERSION = 5.0;\nCLANG_ENABLE_MODULES = YES;\nCLANG_WARN_OBJC_ROOT_CLASS = YES;\nCODE_SIGN_ENTITLEMENTS = Comm/Comm.entitlements;\n+ CODE_SIGN_IDENTITY = \"Apple Development\";\n\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n+ CODE_SIGN_STYLE = Automatic;\nCURRENT_PROJECT_VERSION = 1;\n- DEVELOPMENT_TEAM = 6BF4H9TU5U;\n+ DEVELOPMENT_TEAM = H98Y8MH53M;\nENABLE_BITCODE = YES;\n\"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = arm64;\nHEADER_SEARCH_PATHS = (\n\"-ObjC\",\n\"-lc++\",\n);\n- PRODUCT_BUNDLE_IDENTIFIER = org.squadcal.app;\n+ PRODUCT_BUNDLE_IDENTIFIER = app.comm;\nPRODUCT_NAME = Comm;\n+ PROVISIONING_PROFILE_SPECIFIER = \"\";\nSWIFT_OBJC_BRIDGING_HEADER = \"Comm-Bridging-Header.h\";\nSWIFT_VERSION = 5.0;\nTARGETED_DEVICE_FAMILY = 1;\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Comm.entitlements", "new_path": "native/ios/Comm/Comm.entitlements", "diff": "<array/>\n<key>keychain-access-groups</key>\n<array>\n- <string>$(AppIdentifierPrefix)org.squadcal.app</string>\n+ <string>$(AppIdentifierPrefix)app.comm</string>\n</array>\n</dict>\n</plist>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Move iOS to app.comm bundle identifier Test Plan: We'll test after landing! Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1536
129,187
29.06.2021 19:02:17
14,400
ddb4202c4ac92f4664eeb3565a4e53cad39bc33c
[native] Use Comm ORGANIZATIONNAME for iOS Test Plan: Meh Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/ios/Comm.xcodeproj/project.pbxproj", "new_path": "native/ios/Comm.xcodeproj/project.pbxproj", "diff": "isa = PBXProject;\nattributes = {\nLastUpgradeCheck = 1150;\n- ORGANIZATIONNAME = SquadCal;\n+ ORGANIZATIONNAME = \"Comm Technologies, Inc.\";\nTargetAttributes = {\n13B07F861A680F5B00A75B9A = {\nDevelopmentTeam = H98Y8MH53M;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use Comm ORGANIZATIONNAME for iOS Test Plan: Meh Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1537
129,184
30.06.2021 09:10:45
14,400
92d9bd84cfed3d9782b5a7297703ecc2c03ba30d
[landing] Create placeholder `privacy` and `terms of service` components and navigate between them using `activePage` state Test Plan: Was able to navigate between the components as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "ADD", "old_path": null, "new_path": "landing/home.react.js", "diff": "+// @flow\n+\n+import { create } from '@lottiefiles/lottie-interactivity';\n+import * as React from 'react';\n+\n+import css from './landing.css';\n+import ReadDocsButton from './read-docs-btn.react';\n+import StarBackground from './star-background.react';\n+import SubscriptionForm from './subscription-form.react';\n+\n+const useIsomorphicLayoutEffect =\n+ typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n+\n+function Home(): React.Node {\n+ React.useEffect(() => {\n+ import('@lottiefiles/lottie-player');\n+ }, []);\n+\n+ const onEyeIllustrationLoad = React.useCallback(() => {\n+ create({\n+ mode: 'scroll',\n+ player: '#eye-illustration',\n+ actions: [\n+ {\n+ visibility: [0, 1],\n+ type: 'seek',\n+ frames: [0, 720],\n+ },\n+ ],\n+ });\n+ }, []);\n+\n+ const onCloudIllustrationLoad = React.useCallback(() => {\n+ create({\n+ mode: 'scroll',\n+ player: '#cloud-illustration',\n+ actions: [\n+ {\n+ visibility: [0, 0.2],\n+ type: 'stop',\n+ frames: [0],\n+ },\n+ {\n+ visibility: [0.2, 1],\n+ type: 'seek',\n+ frames: [0, 300],\n+ },\n+ ],\n+ });\n+ }, []);\n+\n+ const [eyeNode, setEyeNode] = React.useState(null);\n+ useIsomorphicLayoutEffect(() => {\n+ if (!eyeNode) {\n+ return;\n+ }\n+ eyeNode.addEventListener('load', onEyeIllustrationLoad);\n+ return () => eyeNode.removeEventListener('load', onEyeIllustrationLoad);\n+ }, [eyeNode, onEyeIllustrationLoad]);\n+\n+ const [cloudNode, setCloudNode] = React.useState(null);\n+ useIsomorphicLayoutEffect(() => {\n+ if (!cloudNode) {\n+ return;\n+ }\n+ cloudNode.addEventListener('load', onCloudIllustrationLoad);\n+ return () => cloudNode.removeEventListener('load', onCloudIllustrationLoad);\n+ }, [cloudNode, onCloudIllustrationLoad]);\n+\n+ return (\n+ <div>\n+ <StarBackground className={css.particles} />\n+ <div className={css.grid}>\n+ <h1 className={css.title}>Comm</h1>\n+ <div className={`${css.hero_image} ${css.starting_section}`}>\n+ <lottie-player\n+ id=\"eye-illustration\"\n+ ref={setEyeNode}\n+ mode=\"normal\"\n+ src=\"images/animated_eye.json\"\n+ speed={1}\n+ />\n+ </div>\n+ <div className={`${css.hero_copy} ${css.section}`}>\n+ <h1>\n+ Reclaim your\n+ <span className={css.purple}> digital&nbsp;identity.</span>\n+ </h1>\n+ <p>\n+ The Internet is broken today. Private user data is owned by\n+ mega-corporations and farmed for their benefit.\n+ </p>\n+ <p>\n+ E2E encryption has the potential to change this equation. But\n+ it&apos;s constrained by a crucial limitation.\n+ </p>\n+ </div>\n+\n+ <div className={`${css.server_image} ${css.starting_section}`}>\n+ <lottie-player\n+ id=\"cloud-illustration\"\n+ ref={setCloudNode}\n+ mode=\"normal\"\n+ src=\"images/animated_cloud.json\"\n+ speed={1}\n+ />\n+ </div>\n+ <div className={`${css.server_copy} ${css.section}`}>\n+ <h2>Apps need servers.</h2>\n+ <p>\n+ Sophisticated applications rely on servers to do things that your\n+ devices simply can&apos;t.\n+ </p>\n+ <p>\n+ That&apos;s why E2E encryption only works for simple chat apps\n+ today. There&apos;s no way to build a robust server layer that has\n+ access to your data without leaking that data to corporations.\n+ </p>\n+ </div>\n+\n+ <div className={css.keyserver_company}>\n+ <h1>\n+ Comm is the <span className={css.purple}>keyserver</span> company.\n+ </h1>\n+ </div>\n+\n+ <div className={css.keyserver_copy}>\n+ <p>In the future, people have their own servers.</p>\n+ <p>\n+ Your keyserver is the home of your digital identity. It owns your\n+ private keys and your personal data. It&apos;s your password\n+ manager, your crypto bank, your digital surrogate, and your second\n+ brain.\n+ </p>\n+ </div>\n+ <div className={css.read_the_docs}>\n+ <ReadDocsButton />\n+ </div>\n+\n+ <div className={`${css.footer_logo} ${css.starting_section}`}>Comm</div>\n+ <div className={`${css.subscribe_updates} ${css.starting_section}`}>\n+ <SubscriptionForm />\n+ </div>\n+ </div>\n+ </div>\n+ );\n+}\n+\n+export default Home;\n" }, { "change_type": "MODIFY", "old_path": "landing/landing.react.js", "new_path": "landing/landing.react.js", "diff": "// @flow\n-import { create } from '@lottiefiles/lottie-interactivity';\nimport * as React from 'react';\n-import css from './landing.css';\n-import ReadDocsButton from './read-docs-btn.react';\n-import StarBackground from './star-background.react';\n-import SubscriptionForm from './subscription-form.react';\n+import Home from './home.react';\n+import Privacy from './privacy.react';\n+import Terms from './terms.react';\n-const useIsomorphicLayoutEffect =\n- typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n+export type ActivePage = 'home' | 'terms' | 'privacy';\nfunction Landing(): React.Node {\n- React.useEffect(() => {\n- import('@lottiefiles/lottie-player');\n- }, []);\n-\n- const onEyeIllustrationLoad = React.useCallback(() => {\n- create({\n- mode: 'scroll',\n- player: '#eye-illustration',\n- actions: [\n- {\n- visibility: [0, 1],\n- type: 'seek',\n- frames: [0, 720],\n- },\n- ],\n- });\n- }, []);\n-\n- const onCloudIllustrationLoad = React.useCallback(() => {\n- create({\n- mode: 'scroll',\n- player: '#cloud-illustration',\n- actions: [\n- {\n- visibility: [0, 0.2],\n- type: 'stop',\n- frames: [0],\n- },\n- {\n- visibility: [0.2, 1],\n- type: 'seek',\n- frames: [0, 300],\n- },\n- ],\n- });\n- }, []);\n-\n- const [eyeNode, setEyeNode] = React.useState(null);\n- useIsomorphicLayoutEffect(() => {\n- if (!eyeNode) {\n- return;\n- }\n- eyeNode.addEventListener('load', onEyeIllustrationLoad);\n- return () => eyeNode.removeEventListener('load', onEyeIllustrationLoad);\n- }, [eyeNode, onEyeIllustrationLoad]);\n+ const [activePage, setActivePage] = React.useState<ActivePage>('home');\n+ const navigateToHome = React.useCallback(() => setActivePage('home'), []);\n+ const navigateToTerms = React.useCallback(() => setActivePage('terms'), []);\n+ const navigateToPrivacy = React.useCallback(\n+ () => setActivePage('privacy'),\n+ [],\n+ );\n- const [cloudNode, setCloudNode] = React.useState(null);\n- useIsomorphicLayoutEffect(() => {\n- if (!cloudNode) {\n- return;\n+ let visibleNode;\n+ if (activePage === 'home') {\n+ visibleNode = <Home />;\n+ } else if (activePage === 'terms') {\n+ visibleNode = <Terms />;\n+ } else if (activePage === 'privacy') {\n+ visibleNode = <Privacy />;\n}\n- cloudNode.addEventListener('load', onCloudIllustrationLoad);\n- return () => cloudNode.removeEventListener('load', onCloudIllustrationLoad);\n- }, [cloudNode, onCloudIllustrationLoad]);\nreturn (\n- <div>\n- <StarBackground className={css.particles} />\n- <div className={css.grid}>\n- <h1 className={css.title}>Comm</h1>\n- <div className={`${css.hero_image} ${css.starting_section}`}>\n- <lottie-player\n- id=\"eye-illustration\"\n- ref={setEyeNode}\n- mode=\"normal\"\n- src=\"images/animated_eye.json\"\n- speed={1}\n- />\n- </div>\n- <div className={`${css.hero_copy} ${css.section}`}>\n- <h1>\n- Reclaim your\n- <span className={css.purple}> digital&nbsp;identity.</span>\n- </h1>\n- <p>\n- The Internet is broken today. Private user data is owned by\n- mega-corporations and farmed for their benefit.\n- </p>\n- <p>\n- E2E encryption has the potential to change this equation. But\n- it&apos;s constrained by a crucial limitation.\n- </p>\n- </div>\n-\n- <div className={`${css.server_image} ${css.starting_section}`}>\n- <lottie-player\n- id=\"cloud-illustration\"\n- ref={setCloudNode}\n- mode=\"normal\"\n- src=\"images/animated_cloud.json\"\n- speed={1}\n- />\n- </div>\n- <div className={`${css.server_copy} ${css.section}`}>\n- <h2>Apps need servers.</h2>\n- <p>\n- Sophisticated applications rely on servers to do things that your\n- devices simply can&apos;t.\n- </p>\n- <p>\n- That&apos;s why E2E encryption only works for simple chat apps\n- today. There&apos;s no way to build a robust server layer that has\n- access to your data without leaking that data to corporations.\n- </p>\n- </div>\n-\n- <div className={css.keyserver_company}>\n- <h1>\n- Comm is the <span className={css.purple}>keyserver</span> company.\n- </h1>\n- </div>\n-\n- <div className={css.keyserver_copy}>\n- <p>In the future, people have their own servers.</p>\n- <p>\n- Your keyserver is the home of your digital identity. It owns your\n- private keys and your personal data. It&apos;s your password\n- manager, your crypto bank, your digital surrogate, and your second\n- brain.\n- </p>\n- </div>\n- <div className={css.read_the_docs}>\n- <ReadDocsButton />\n- </div>\n-\n- <div className={`${css.footer_logo} ${css.starting_section}`}>Comm</div>\n- <div className={`${css.subscribe_updates} ${css.starting_section}`}>\n- <SubscriptionForm />\n- </div>\n- </div>\n- </div>\n+ <>\n+ {visibleNode}\n+ <a href=\"#\" onClick={navigateToHome}>\n+ Home\n+ </a>\n+ <a href=\"#\" onClick={navigateToTerms}>\n+ Terms of Service\n+ </a>\n+ <a href=\"#\" onClick={navigateToPrivacy}>\n+ Privacy Policy\n+ </a>\n+ </>\n);\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "landing/privacy.react.js", "diff": "+// @flow\n+\n+import * as React from 'react';\n+\n+function Privacy(): React.Node {\n+ return <h1>Privacy Policy</h1>;\n+}\n+\n+export default Privacy;\n" }, { "change_type": "ADD", "old_path": null, "new_path": "landing/terms.react.js", "diff": "+// @flow\n+\n+import * as React from 'react';\n+\n+function Terms(): React.Node {\n+ return <h1>Terms of Service</h1>;\n+}\n+\n+export default Terms;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Create placeholder `privacy` and `terms of service` components and navigate between them using `activePage` state Test Plan: Was able to navigate between the components as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1543
129,184
30.06.2021 09:36:15
14,400
07ef1a14d693dc87c060eb1e8d21b7c2bc00cb90
[landing] Use sans-serif font for legal headers Summary: Figured sans-serif headers would be better than monospace for the legal pages Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/landing.css", "new_path": "landing/landing.css", "diff": "@@ -18,6 +18,14 @@ h1.title {\ngrid-area: title_container;\n}\n+h1.legal {\n+ font-family: 'IBM Plex Sans', sans-serif;\n+}\n+\n+h2.legal {\n+ font-family: 'IBM Plex Sans', sans-serif;\n+}\n+\nh1 {\nfont-size: 58px;\n}\n" }, { "change_type": "MODIFY", "old_path": "landing/privacy.react.js", "new_path": "landing/privacy.react.js", "diff": "import * as React from 'react';\n+import css from './landing.css';\n+\nfunction Privacy(): React.Node {\nreturn (\n<div>\n- <h1>Privacy Policy</h1>\n+ <h1 className={css.legal}>Privacy Policy</h1>\n<p>\nEffective date: <strong>June 29, 2021</strong>\n</p>\n- <h2>Introduction</h2>\n+ <h2 className={css.legal}>Introduction</h2>\n<p>\nWe built Comm as a privacy-focused alternative to the cloud-based\n@@ -32,7 +34,7 @@ function Privacy(): React.Node {\n</strong>\n</p>\n- <h2>Table of Contents</h2>\n+ <h2 className={css.legal}>Table of Contents</h2>\n<ul>\n<li>\n@@ -61,7 +63,7 @@ function Privacy(): React.Node {\n</li>\n</ul>\n- <h2>Information We Collect</h2>\n+ <h2 className={css.legal}>Information We Collect</h2>\n<p>\nWe collect the following categories of information, some of which might\n@@ -195,9 +197,11 @@ function Privacy(): React.Node {\nkey, as otherwise necessary to provide our Services.\n</p>\n- <h2>Your Rights in the Personal Data You Provide to Us</h2>\n+ <h1 className={css.legal}>\n+ Your Rights in the Personal Data You Provide to Us\n+ </h1>\n- <h3>Your Rights</h3>\n+ <h2 className={css.legal}>Your Rights</h2>\n<p>\nUnder applicable data protection legislation, in certain circumstances,\n@@ -247,14 +251,14 @@ function Privacy(): React.Node {\n</li>\n</ol>\n- <h3>Exercising Your Rights</h3>\n+ <h2 className={css.legal}>Exercising Your Rights</h2>\n<p>\nIf you wish to exercise any of these rights, please contact us using the\ndetails below.\n</p>\n- <h2>Deleting Your Data</h2>\n+ <h2 className={css.legal}>Deleting Your Data</h2>\n<p>\nIf you would like to delete your account, you can do this either by\n@@ -269,7 +273,7 @@ function Privacy(): React.Node {\nto have access to and control over your Content.\n</p>\n- <h2>Changes to this Privacy Policy</h2>\n+ <h2 className={css.legal}>Changes to this Privacy Policy</h2>\n<p>\nWe may update this Privacy Policy from time to time. If you use the\n@@ -279,7 +283,7 @@ function Privacy(): React.Node {\ncollected.\n</p>\n- <h2>Terms of Use</h2>\n+ <h2 className={css.legal}>Terms of Use</h2>\n<p>\nRemember that your use of Comm Technologies&apos; Services is at all\n@@ -289,7 +293,7 @@ function Privacy(): React.Node {\nUse.\n</p>\n- <h2>Contact Information</h2>\n+ <h2 className={css.legal}>Contact Information</h2>\n<p>\nIf you have any questions or comments about this Privacy Policy, the\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Use sans-serif font for legal headers Summary: Figured sans-serif headers would be better than monospace for the legal pages Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1546
129,184
30.06.2021 10:41:49
14,400
9da6a601e60a9ced831d0de971f1fabfbb065927
[landing] Pull footer out into its own css grid Summary: Pull footer out of the main CSS grid and into `footerGrid` Test Plan: Continues to look as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/home.react.js", "new_path": "landing/home.react.js", "diff": "@@ -6,7 +6,6 @@ import * as React from 'react';\nimport css from './landing.css';\nimport ReadDocsButton from './read-docs-btn.react';\nimport StarBackground from './star-background.react';\n-import SubscriptionForm from './subscription-form.react';\nconst useIsomorphicLayoutEffect =\ntypeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n@@ -136,11 +135,6 @@ function Home(): React.Node {\n<div className={css.read_the_docs}>\n<ReadDocsButton />\n</div>\n-\n- <div className={`${css.footer_logo} ${css.starting_section}`}>Comm</div>\n- <div className={`${css.subscribe_updates} ${css.starting_section}`}>\n- <SubscriptionForm />\n- </div>\n</div>\n</div>\n);\n" }, { "change_type": "MODIFY", "old_path": "landing/landing.css", "new_path": "landing/landing.css", "diff": "@@ -49,8 +49,8 @@ div.grid {\nmargin-right: auto;\ndisplay: grid;\npadding-top: 20px;\n- padding-left: 80px;\n- padding-right: 80px;\n+ padding-left: 60px;\n+ padding-right: 60px;\npadding-bottom: 40px;\ncolumn-gap: 6em;\ngrid-template-columns: 1fr 1fr;\n@@ -59,8 +59,21 @@ div.grid {\n'hero_copy hero_image'\n'server_image server_copy'\n'keyserver_company keyserver_company'\n- 'keyserver_copy read_the_docs'\n- 'footer_logo subscribe_updates';\n+ 'keyserver_copy read_the_docs';\n+}\n+\n+div.footerGrid {\n+ max-width: 1920px;\n+ margin-left: auto;\n+ margin-right: auto;\n+ display: grid;\n+ padding-top: 20px;\n+ padding-left: 60px;\n+ padding-right: 60px;\n+ padding-bottom: 40px;\n+ column-gap: 6em;\n+ grid-template-columns: 1fr 1fr;\n+ grid-template-areas: 'footer_logo_container subscribe_updates';\n}\ndiv.grid > div + .starting_section {\n@@ -112,11 +125,15 @@ div.read_the_docs {\npadding-bottom: 40px;\n}\n+div.footer_logo_container a {\n+ grid-area: footer_logo_container;\n+ display: block;\n+ color: white;\n+}\n+\ndiv.footer_logo {\nfont-family: 'IBM Plex Sans', sans-serif;\nfont-size: 24px;\n- grid-area: footer_logo;\n- align-self: center;\nfont-weight: 500;\n}\n@@ -128,6 +145,14 @@ div.particles {\nz-index: -1;\n}\n+div.legalContainer {\n+ max-width: 1920px;\n+ margin-left: auto;\n+ margin-right: auto;\n+ padding-left: 60px;\n+ padding-right: 60px;\n+}\n+\n@media (max-width: 1499px) {\ndiv.grid {\npadding-left: 60px;\n@@ -162,9 +187,30 @@ div.particles {\n'server_copy'\n'keyserver_company'\n'keyserver_copy'\n- 'read_the_docs'\n+ 'read_the_docs';\n+ }\n+\n+ div.footerGrid {\n+ display: grid;\n+ padding-left: 3%;\n+ padding-right: 3%;\n+ grid-template-columns: minmax(auto, 540px);\n+ justify-content: center;\n+ grid-template-areas:\n'subscribe_updates'\n- 'footer_logo';\n+ 'footer_logo_container';\n+ }\n+\n+ div.legalContainer {\n+ max-width: 540px;\n+ margin-left: auto;\n+ margin-right: auto;\n+ padding-left: 3%;\n+ padding-right: 3%;\n+ }\n+\n+ div.footer_logo_container {\n+ padding-top: 60px;\n}\nh1 {\n" }, { "change_type": "MODIFY", "old_path": "landing/landing.react.js", "new_path": "landing/landing.react.js", "diff": "import * as React from 'react';\nimport Home from './home.react';\n+import css from './landing.css';\nimport Privacy from './privacy.react';\n+import SubscriptionForm from './subscription-form.react';\nimport Terms from './terms.react';\nexport type ActivePage = 'home' | 'terms' | 'privacy';\n@@ -29,6 +31,11 @@ function Landing(): React.Node {\nreturn (\n<>\n{visibleNode}\n+ <div className={css.footerGrid}>\n+ <div className={css.footer_logo_container}>\n+ <div className={`${css.footer_logo} ${css.starting_section}`}>\n+ Comm\n+ </div>\n<a href=\"#\" onClick={navigateToHome}>\nHome\n</a>\n@@ -38,6 +45,11 @@ function Landing(): React.Node {\n<a href=\"#\" onClick={navigateToPrivacy}>\nPrivacy Policy\n</a>\n+ </div>\n+ <div className={`${css.subscribe_updates} ${css.starting_section}`}>\n+ <SubscriptionForm />\n+ </div>\n+ </div>\n</>\n);\n}\n" }, { "change_type": "MODIFY", "old_path": "landing/privacy.react.js", "new_path": "landing/privacy.react.js", "diff": "@@ -6,7 +6,7 @@ import css from './landing.css';\nfunction Privacy(): React.Node {\nreturn (\n- <div>\n+ <div className={css.legalContainer}>\n<h1 className={css.legal}>Privacy Policy</h1>\n<p>\n" }, { "change_type": "MODIFY", "old_path": "landing/subscription-form.css", "new_path": "landing/subscription-form.css", "diff": "@@ -16,7 +16,7 @@ form {\npadding-right: 20px;\ncursor: pointer;\nfont-family: 'IBM Plex Sans', sans-serif;\n- font-size: 18px;\n+ font-size: 15px;\ncolor: white;\nbackground: #7e57c2;\n@@ -59,7 +59,7 @@ input.email_input {\nbackground: transparent;\nfont-family: 'IBM Plex Mono', monospace;\n- font-size: 18px;\n+ font-size: 15px;\ncolor: white;\nborder: 1px solid white;\n" }, { "change_type": "MODIFY", "old_path": "landing/terms.react.js", "new_path": "landing/terms.react.js", "diff": "@@ -6,7 +6,7 @@ import css from './landing.css';\nfunction Terms(): React.Node {\nreturn (\n- <div>\n+ <div className={css.legalContainer}>\n<h1 className={css.legal}>Terms of Use</h1>\n<p>\nEffective date: <strong>June 29, 2021</strong>\n@@ -42,7 +42,7 @@ function Terms(): React.Node {\n<a href=\"https://comm.app/privacy\">click here</a>.\n</p>\n- <h2>Minimum Age</h2>\n+ <h2 className={css.legal}>Minimum Age</h2>\n<p>\nYou must be at least 13 years old to use our Services. The minimum age\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Pull footer out into its own css grid Summary: Pull footer out of the main CSS grid and into `footerGrid` Test Plan: Continues to look as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1548
129,184
30.06.2021 13:27:44
14,400
c98a625da8aa9bd7409f2f0058b94079a24dba86
[landing] Style footer and fade on link hover Summary: Style/format footer and add fade on hover effect to links Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/landing.css", "new_path": "landing/landing.css", "diff": "@@ -125,20 +125,31 @@ div.read_the_docs {\npadding-bottom: 40px;\n}\n-div.footer_logo_container a {\n+div.footer_logo_container {\ngrid-area: footer_logo_container;\n+}\n+\n+div.footer_logo_container a {\ndisplay: block;\n+ color: #8a8f98;\n+ transition: 0.2s;\n+ text-decoration: none;\n+ width: max-content;\n+}\n+div.footer_logo_container a:hover {\ncolor: white;\n}\n-div.footer_logo {\n+div.footer_logo a {\nfont-family: 'IBM Plex Sans', sans-serif;\nfont-size: 24px;\nfont-weight: 500;\n+ color: #bababa;\n}\ndiv.subscribe_updates {\ngrid-area: subscribe_updates;\n+ align-self: center;\n}\ndiv.particles {\n" }, { "change_type": "MODIFY", "old_path": "landing/landing.react.js", "new_path": "landing/landing.react.js", "diff": "@@ -34,13 +34,12 @@ function Landing(): React.Node {\n<div className={css.footerGrid}>\n<div className={css.footer_logo_container}>\n<div className={`${css.footer_logo} ${css.starting_section}`}>\n- Comm\n- </div>\n<a href=\"#\" onClick={navigateToHome}>\n- Home\n+ Comm\n</a>\n+ </div>\n<a href=\"#\" onClick={navigateToTerms}>\n- Terms of Service\n+ Terms of Use\n</a>\n<a href=\"#\" onClick={navigateToPrivacy}>\nPrivacy Policy\n" }, { "change_type": "MODIFY", "old_path": "landing/read-docs-btn.css", "new_path": "landing/read-docs-btn.css", "diff": "font-size: 24px;\npadding: 30px;\nheight: 160px;\n+ transition: 0.2s;\n}\n.buttonText {\ncolor: black;\n}\n+.button img {\n+ transition: 0.8s;\n+}\n+\n.button:hover img {\nfilter: invert(1);\n}\n" }, { "change_type": "MODIFY", "old_path": "landing/subscription-form.css", "new_path": "landing/subscription-form.css", "diff": "@@ -21,6 +21,8 @@ form {\nbackground: #7e57c2;\nbox-shadow: -12px 20px 50px rgba(126, 87, 194, 0.5);\n+\n+ transition: 0.2s;\n}\n.button_success {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Style footer and fade on link hover Summary: Style/format footer and add fade on hover effect to links Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1549
129,184
30.06.2021 14:04:45
14,400
22b3a13150f60ab7f25192de1340b3245e8ef7a7
[landing] Add `How Comm works` link to footer Summary: Direct link to the placeholder Notion doc Test Plan: I clicked the link and it took me to the Notion doc Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/landing.css", "new_path": "landing/landing.css", "diff": "@@ -149,7 +149,7 @@ div.footer_logo a {\ndiv.subscribe_updates {\ngrid-area: subscribe_updates;\n- align-self: center;\n+ align-self: flex-start;\n}\ndiv.particles {\n" }, { "change_type": "MODIFY", "old_path": "landing/landing.react.js", "new_path": "landing/landing.react.js", "diff": "@@ -44,6 +44,9 @@ function Landing(): React.Node {\n<a href=\"#\" onClick={navigateToPrivacy}>\nPrivacy Policy\n</a>\n+ <a href=\"https://www.notion.so/How-Comm-works-d6217941db7c4237b9d08b427aef3234\">\n+ How Comm works\n+ </a>\n</div>\n<div className={`${css.subscribe_updates} ${css.starting_section}`}>\n<SubscriptionForm />\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Add `How Comm works` link to footer Summary: Direct link to the placeholder Notion doc Test Plan: I clicked the link and it took me to the Notion doc Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1550
129,184
30.06.2021 14:23:16
14,400
a7c52c42d59044daae10db02478850bdc6e201d6
[landing] Style links in `legal-container` Summary: Styled links in `legal-container` to be purple (and lighter purple on hover) Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/landing.css", "new_path": "landing/landing.css", "diff": "@@ -156,7 +156,7 @@ div.particles {\nz-index: -1;\n}\n-div.legalContainer {\n+div.legal_container {\nmax-width: 1920px;\nmargin-left: auto;\nmargin-right: auto;\n@@ -164,6 +164,16 @@ div.legalContainer {\npadding-right: 60px;\n}\n+div.legal_container a {\n+ color: #7e57c2;\n+ text-decoration: none;\n+ transition: 0.2s;\n+ font-weight: bold;\n+}\n+div.legal_container a:hover {\n+ color: #8c69c9;\n+}\n+\n@media (max-width: 1499px) {\ndiv.grid {\npadding-left: 60px;\n@@ -212,7 +222,7 @@ div.legalContainer {\n'footer_logo_container';\n}\n- div.legalContainer {\n+ div.legal_container {\nmax-width: 540px;\nmargin-left: auto;\nmargin-right: auto;\n" }, { "change_type": "MODIFY", "old_path": "landing/privacy.react.js", "new_path": "landing/privacy.react.js", "diff": "@@ -6,7 +6,7 @@ import css from './landing.css';\nfunction Privacy(): React.Node {\nreturn (\n- <div className={css.legalContainer}>\n+ <div className={css.legal_container}>\n<h1 className={css.legal}>Privacy Policy</h1>\n<p>\n" }, { "change_type": "MODIFY", "old_path": "landing/terms.react.js", "new_path": "landing/terms.react.js", "diff": "@@ -6,7 +6,7 @@ import css from './landing.css';\nfunction Terms(): React.Node {\nreturn (\n- <div className={css.legalContainer}>\n+ <div className={css.legal_container}>\n<h1 className={css.legal}>Terms of Use</h1>\n<p>\nEffective date: <strong>June 29, 2021</strong>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Style links in `legal-container` Summary: Styled links in `legal-container` to be purple (and lighter purple on hover) Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1551
129,184
30.06.2021 17:15:20
14,400
c6e558a4a951eb04cc69c97abc8b76ea601650c6
[landing] Pull header out into its own "grid", give footer translucent blur effect Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/home.react.js", "new_path": "landing/home.react.js", "diff": "@@ -70,7 +70,6 @@ function Home(): React.Node {\n<div>\n<StarBackground className={css.particles} />\n<div className={css.grid}>\n- <h1 className={css.title}>Comm</h1>\n<div className={`${css.hero_image} ${css.starting_section}`}>\n<lottie-player\nid=\"eye-illustration\"\n" }, { "change_type": "MODIFY", "old_path": "landing/landing.css", "new_path": "landing/landing.css", "diff": "@@ -6,6 +6,12 @@ html {\nword-break: break-word;\n}\n+html,\n+body {\n+ margin: 0;\n+ padding: 0;\n+}\n+\nh1,\nh2 {\nfont-family: 'IBM Plex Mono', monospace;\n@@ -14,8 +20,8 @@ h2 {\nh1.title {\nfont-family: 'IBM Plex Sans', sans-serif;\n- font-size: 24px;\n- grid-area: title_container;\n+ font-size: 32px;\n+ grid-area: title;\n}\nh1.legal {\n@@ -38,7 +44,8 @@ h2 {\nfont-size: 50px;\n}\n-p {\n+p,\n+li {\nfont-size: 24px;\nline-height: 1.6em;\n}\n@@ -55,25 +62,52 @@ div.grid {\ncolumn-gap: 6em;\ngrid-template-columns: 1fr 1fr;\ngrid-template-areas:\n- 'title_container title_container'\n'hero_copy hero_image'\n'server_image server_copy'\n'keyserver_company keyserver_company'\n'keyserver_copy read_the_docs';\n}\n-div.footerGrid {\n+div.footer_container {\n+ background-color: rgba(255, 255, 255, 0.125);\n+ backdrop-filter: blur(3px);\n+}\n+\n+div.footer_grid {\nmax-width: 1920px;\nmargin-left: auto;\nmargin-right: auto;\ndisplay: grid;\n- padding-top: 20px;\n+ padding-top: 30px;\npadding-left: 60px;\npadding-right: 60px;\npadding-bottom: 40px;\ncolumn-gap: 6em;\ngrid-template-columns: 1fr 1fr;\n- grid-template-areas: 'footer_logo_container subscribe_updates';\n+ grid-template-areas: 'footer_sitemap_container subscribe_updates';\n+}\n+\n+div.header_grid {\n+ max-width: 1920px;\n+ margin-left: auto;\n+ margin-right: auto;\n+ display: grid;\n+ padding-top: 10px;\n+ padding-left: 60px;\n+ padding-right: 60px;\n+ column-gap: 6em;\n+ grid-template-columns: 1fr;\n+ grid-template-areas: 'title';\n+}\n+\n+div.header_grid a {\n+ color: white;\n+ text-decoration: none;\n+ transition: 0.2s;\n+}\n+div.header_grid a:hover {\n+ color: #7e57c2;\n+ text-decoration: none;\n}\ndiv.grid > div + .starting_section {\n@@ -108,7 +142,6 @@ div.server_image {\ndiv.keyserver_company {\ngrid-area: keyserver_company;\n- align-self: center;\ntext-align: center;\npadding-top: 80px;\n}\n@@ -125,18 +158,15 @@ div.read_the_docs {\npadding-bottom: 40px;\n}\n-div.footer_logo_container {\n- grid-area: footer_logo_container;\n-}\n-\n-div.footer_logo_container a {\n+div.footer_sitemap_container a {\ndisplay: block;\ncolor: #8a8f98;\ntransition: 0.2s;\ntext-decoration: none;\nwidth: max-content;\n+ padding-bottom: 4px;\n}\n-div.footer_logo_container a:hover {\n+div.footer_sitemap_container > a:hover {\ncolor: white;\n}\n@@ -144,12 +174,16 @@ div.footer_logo a {\nfont-family: 'IBM Plex Sans', sans-serif;\nfont-size: 24px;\nfont-weight: 500;\n- color: #bababa;\n+ color: white;\n+ padding-bottom: 8px;\n+}\n+div.footer_logo a:hover {\n+ color: #7e57c2;\n}\ndiv.subscribe_updates {\ngrid-area: subscribe_updates;\n- align-self: flex-start;\n+ align-self: center;\n}\ndiv.particles {\n@@ -174,6 +208,10 @@ div.legal_container a:hover {\ncolor: #8c69c9;\n}\n+div.footer_sitemap_container {\n+ grid-area: footer_sitemap_container;\n+}\n+\n@media (max-width: 1499px) {\ndiv.grid {\npadding-left: 60px;\n@@ -188,7 +226,8 @@ div.legal_container a:hover {\nfont-size: 38px;\n}\n- p {\n+ p,\n+ li {\nfont-size: 20px;\n}\n}\n@@ -201,7 +240,6 @@ div.legal_container a:hover {\ngrid-template-columns: minmax(auto, 540px);\njustify-content: center;\ngrid-template-areas:\n- 'title_container'\n'hero_image'\n'hero_copy'\n'server_image'\n@@ -210,8 +248,11 @@ div.legal_container a:hover {\n'keyserver_copy'\n'read_the_docs';\n}\n+ div.footer_container {\n+ padding-top: 5%;\n+ }\n- div.footerGrid {\n+ div.footer_grid {\ndisplay: grid;\npadding-left: 3%;\npadding-right: 3%;\n@@ -219,7 +260,16 @@ div.legal_container a:hover {\njustify-content: center;\ngrid-template-areas:\n'subscribe_updates'\n- 'footer_logo_container';\n+ 'footer_sitemap_container';\n+ }\n+\n+ div.header_grid {\n+ display: grid;\n+ padding-left: 3%;\n+ padding-right: 3%;\n+ grid-template-columns: minmax(auto, 540px);\n+ justify-content: center;\n+ grid-template-areas: 'title';\n}\ndiv.legal_container {\n@@ -230,8 +280,9 @@ div.legal_container a:hover {\npadding-right: 3%;\n}\n- div.footer_logo_container {\n+ div.footer_sitemap_container {\npadding-top: 60px;\n+ grid-area: footer_sitemap_container;\n}\nh1 {\n@@ -242,7 +293,8 @@ div.legal_container a:hover {\nfont-size: 24px;\n}\n- p {\n+ p,\n+ li {\nfont-size: 16px;\n}\n" }, { "change_type": "MODIFY", "old_path": "landing/landing.react.js", "new_path": "landing/landing.react.js", "diff": "@@ -30,14 +30,21 @@ function Landing(): React.Node {\nreturn (\n<>\n+ <div className={css.header_grid}>\n+ <a href=\"#\" onClick={navigateToHome}>\n+ <h1 className={css.title}>Comm</h1>\n+ </a>\n+ </div>\n{visibleNode}\n- <div className={css.footerGrid}>\n- <div className={css.footer_logo_container}>\n- <div className={`${css.footer_logo} ${css.starting_section}`}>\n+ <div className={css.footer_container}>\n+ <div className={css.footer_grid}>\n+ <div className={css.footer_sitemap_container}>\n+ <div className={css.footer_logo}>\n<a href=\"#\" onClick={navigateToHome}>\nComm\n</a>\n</div>\n+\n<a href=\"#\" onClick={navigateToTerms}>\nTerms of Use\n</a>\n@@ -48,10 +55,11 @@ function Landing(): React.Node {\nHow Comm works\n</a>\n</div>\n- <div className={`${css.subscribe_updates} ${css.starting_section}`}>\n+ <div className={css.subscribe_updates}>\n<SubscriptionForm />\n</div>\n</div>\n+ </div>\n</>\n);\n}\n" }, { "change_type": "MODIFY", "old_path": "landing/subscription-form.css", "new_path": "landing/subscription-form.css", "diff": "@@ -16,7 +16,7 @@ form {\npadding-right: 20px;\ncursor: pointer;\nfont-family: 'IBM Plex Sans', sans-serif;\n- font-size: 15px;\n+ font-size: 16px;\ncolor: white;\nbackground: #7e57c2;\n@@ -58,10 +58,10 @@ input.email_input {\nborder-radius: 8px;\npadding-left: 20px;\npadding-right: 20px;\n- background: transparent;\n+ background: rgba(11, 18, 27, 0.25);\nfont-family: 'IBM Plex Mono', monospace;\n- font-size: 15px;\n+ font-size: 16px;\ncolor: white;\nborder: 1px solid white;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Pull header out into its own "grid", give footer translucent blur effect Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1552
129,184
30.06.2021 19:56:11
14,400
c7457a70aea70a451dac6e660d298ea3b5bad003
[landing] Remove redundant `display:grid` Test Plan: Checked smallest breakpoint and things continued to look as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/landing.css", "new_path": "landing/landing.css", "diff": "@@ -223,7 +223,6 @@ div.body_grid > div + .starting_section {\ndiv.body_grid,\ndiv.footer_grid,\ndiv.header_grid {\n- display: grid;\npadding-left: 3%;\npadding-right: 3%;\ngrid-template-columns: minmax(auto, 540px);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Remove redundant `display:grid` Test Plan: Checked smallest breakpoint and things continued to look as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1554
129,184
30.06.2021 20:00:42
14,400
47e252c53646f6fea4426d2547b5db2003506708
[landing] Remove redundant `margin-left` and `margin-right` Summary: addressed feedback from D1548 Test Plan: continues to look as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/landing.css", "new_path": "landing/landing.css", "diff": "@@ -283,8 +283,6 @@ div.body_grid > div + .starting_section {\n/* ===== LEGAL PAGE STYLING ===== */\ndiv.legal_container {\nmax-width: 540px;\n- margin-left: auto;\n- margin-right: auto;\npadding-left: 3%;\npadding-right: 3%;\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Remove redundant `margin-left` and `margin-right` Summary: addressed feedback from D1548 Test Plan: continues to look as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1555
129,184
30.06.2021 20:12:09
14,400
97195695cf6c0b5888ab2a87279cb2af9e3f9b0e
[landing] Make sans-serif font default for `h1` and `h2` Summary: addressed feedback from D1546 (made sans-serif the default for `h1`/`h2` Test Plan: fonts continue to look as expected on main page/legal pages Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/home.react.js", "new_path": "landing/home.react.js", "diff": "@@ -80,7 +80,7 @@ function Home(): React.Node {\n/>\n</div>\n<div className={`${css.hero_copy} ${css.section}`}>\n- <h1>\n+ <h1 className={css.mono}>\nReclaim your\n<span className={css.purple_accent}> digital&nbsp;identity.</span>\n</h1>\n@@ -104,7 +104,7 @@ function Home(): React.Node {\n/>\n</div>\n<div className={`${css.server_copy} ${css.section}`}>\n- <h2>Apps need servers.</h2>\n+ <h2 className={css.mono}>Apps need servers.</h2>\n<p>\nSophisticated applications rely on servers to do things that your\ndevices simply can&apos;t.\n@@ -117,7 +117,7 @@ function Home(): React.Node {\n</div>\n<div className={css.keyserver_company}>\n- <h1>\n+ <h1 className={css.mono}>\nComm is the <span className={css.purple_accent}>keyserver</span>{' '}\ncompany.\n</h1>\n" }, { "change_type": "MODIFY", "old_path": "landing/landing.css", "new_path": "landing/landing.css", "diff": "@@ -16,26 +16,23 @@ body {\n/* ===== TEXT STYLES ===== */\nh1 {\nfont-size: 58px;\n- font-family: 'IBM Plex Mono', monospace;\n- font-weight: 500;\n+ font-family: 'IBM Plex Sans', sans-serif;\n}\nh1.logo {\n- font-family: 'IBM Plex Sans', sans-serif;\nfont-size: 32px;\ngrid-area: logo;\n}\nh2 {\nfont-size: 50px;\n- font-family: 'IBM Plex Mono', monospace;\n- font-weight: 500;\n+ font-family: 'IBM Plex Sans', sans-serif;\n}\n-/* Use sans-serif headers for legal pages (eg privacy policy) */\n-h1.legal,\n-h2.legal {\n- font-family: 'IBM Plex Sans', sans-serif;\n+h1.mono,\n+h2.mono {\n+ font-family: 'IBM Plex Mono', monospace;\n+ font-weight: 500;\n}\np,\n" }, { "change_type": "MODIFY", "old_path": "landing/privacy.react.js", "new_path": "landing/privacy.react.js", "diff": "@@ -7,13 +7,13 @@ import css from './landing.css';\nfunction Privacy(): React.Node {\nreturn (\n<div className={css.legal_container}>\n- <h1 className={css.legal}>Privacy Policy</h1>\n+ <h1>Privacy Policy</h1>\n<p>\nEffective date: <strong>June 29, 2021</strong>\n</p>\n- <h2 className={css.legal}>Introduction</h2>\n+ <h2>Introduction</h2>\n<p>\nWe built Comm as a privacy-focused alternative to the cloud-based\n@@ -34,7 +34,7 @@ function Privacy(): React.Node {\n</strong>\n</p>\n- <h2 className={css.legal}>Table of Contents</h2>\n+ <h2>Table of Contents</h2>\n<ul>\n<li>\n@@ -63,7 +63,7 @@ function Privacy(): React.Node {\n</li>\n</ul>\n- <h2 className={css.legal}>Information We Collect</h2>\n+ <h2>Information We Collect</h2>\n<p>\nWe collect the following categories of information, some of which might\n@@ -197,11 +197,9 @@ function Privacy(): React.Node {\nkey, as otherwise necessary to provide our Services.\n</p>\n- <h1 className={css.legal}>\n- Your Rights in the Personal Data You Provide to Us\n- </h1>\n+ <h1>Your Rights in the Personal Data You Provide to Us</h1>\n- <h2 className={css.legal}>Your Rights</h2>\n+ <h2>Your Rights</h2>\n<p>\nUnder applicable data protection legislation, in certain circumstances,\n@@ -251,14 +249,14 @@ function Privacy(): React.Node {\n</li>\n</ol>\n- <h2 className={css.legal}>Exercising Your Rights</h2>\n+ <h2>Exercising Your Rights</h2>\n<p>\nIf you wish to exercise any of these rights, please contact us using the\ndetails below.\n</p>\n- <h2 className={css.legal}>Deleting Your Data</h2>\n+ <h2>Deleting Your Data</h2>\n<p>\nIf you would like to delete your account, you can do this either by\n@@ -273,7 +271,7 @@ function Privacy(): React.Node {\nto have access to and control over your Content.\n</p>\n- <h2 className={css.legal}>Changes to this Privacy Policy</h2>\n+ <h2>Changes to this Privacy Policy</h2>\n<p>\nWe may update this Privacy Policy from time to time. If you use the\n@@ -283,7 +281,7 @@ function Privacy(): React.Node {\ncollected.\n</p>\n- <h2 className={css.legal}>Terms of Use</h2>\n+ <h2>Terms of Use</h2>\n<p>\nRemember that your use of Comm Technologies&apos; Services is at all\n@@ -293,7 +291,7 @@ function Privacy(): React.Node {\nUse.\n</p>\n- <h2 className={css.legal}>Contact Information</h2>\n+ <h2>Contact Information</h2>\n<p>\nIf you have any questions or comments about this Privacy Policy, the\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Make sans-serif font default for `h1` and `h2` Summary: addressed feedback from D1546 (made sans-serif the default for `h1`/`h2` Test Plan: fonts continue to look as expected on main page/legal pages Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1556
129,184
30.06.2021 20:22:59
14,400
490ec75f2e22daf6081159fc667cd5f9149f369a
[landing] Factor out `a:transition` Summary: addressed feedback from D1552 Test Plan: fade continues to look as it did previously Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/landing.css", "new_path": "landing/landing.css", "diff": "@@ -13,6 +13,11 @@ body {\npadding: 0;\n}\n+a {\n+ transition: 0.2s;\n+ text-decoration: none;\n+}\n+\n/* ===== TEXT STYLES ===== */\nh1 {\nfont-size: 58px;\n@@ -69,8 +74,6 @@ div.header_grid {\ndiv.header_grid a {\ncolor: white;\n- text-decoration: none;\n- transition: 0.2s;\n}\ndiv.header_grid a:hover {\ncolor: #7e57c2;\n@@ -126,8 +129,6 @@ div.sitemap a {\ndisplay: block;\npadding-bottom: 4px;\ncolor: #8a8f98;\n- transition: 0.2s;\n- text-decoration: none;\nwidth: max-content;\n}\ndiv.sitemap > a:hover {\n@@ -159,8 +160,6 @@ div.legal_container {\n}\ndiv.legal_container a {\ncolor: #7e57c2;\n- text-decoration: none;\n- transition: 0.2s;\n}\ndiv.legal_container a:hover {\ncolor: #8c69c9;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Factor out `a:transition` Summary: addressed feedback from D1552 Test Plan: fade continues to look as it did previously Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1557
129,184
30.06.2021 20:51:26
14,400
270ee9efd52e24151b8de4ed1fde6480f21bf389
[landing] Use sans-serif font for "Comm" in "Comm is the keyserver company." Summary: Use sans-serif font for Comm consistent with use of wordmark elsewhere Test Plan: Looks as expected: Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/home.react.js", "new_path": "landing/home.react.js", "diff": "@@ -117,9 +117,13 @@ function Home(): React.Node {\n</div>\n<div className={css.keyserver_company}>\n- <h1 className={css.mono}>\n- Comm is the <span className={css.purple_accent}>keyserver</span>{' '}\n+ <h1>\n+ Comm\n+ <span className={css.mono}>\n+ {' '}\n+ is the <span className={css.purple_accent}>keyserver</span>{' '}\ncompany.\n+ </span>\n</h1>\n</div>\n" }, { "change_type": "MODIFY", "old_path": "landing/landing.css", "new_path": "landing/landing.css", "diff": "@@ -18,6 +18,11 @@ a {\ntext-decoration: none;\n}\n+.mono {\n+ font-family: 'IBM Plex Mono', monospace;\n+ font-weight: 500;\n+}\n+\n/* ===== TEXT STYLES ===== */\nh1 {\nfont-size: 58px;\n@@ -34,12 +39,6 @@ h2 {\nfont-family: 'IBM Plex Sans', sans-serif;\n}\n-h1.mono,\n-h2.mono {\n- font-family: 'IBM Plex Mono', monospace;\n- font-weight: 500;\n-}\n-\np,\nli {\nfont-size: 24px;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Use sans-serif font for "Comm" in "Comm is the keyserver company." Summary: Use sans-serif font for Comm consistent with use of wordmark elsewhere Test Plan: Looks as expected: https://blob.sh/atul/2f1d.png Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1558
129,187
29.06.2021 19:09:43
14,400
09ea3920922986deb5bd373150d27ab22b06a0ef
[native] Finish removing Shared Web Credentials Summary: Missed some spots in D1535. Test Plan: Flow Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/account/native-credentials.js", "new_path": "native/account/native-credentials.js", "diff": "// @flow\n-import { Platform } from 'react-native';\nimport {\ngetInternetCredentials,\nsetInternetCredentials,\n@@ -20,10 +19,6 @@ let storedNativeKeychainCredentials: StoredCredentials = {\nstate: 'undetermined',\ncredentials: null,\n};\n-const storedSharedWebCredentials: StoredCredentials = {\n- state: Platform.OS === 'ios' ? 'undetermined' : 'unsupported',\n- credentials: null,\n-};\nasync function fetchNativeKeychainCredentials(): Promise<?UserCredentials> {\nif (storedNativeKeychainCredentials.state === 'determined') {\n@@ -43,16 +38,6 @@ async function fetchNativeKeychainCredentials(): Promise<?UserCredentials> {\n}\n}\n-function getNativeSharedWebCredentials(): ?UserCredentials {\n- if (Platform.OS !== 'ios') {\n- return null;\n- }\n- if (storedSharedWebCredentials.state !== 'determined') {\n- return null;\n- }\n- return storedSharedWebCredentials.credentials;\n-}\n-\nasync function fetchNativeCredentials(): Promise<?UserCredentials> {\nconst keychainCredentials = await fetchNativeKeychainCredentials();\nif (keychainCredentials) {\n@@ -104,15 +89,13 @@ async function deleteNativeKeychainCredentials() {\n}\n}\n-// eslint-disable-next-line no-unused-vars\n-function deleteNativeCredentialsFor(username: string) {\n+function deleteNativeCredentialsFor() {\nreturn deleteNativeKeychainCredentials();\n}\nexport {\nfetchNativeKeychainCredentials,\nfetchNativeCredentials,\n- getNativeSharedWebCredentials,\nsetNativeCredentials,\ndeleteNativeCredentialsFor,\n};\n" }, { "change_type": "MODIFY", "old_path": "native/account/resolve-invalidated-cookie.js", "new_path": "native/account/resolve-invalidated-cookie.js", "diff": "@@ -8,10 +8,7 @@ import type { FetchJSON } from 'lib/utils/fetch-json';\nimport { getGlobalNavContext } from '../navigation/icky-global';\nimport { store } from '../redux/redux-setup';\nimport { nativeLogInExtraInfoSelector } from '../selectors/account-selectors';\n-import {\n- fetchNativeKeychainCredentials,\n- getNativeSharedWebCredentials,\n-} from './native-credentials';\n+import { fetchNativeKeychainCredentials } from './native-credentials';\nasync function resolveInvalidatedCookie(\nfetchJSON: FetchJSON,\n@@ -19,27 +16,9 @@ async function resolveInvalidatedCookie(\nsource?: LogInActionSource,\n) {\nconst keychainCredentials = await fetchNativeKeychainCredentials();\n- if (keychainCredentials) {\n- const extraInfo = nativeLogInExtraInfoSelector({\n- redux: store.getState(),\n- navContext: getGlobalNavContext(),\n- })();\n- const { calendarQuery } = extraInfo;\n- const newCookie = await dispatchRecoveryAttempt(\n- logInActionTypes,\n- logIn(fetchJSON)({\n- ...keychainCredentials,\n- ...extraInfo,\n- source,\n- }),\n- { calendarQuery },\n- );\n- if (newCookie) {\n+ if (!keychainCredentials) {\nreturn;\n}\n- }\n- const sharedWebCredentials = getNativeSharedWebCredentials();\n- if (sharedWebCredentials) {\nconst extraInfo = nativeLogInExtraInfoSelector({\nredux: store.getState(),\nnavContext: getGlobalNavContext(),\n@@ -48,13 +27,12 @@ async function resolveInvalidatedCookie(\nawait dispatchRecoveryAttempt(\nlogInActionTypes,\nlogIn(fetchJSON)({\n- ...sharedWebCredentials,\n+ ...keychainCredentials,\n...extraInfo,\nsource,\n}),\n{ calendarQuery },\n);\n}\n-}\nexport { resolveInvalidatedCookie };\n" }, { "change_type": "MODIFY", "old_path": "native/profile/delete-account.react.js", "new_path": "native/profile/delete-account.react.js", "diff": "@@ -35,7 +35,6 @@ import type { GlobalTheme } from '../types/themes';\ntype Props = {|\n// Redux state\n+loadingStatus: LoadingStatus,\n- +username: ?string,\n+preRequestUserState: PreRequestUserState,\n+activeTheme: ?GlobalTheme,\n+colors: Colors,\n@@ -142,9 +141,7 @@ class DeleteAccount extends React.PureComponent<Props, State> {\nasync deleteAccount() {\ntry {\n- if (this.props.username) {\n- await deleteNativeCredentialsFor(this.props.username);\n- }\n+ await deleteNativeCredentialsFor();\nconst result = await this.props.deleteAccount(\nthis.state.password,\nthis.props.preRequestUserState,\n@@ -237,12 +234,6 @@ const loadingStatusSelector = createLoadingStatusSelector(\nexport default React.memo<{ ... }>(function ConnectedDeleteAccount() {\nconst loadingStatus = useSelector(loadingStatusSelector);\n- const username = useSelector((state) => {\n- if (state.currentUserInfo && !state.currentUserInfo.anonymous) {\n- return state.currentUserInfo.username;\n- }\n- return undefined;\n- });\nconst preRequestUserState = useSelector(preRequestUserStateSelector);\nconst activeTheme = useSelector((state) => state.globalThemeInfo.activeTheme);\nconst colors = useColors();\n@@ -254,7 +245,6 @@ export default React.memo<{ ... }>(function ConnectedDeleteAccount() {\nreturn (\n<DeleteAccount\nloadingStatus={loadingStatus}\n- username={username}\npreRequestUserState={preRequestUserState}\nactiveTheme={activeTheme}\ncolors={colors}\n" }, { "change_type": "MODIFY", "old_path": "native/profile/profile-screen.react.js", "new_path": "native/profile/profile-screen.react.js", "diff": "// @flow\n-import invariant from 'invariant';\nimport * as React from 'react';\nimport { View, Text, Alert, Platform, ScrollView } from 'react-native';\nimport Icon from 'react-native-vector-icons/Ionicons';\n@@ -18,10 +17,7 @@ import {\nuseServerCall,\n} from 'lib/utils/action-utils';\n-import {\n- getNativeSharedWebCredentials,\n- deleteNativeCredentialsFor,\n-} from '../account/native-credentials';\n+import { deleteNativeCredentialsFor } from '../account/native-credentials';\nimport Button from '../components/button.react';\nimport EditSettingButton from '../components/edit-setting-button.react';\nimport { SingleLine } from '../components/single-line.react';\n@@ -213,11 +209,8 @@ class ProfileScreen extends React.PureComponent<Props> {\n}\nconst alertTitle =\nPlatform.OS === 'ios' ? 'Keep Login Info in Keychain' : 'Keep Login Info';\n- const sharedWebCredentials = getNativeSharedWebCredentials();\n- const alertDescription = sharedWebCredentials\n- ? 'We will automatically fill out log-in forms with your credentials ' +\n- 'in the app and keep them available on squadcal.org in Safari.'\n- : 'We will automatically fill out log-in forms with your credentials ' +\n+ const alertDescription =\n+ 'We will automatically fill out log-in forms with your credentials ' +\n'in the app.';\nAlert.alert(\nalertTitle,\n@@ -258,9 +251,7 @@ class ProfileScreen extends React.PureComponent<Props> {\n}\nasync deleteNativeCredentials() {\n- const { username } = this;\n- invariant(username, \"can't log out if not logged in\");\n- await deleteNativeCredentialsFor(username);\n+ await deleteNativeCredentialsFor();\n}\nnavigateIfActive(name) {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Finish removing Shared Web Credentials Summary: Missed some spots in D1535. Test Plan: Flow Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1538
129,187
29.06.2021 19:11:05
14,400
a7a1b982906de813ac006a6fc0cd4f13a0766286
[native] Update bundle identifier in notif test files Summary: (These files can be drag-n-dropped into an iOS Simulator to simulate receiving a notif.) Test Plan: N/A Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/ios/apns/badgeonly.apns", "new_path": "native/ios/apns/badgeonly.apns", "diff": "{\n- \"Simulator Target Bundle\": \"org.squadcal.app\",\n+ \"Simulator Target Bundle\": \"app.comm\",\n\"prefix\": \"somebody:\",\n\"body\": \"asdasd\",\n\"title\": \"test\",\n" }, { "change_type": "MODIFY", "old_path": "native/ios/apns/test.apns", "new_path": "native/ios/apns/test.apns", "diff": "{\n- \"Simulator Target Bundle\": \"org.squadcal.app\",\n+ \"Simulator Target Bundle\": \"app.comm\",\n\"prefix\": \"somebody:\",\n\"body\": \"asdasd\",\n\"title\": \"test\",\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Update bundle identifier in notif test files Summary: (These files can be drag-n-dropped into an iOS Simulator to simulate receiving a notif.) Test Plan: N/A Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1539
129,187
29.06.2021 19:14:55
14,400
2d4ae8828754388bba6b7d4745d063348f1d7ead
[native] Change Android applicationId to app.comm Test Plan: Will test momentarily Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -265,11 +265,11 @@ android {\n}\ndefaultConfig {\n- applicationId \"org.squadcal\"\n+ applicationId 'app.comm'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\nversionCode 86\n- versionName \"0.0.86\"\n+ versionName '0.0.86'\nmissingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Change Android applicationId to app.comm Test Plan: Will test momentarily Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1540
129,187
29.06.2021 19:30:34
14,400
429aa663a9972d28b85093cca76dd9bea13a6b0a
[native] Switch Android to using Comm FCM config Test Plan: Compile and run Android in prod mode so notifs work. Will need to wait on [this task](https://www.notion.so/commapp/Update-server-to-conditionally-use-Comm-notif-keys-for-newer-codeVersions-b265894dc1bb455a96d32a59d1e4751a) to test Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/android/app/google-services.json", "new_path": "native/android/app/google-services.json", "diff": "{\n\"project_info\": {\n- \"project_number\": \"112225499479\",\n- \"firebase_url\": \"https://squadcal0.firebaseio.com\",\n- \"project_id\": \"squadcal0\",\n- \"storage_bucket\": \"squadcal0.appspot.com\"\n+ \"project_number\": \"514969426283\",\n+ \"project_id\": \"app-comm\",\n+ \"storage_bucket\": \"app-comm.appspot.com\"\n},\n\"client\": [\n{\n\"client_info\": {\n- \"mobilesdk_app_id\": \"1:112225499479:android:3ec8c4b5ce66e4d6\",\n+ \"mobilesdk_app_id\": \"1:514969426283:android:7b8abbd750fed8d5ce142e\",\n\"android_client_info\": {\n- \"package_name\": \"org.squadcal\"\n+ \"package_name\": \"app.comm\"\n}\n},\n\"oauth_client\": [\n{\n- \"client_id\": \"112225499479-96n7hrmcd0p6jrtneq0a9jln2r89njlf.apps.googleusercontent.com\",\n- \"client_type\": 1,\n- \"android_info\": {\n- \"package_name\": \"org.squadcal\",\n- \"certificate_hash\": \"f59f960eeb4350d6d1999acaffb04ad797c5aa9a\"\n- }\n- },\n- {\n- \"client_id\": \"112225499479-6o0pb12751igpglor28h4p3ankmulbpr.apps.googleusercontent.com\",\n+ \"client_id\": \"514969426283-emmp0canqn5mta3i3vrbe2ih3p4d7p0o.apps.googleusercontent.com\",\n\"client_type\": 3\n}\n],\n\"api_key\": [\n{\n- \"current_key\": \"AIzaSyCeKcy0v3rXSqdjixW93kgNVZvGx09CJMc\"\n+ \"current_key\": \"AIzaSyC6Up7R_kzJVswQW0fwxK8VGMiBj3I8kUE\"\n}\n],\n\"services\": {\n- \"analytics_service\": {\n- \"status\": 1\n- },\n\"appinvite_service\": {\n- \"status\": 2,\n\"other_platform_oauth_client\": [\n{\n- \"client_id\": \"112225499479-6o0pb12751igpglor28h4p3ankmulbpr.apps.googleusercontent.com\",\n+ \"client_id\": \"514969426283-emmp0canqn5mta3i3vrbe2ih3p4d7p0o.apps.googleusercontent.com\",\n\"client_type\": 3\n}\n]\n- },\n- \"ads_service\": {\n- \"status\": 2\n}\n}\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Switch Android to using Comm FCM config Test Plan: Compile and run Android in prod mode so notifs work. Will need to wait on [this task](https://www.notion.so/commapp/Update-server-to-conditionally-use-Comm-notif-keys-for-newer-codeVersions-b265894dc1bb455a96d32a59d1e4751a) to test Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1541
129,187
29.06.2021 20:30:22
14,400
ceccbabe8b04a7f2c5ee6742b7ca58d64b4c41af
[native] Hide Android signing key details Test Plan: Make sure I can still build and run release mode, as well as build+sign a release APK Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -246,6 +246,20 @@ afterEvaluate {\npreBuild.dependsOn(prepareExternalLibs)\n}\n+// Release keystore via macOS Keychain Access\n+def getPassword(String keyLabel) {\n+ def stdout = new ByteArrayOutputStream()\n+ exec {\n+ commandLine 'security',\n+ 'find-generic-password',\n+ '-wl', keyLabel,\n+ '-a', 'ashoat'\n+ standardOutput = stdout\n+ ignoreExitValue true\n+ }\n+ return stdout.toString().strip()\n+}\n+\nandroid {\nbuildFeatures {\nprefab true\n@@ -282,18 +296,34 @@ android {\n}\n}\nsigningConfigs {\n- config {\n- keyAlias 'AndroidSigningKey'\n- keyPassword 'daemon-killdeer-steer-shoddy'\n- storeFile file('/Users/ashoat/Dropbox/Downloads/push/android_key_store.jks')\n- storePassword 'typhoid-troupe-yakima-namely'\n+ debug {\n+ storeFile file('debug.keystore')\n+ storePassword 'android'\n+ keyAlias 'androiddebugkey'\n+ keyPassword 'android'\n+ }\n+ release {\n+ if (project.hasProperty('COMM_UPLOAD_STORE_FILE')) {\n+ def password = getPassword('CommAndroidKeyPassword')\n+ storeFile file(COMM_UPLOAD_STORE_FILE)\n+ storePassword password\n+ keyAlias COMM_UPLOAD_KEY_ALIAS\n+ keyPassword password\n+ }\n}\n}\nbuildTypes {\nrelease {\n+ if (project.hasProperty('COMM_UPLOAD_STORE_FILE')) {\n+ signingConfig signingConfigs.release\n+ } else {\n+ signingConfig signingConfigs.debug\n+ }\nminifyEnabled enableProguardInReleaseBuilds\nproguardFiles getDefaultProguardFile(\"proguard-android.txt\"), \"proguard-rules.pro\"\n- signingConfig signingConfigs.config\n+ }\n+ debug {\n+ signingConfig signingConfigs.debug\n}\n}\n" }, { "change_type": "ADD", "old_path": "native/android/app/debug.keystore", "new_path": "native/android/app/debug.keystore", "diff": "Binary files /dev/null and b/native/android/app/debug.keystore differ\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Hide Android signing key details Test Plan: Make sure I can still build and run release mode, as well as build+sign a release APK Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1542
129,187
30.06.2021 18:04:52
14,400
7c58777649e227e157622536ebcf275719cb0c93
[native] Fix android release build Summary: fix android release build Test Plan: build android in the release mode Reviewers: palys-swm, karol-bisztyga, atul Subscribers: ashoat, KatPo, palys-swm, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/android/app/CMakeLists.txt", "new_path": "native/android/app/CMakeLists.txt", "diff": "@@ -15,9 +15,10 @@ set(PACKAGE_NAME \"comm_jni_module\")\nfind_package(fbjni REQUIRED CONFIG)\nset(BUILD_TESTING OFF)\n+set(HAVE_SYMBOLIZE OFF)\nset(WITH_GTEST OFF CACHE BOOL \"Use googletest\" FORCE)\nset(WITH_GFLAGS OFF CACHE BOOL \"Use gflags\" FORCE)\n-add_subdirectory(./build/third-party-ndk/glog/glog-0.5.0/)\n+add_subdirectory(./build/third-party-ndk/glog/glog-0.4.0/)\nadd_subdirectory(../../node_modules/olm ./build)\ninclude_directories(\n" }, { "change_type": "MODIFY", "old_path": "native/android/build.gradle", "new_path": "native/android/build.gradle", "diff": "buildscript {\next {\nbuildToolsVersion = \"29.0.2\"\n- minSdkVersion = 16\n+ minSdkVersion = 21\ncompileSdkVersion = 29\ntargetSdkVersion = 29\n}\n" }, { "change_type": "MODIFY", "old_path": "native/android/gradle.properties", "new_path": "native/android/gradle.properties", "diff": "@@ -28,6 +28,6 @@ android.enableJetifier=true\nFLIPPER_VERSION=0.78.0\nFOLLY_VERSION=2020.01.13.00\n-GLOG_VERSION=0.5.0\n+GLOG_VERSION=0.4.0\nBOOST_VERSION=1_63_0\nDOUBLE_CONVERSION_VERSION=1.1.6\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Fix android release build Summary: fix android release build Test Plan: build android in the release mode Reviewers: palys-swm, karol-bisztyga, atul Reviewed By: atul Subscribers: ashoat, KatPo, palys-swm, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1547
129,187
30.06.2021 23:41:57
14,400
f3a0ca250ab550c9f8eb093aacf30bc1be019d14
[native] Update to Summary: This fixes the Android release build. See [this Notion task](https://www.notion.so/commapp/Android-release-build-doesn-t-compile-7b6a20438fad4ee4ad2a65f171206acd) for more details. Test Plan: `cd native && yarn react-native run-android --variant=release` Reviewers: karol-bisztyga, palys-swm, atul Subscribers: KatPo, Adrian
[ { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -309,8 +309,8 @@ PODS:\n- React-Core\n- react-native-in-app-message (1.0.2):\n- React\n- - react-native-netinfo (4.4.0):\n- - React\n+ - react-native-netinfo (6.0.0):\n+ - React-Core\n- react-native-notifications (1.1.19):\n- React\n- react-native-orientation-locker (1.1.6):\n@@ -764,7 +764,7 @@ SPEC CHECKSUMS:\nreact-native-ffmpeg: f9a60452aaa5d478aac205b248224994f3bde416\nreact-native-flipper: 8f36be6b8300d4e156d5164fde091287c9cf4563\nreact-native-in-app-message: f91de5009620af01456531118264c93e249b83ec\n- react-native-netinfo: 6bb847e64f45a2d69c6173741111cfd95c669301\n+ react-native-netinfo: e849fc21ca2f4128a5726c801a82fc6f4a6db50d\nreact-native-notifications: bb042206ac7eab9323d528c780b3d6fe796c1f5e\nreact-native-orientation-locker: 23918c400376a7043e752c639c122fcf6bce8f1c\nreact-native-safe-area-context: b6e0e284002381d2ff29fa4fff42b4d8282e3c94\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"@react-native-community/async-storage\": \"^1.6.1\",\n\"@react-native-community/clipboard\": \"^1.5.1\",\n\"@react-native-community/masked-view\": \"^0.1.10\",\n- \"@react-native-community/netinfo\": \"^4.4.0\",\n+ \"@react-native-community/netinfo\": \"^6.0.0\",\n\"@react-navigation/bottom-tabs\": \"^5.11.1\",\n\"@react-navigation/devtools\": \"^5.1.17\",\n\"@react-navigation/material-top-tabs\": \"^5.3.9\",\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "resolved \"https://registry.yarnpkg.com/@react-native-community/masked-view/-/masked-view-0.1.10.tgz#5dda643e19e587793bc2034dd9bf7398ad43d401\"\nintegrity sha512-rk4sWFsmtOw8oyx8SD3KSvawwaK7gRBSEIy2TAwURyGt+3TizssXP1r8nx3zY+R7v2vYYHXZ+k2/GULAT/bcaQ==\n-\"@react-native-community/netinfo@^4.4.0\":\n- version \"4.4.0\"\n- resolved \"https://registry.yarnpkg.com/@react-native-community/netinfo/-/netinfo-4.4.0.tgz#a18eb9ba082b6aca6add004b4a918250ad7d13bc\"\n- integrity sha512-qqNWMOsrDjj/daqV21ID2T8mNUjZD4pdx3PuWyE65gzKh2w+oMnzKb+J0NbLyZPn3wwLwU1+Cpf58A0ff5szjQ==\n+\"@react-native-community/netinfo@^6.0.0\":\n+ version \"6.0.0\"\n+ resolved \"https://registry.yarnpkg.com/@react-native-community/netinfo/-/netinfo-6.0.0.tgz#2a4d7190b508dd0c2293656c9c1aa068f6f60a71\"\n+ integrity sha512-Z9M8VGcF2IZVOo2x+oUStvpCW/8HjIRi4+iQCu5n+PhC7OqCQX58KYAzdBr///alIfRXiu6oMb+lK+rXQH1FvQ==\n\"@react-navigation/bottom-tabs@^5.11.1\":\nversion \"5.11.1\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Update to @react-native-community/netinfo@6.0.0 Summary: This fixes the Android release build. See [this Notion task](https://www.notion.so/commapp/Android-release-build-doesn-t-compile-7b6a20438fad4ee4ad2a65f171206acd) for more details. Test Plan: `cd native && yarn react-native run-android --variant=release` Reviewers: karol-bisztyga, palys-swm, atul Reviewed By: atul Subscribers: KatPo, Adrian Differential Revision: https://phabricator.ashoat.com/D1559
129,184
01.07.2021 15:23:26
14,400
9935fd7a3b69cd093c770d23d9ae8842d11c763b
[native] Add legal notices to `register-panel` Summary: Add links to the terms of use and privacy policy to the `register-panel` Test Plan: Looks as expected and links open in mobile browser Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/account/log-in-panel.react.js", "new_path": "native/account/log-in-panel.react.js", "diff": "@@ -97,7 +97,7 @@ class LogInPanel extends React.PureComponent<Props> {\nrender() {\nreturn (\n<Panel opacityValue={this.props.opacityValue}>\n- <View>\n+ <View style={styles.row}>\n<Icon name=\"user\" size={22} color=\"#777\" style={styles.icon} />\n<TextInput\nstyle={styles.input}\n@@ -118,7 +118,7 @@ class LogInPanel extends React.PureComponent<Props> {\nref={this.usernameInputRef}\n/>\n</View>\n- <View>\n+ <View style={styles.row}>\n<Icon name=\"lock\" size={22} color=\"#777\" style={styles.icon} />\n<TextInput\nstyle={styles.input}\n@@ -135,11 +135,13 @@ class LogInPanel extends React.PureComponent<Props> {\nref={this.passwordInputRef}\n/>\n</View>\n+ <View style={styles.footer}>\n<PanelButton\ntext=\"LOG IN\"\nloadingStatus={this.props.loadingStatus}\nonSubmit={this.onSubmit}\n/>\n+ </View>\n</Panel>\n);\n}\n@@ -316,6 +318,10 @@ class LogInPanel extends React.PureComponent<Props> {\nexport type InnerLogInPanel = LogInPanel;\nconst styles = StyleSheet.create({\n+ footer: {\n+ flexDirection: 'row',\n+ justifyContent: 'flex-end',\n+ },\nicon: {\nbottom: 8,\nleft: 4,\n@@ -324,6 +330,9 @@ const styles = StyleSheet.create({\ninput: {\npaddingLeft: 35,\n},\n+ row: {\n+ marginHorizontal: 24,\n+ },\n});\nconst loadingStatusSelector = createLoadingStatusSelector(logInActionTypes);\n" }, { "change_type": "MODIFY", "old_path": "native/account/modal-components.react.js", "new_path": "native/account/modal-components.react.js", "diff": "@@ -43,7 +43,7 @@ const styles = StyleSheet.create({\npadding: 0,\n},\ntextInputWrapperView: {\n- borderBottomColor: '#BBBBBB',\n+ borderBottomColor: '#A2A2A2',\nborderBottomWidth: 1,\n},\n});\n" }, { "change_type": "MODIFY", "old_path": "native/account/panel-components.react.js", "new_path": "native/account/panel-components.react.js", "diff": "@@ -46,11 +46,12 @@ function PanelButton(props: ButtonProps) {\n);\n}\nreturn (\n+ <View style={styles.submitButtonContainer}>\n<Button\nonPress={props.onSubmit}\ndisabled={props.loadingStatus === 'loading'}\ntopStyle={styles.submitButton}\n- style={styles.submitContentContainer}\n+ style={styles.innerSubmitButton}\niosFormat=\"highlight\"\niosActiveOpacity={0.85}\niosHighlightUnderlayColor=\"#A0A0A0DD\"\n@@ -58,10 +59,11 @@ function PanelButton(props: ButtonProps) {\n<Text style={styles.submitContentText}>{props.text}</Text>\n{buttonIcon}\n</Button>\n+ </View>\n);\n}\n-const scrollViewBelow = 568;\n+const scrollViewBelow = 1000;\ntype PanelBaseProps = {|\n+opacityValue: Animated.Value,\n@@ -168,26 +170,26 @@ const styles = StyleSheet.create({\nborderRadius: 6,\nmarginLeft: 20,\nmarginRight: 20,\n- paddingBottom: 37,\n- paddingLeft: 18,\n- paddingRight: 18,\npaddingTop: 6,\n},\n+ innerSubmitButton: {\n+ alignItems: 'flex-end',\n+ flexDirection: 'row',\n+ paddingVertical: 6,\n+ },\nloadingIndicatorContainer: {\npaddingBottom: 2,\nwidth: 14,\n},\nsubmitButton: {\nborderBottomRightRadius: 6,\n- bottom: 0,\n- position: 'absolute',\n- right: 0,\n+ flexGrow: 1,\n+ justifyContent: 'center',\n+ paddingLeft: 10,\n+ paddingRight: 18,\n},\n- submitContentContainer: {\n- alignItems: 'flex-end',\n- flexDirection: 'row',\n- paddingHorizontal: 18,\n- paddingVertical: 6,\n+ submitButtonContainer: {\n+ alignSelf: 'flex-end',\n},\nsubmitContentIconContainer: {\npaddingBottom: 5,\n" }, { "change_type": "MODIFY", "old_path": "native/account/register-panel.react.js", "new_path": "native/account/register-panel.react.js", "diff": "import invariant from 'invariant';\nimport React from 'react';\n-import { View, StyleSheet, Platform, Keyboard, Alert } from 'react-native';\n+import {\n+ Text,\n+ View,\n+ StyleSheet,\n+ Platform,\n+ Keyboard,\n+ Alert,\n+ Linking,\n+} from 'react-native';\nimport Animated from 'react-native-reanimated';\nimport Icon from 'react-native-vector-icons/FontAwesome';\n@@ -82,7 +90,7 @@ class RegisterPanel extends React.PureComponent<Props, State> {\nreturn (\n<Panel opacityValue={this.props.opacityValue} style={styles.container}>\n- <View>\n+ <View style={styles.row}>\n<Icon name=\"user\" size={22} color=\"#777\" style={styles.icon} />\n<TextInput\nstyle={styles.input}\n@@ -102,7 +110,7 @@ class RegisterPanel extends React.PureComponent<Props, State> {\nref={this.usernameInputRef}\n/>\n</View>\n- <View>\n+ <View style={styles.row}>\n<Icon name=\"lock\" size={22} color=\"#777\" style={styles.icon} />\n<TextInput\nstyle={styles.input}\n@@ -120,7 +128,7 @@ class RegisterPanel extends React.PureComponent<Props, State> {\nref={this.passwordInputRef}\n/>\n</View>\n- <View>\n+ <View style={styles.row}>\n<TextInput\nstyle={styles.input}\nvalue={this.props.registerState.state.confirmPasswordInputText}\n@@ -136,11 +144,32 @@ class RegisterPanel extends React.PureComponent<Props, State> {\n{...confirmPasswordTextInputExtraProps}\n/>\n</View>\n+ <View style={styles.footer}>\n+ <View style={styles.notice}>\n+ <Text style={styles.noticeText}>\n+ By signing up, you agree to our{' '}\n+ <Text\n+ style={styles.hyperlinkText}\n+ onPress={this.onTermsOfUsePressed}\n+ >\n+ Terms\n+ </Text>\n+ {' &'}\n+ <Text\n+ style={styles.hyperlinkText}\n+ onPress={this.onPrivacyPolicyPressed}\n+ >\n+ Privacy Policy\n+ </Text>\n+ .\n+ </Text>\n+ </View>\n<PanelButton\ntext=\"SIGN UP\"\nloadingStatus={this.props.loadingStatus}\nonSubmit={this.onSubmit}\n/>\n+ </View>\n</Panel>\n);\n}\n@@ -172,6 +201,14 @@ class RegisterPanel extends React.PureComponent<Props, State> {\nthis.confirmPasswordInput.focus();\n};\n+ onTermsOfUsePressed = () => {\n+ Linking.openURL('https://comm.app/terms');\n+ };\n+\n+ onPrivacyPolicyPressed = () => {\n+ Linking.openURL('https://comm.app/privacy');\n+ };\n+\nonChangeUsernameInputText = (text: string) => {\nthis.props.registerState.setState({ usernameInputText: text });\n};\n@@ -346,9 +383,19 @@ class RegisterPanel extends React.PureComponent<Props, State> {\nconst styles = StyleSheet.create({\ncontainer: {\n- paddingBottom: Platform.OS === 'ios' ? 37 : 36,\nzIndex: 2,\n},\n+ footer: {\n+ alignItems: 'stretch',\n+ flexDirection: 'row',\n+ flexShrink: 1,\n+ justifyContent: 'space-between',\n+ paddingLeft: 24,\n+ },\n+ hyperlinkText: {\n+ color: '#036AFF',\n+ fontWeight: 'bold',\n+ },\nicon: {\nbottom: 8,\nleft: 4,\n@@ -357,6 +404,24 @@ const styles = StyleSheet.create({\ninput: {\npaddingLeft: 35,\n},\n+ notice: {\n+ alignSelf: 'center',\n+ display: 'flex',\n+ flexShrink: 1,\n+ maxWidth: 190,\n+ paddingBottom: 18,\n+ paddingRight: 8,\n+ paddingTop: 12,\n+ },\n+ noticeText: {\n+ color: '#444',\n+ fontSize: 13,\n+ lineHeight: 20,\n+ textAlign: 'center',\n+ },\n+ row: {\n+ marginHorizontal: 24,\n+ },\n});\nconst loadingStatusSelector = createLoadingStatusSelector(registerActionTypes);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Add legal notices to `register-panel` Summary: Add links to the terms of use and privacy policy to the `register-panel` Test Plan: Looks as expected and links open in mobile browser Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1563
129,184
01.07.2021 16:19:24
14,400
dd461ec70bed7f13ff5950cad77bb4e340a4c50b
[lib] Add `role` to `keysWithStringsToBeRedacted` and `roles` to `keysWithObjectsWithKeysToBeRedacted` Summary: Add keys to sanitization Test Plan: Trigger crash report and import into redux dev tools Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "lib/utils/sanitization.js", "new_path": "lib/utils/sanitization.js", "diff": "@@ -65,6 +65,7 @@ const keysWithStringsToBeRedacted = new Set([\n'deletedUserID',\n'deviceToken',\n'updatedUserID',\n+ 'role',\n]);\n// eg {\"memberIDs\":[\"123\", \"456\"]} => {\"memberIDs\":[\"redacted\", \"redacted\"]}\n@@ -85,6 +86,7 @@ const keysWithObjectsWithKeysToBeRedacted = new Set([\n'threads',\n'messages',\n'entryInfos',\n+ 'roles',\n]);\n// eg {\"text\":\"hello world\"} => {\"text\":\"z6lgz waac5\"}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Add `role` to `keysWithStringsToBeRedacted` and `roles` to `keysWithObjectsWithKeysToBeRedacted` Summary: Add keys to sanitization Test Plan: Trigger crash report and import into redux dev tools Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1567
129,187
01.07.2021 16:25:40
14,400
b9482be0b32f0be3614b30486b94bd08a226a6c5
[native] Fix up LoggedOutModal for short devices and Android Test Plan: test on iPhone 5s, Nexus 4, iPhone 12 Pro Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/account/logged-out-modal.react.js", "new_path": "native/account/logged-out-modal.react.js", "diff": "@@ -27,6 +27,7 @@ import type { Shape } from 'lib/types/core';\nimport type { Dispatch } from 'lib/types/redux-types';\nimport { fetchNewCookieFromNativeCredentials } from 'lib/utils/action-utils';\n+import KeyboardAvoidingView from '../components/keyboard-avoiding-view.react';\nimport ConnectedStatusBar from '../connected-status-bar.react';\nimport type { KeyboardEvent, EmitterSubscription } from '../keyboard/keyboard';\nimport {\n@@ -527,10 +528,10 @@ class LoggedOutModal extends React.PureComponent<Props, State> {\nstyle={[styles.modalBackground, this.props.splashStyle]}\n/>\n<SafeAreaView style={styles.container} edges={safeAreaEdges}>\n- <View style={styles.container}>\n+ <KeyboardAvoidingView behavior=\"padding\" style={styles.container}>\n{animatedContent}\n{buttons}\n- </View>\n+ </KeyboardAvoidingView>\n</SafeAreaView>\n</React.Fragment>\n);\n" }, { "change_type": "MODIFY", "old_path": "native/account/panel-components.react.js", "new_path": "native/account/panel-components.react.js", "diff": "@@ -7,7 +7,6 @@ import {\nText,\nStyleSheet,\nScrollView,\n- LayoutAnimation,\n} from 'react-native';\nimport Animated from 'react-native-reanimated';\nimport Icon from 'react-native-vector-icons/FontAwesome';\n@@ -15,13 +14,6 @@ import Icon from 'react-native-vector-icons/FontAwesome';\nimport type { LoadingStatus } from 'lib/types/loading-types';\nimport Button from '../components/button.react';\n-import type { KeyboardEvent, EmitterSubscription } from '../keyboard/keyboard';\n-import {\n- addKeyboardShowListener,\n- addKeyboardDismissListener,\n- removeKeyboardListener,\n-} from '../keyboard/keyboard';\n-import { type DimensionsInfo } from '../redux/dimensions-updater.react';\nimport { useSelector } from '../redux/redux-utils';\nimport type { ViewStyle } from '../types/styles';\n@@ -46,7 +38,8 @@ function PanelButton(props: ButtonProps) {\n);\n}\nreturn (\n- <View style={styles.submitButtonContainer}>\n+ <View style={styles.submitButtonHorizontalContainer}>\n+ <View style={styles.submitButtonVerticalContainer}>\n<Button\nonPress={props.onSubmit}\ndisabled={props.loadingStatus === 'loading'}\n@@ -60,109 +53,34 @@ function PanelButton(props: ButtonProps) {\n{buttonIcon}\n</Button>\n</View>\n+ </View>\n);\n}\n-const scrollViewBelow = 1000;\n-\n-type PanelBaseProps = {|\n+type PanelProps = {|\n+opacityValue: Animated.Value,\n+children: React.Node,\n+style?: ViewStyle,\n|};\n-type PanelProps = {|\n- ...PanelBaseProps,\n- +dimensions: DimensionsInfo,\n-|};\n-type PanelState = {|\n- +keyboardHeight: number,\n-|};\n-class InnerPanel extends React.PureComponent<PanelProps, PanelState> {\n- state: PanelState = {\n- keyboardHeight: 0,\n- };\n- keyboardShowListener: ?EmitterSubscription;\n- keyboardHideListener: ?EmitterSubscription;\n-\n- componentDidMount() {\n- this.keyboardShowListener = addKeyboardShowListener(this.keyboardHandler);\n- this.keyboardHideListener = addKeyboardDismissListener(\n- this.keyboardHandler,\n- );\n- }\n-\n- componentWillUnmount() {\n- if (this.keyboardShowListener) {\n- removeKeyboardListener(this.keyboardShowListener);\n- this.keyboardShowListener = null;\n- }\n- if (this.keyboardHideListener) {\n- removeKeyboardListener(this.keyboardHideListener);\n- this.keyboardHideListener = null;\n- }\n- }\n-\n- keyboardHandler = (event: ?KeyboardEvent) => {\n- const frameEdge =\n- this.props.dimensions.height - this.props.dimensions.bottomInset;\n- const keyboardHeight = event ? frameEdge - event.endCoordinates.screenY : 0;\n- if (keyboardHeight === this.state.keyboardHeight) {\n- return;\n- }\n- const windowHeight = this.props.dimensions.height;\n- if (\n- windowHeight < scrollViewBelow &&\n- event &&\n- event.duration &&\n- event.easing\n- ) {\n- LayoutAnimation.configureNext({\n- duration: event.duration,\n- update: {\n- duration: event.duration,\n- type: LayoutAnimation.Types[event.easing] || 'keyboard',\n+function Panel(props: PanelProps): React.Node {\n+ const dimensions = useSelector((state) => state.dimensions);\n+ const containerStyle = React.useMemo(\n+ () => [\n+ styles.container,\n+ {\n+ opacity: props.opacityValue,\n+ marginTop: dimensions.height < 641 ? 15 : 40,\n},\n- });\n- }\n- this.setState({ keyboardHeight });\n- };\n-\n- render() {\n- const windowHeight = this.props.dimensions.height;\n- const containerStyle = {\n- opacity: this.props.opacityValue,\n- marginTop: windowHeight < 641 ? 15 : 40,\n- };\n- const content = (\n- <Animated.View\n- style={[styles.container, containerStyle, this.props.style]}\n- >\n- {this.props.children}\n- </Animated.View>\n+ props.style,\n+ ],\n+ [props.opacityValue, props.style, dimensions.height],\n);\n- if (windowHeight >= scrollViewBelow) {\n- return content;\n- }\n- const scrollViewStyle = {\n- paddingBottom: 73.5 + this.state.keyboardHeight,\n- };\nreturn (\n- <View style={scrollViewStyle}>\n<ScrollView bounces={false} keyboardShouldPersistTaps=\"handled\">\n- {content}\n+ <Animated.View style={containerStyle}>{props.children}</Animated.View>\n</ScrollView>\n- </View>\n);\n}\n-}\n-\n-const Panel = React.memo<PanelBaseProps>(function ConnectedPanel(\n- props: PanelBaseProps,\n-) {\n- const dimensions = useSelector((state) => state.dimensions);\n-\n- return <InnerPanel {...props} dimensions={dimensions} />;\n-});\nconst styles = StyleSheet.create({\ncontainer: {\n@@ -183,14 +101,17 @@ const styles = StyleSheet.create({\n},\nsubmitButton: {\nborderBottomRightRadius: 6,\n- flexGrow: 1,\njustifyContent: 'center',\npaddingLeft: 10,\npaddingRight: 18,\n},\n- submitButtonContainer: {\n+ submitButtonHorizontalContainer: {\nalignSelf: 'flex-end',\n},\n+ submitButtonVerticalContainer: {\n+ flexGrow: 1,\n+ justifyContent: 'center',\n+ },\nsubmitContentIconContainer: {\npaddingBottom: 5,\nwidth: 14,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Fix up LoggedOutModal for short devices and Android Test Plan: test on iPhone 5s, Nexus 4, iPhone 12 Pro Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1568
129,187
01.07.2021 23:15:51
14,400
12ea24361892755e1fdd57c1f499c5455f195179
[server] Change parameter format to push utils Summary: Switching to a named parameter setup with an object being passed in. Test Plan: Flow Reviewers: palys-swm, atul Subscribers: KatPo, Adrian
[ { "change_type": "MODIFY", "old_path": "server/src/push/rescind.js", "new_path": "server/src/push/rescind.js", "diff": "@@ -58,7 +58,10 @@ async function rescindPushNotifs(\ndelivery.iosID,\nrow.unread_count,\n);\n- deliveryPromises[id] = apnPush(notification, delivery.iosDeviceTokens);\n+ deliveryPromises[id] = apnPush({\n+ notification,\n+ deviceTokens: delivery.iosDeviceTokens,\n+ });\nreceivingDeviceTokens.push(...delivery.iosDeviceTokens);\n} else if (delivery.androidID) {\n// Old Android\n@@ -68,17 +71,16 @@ async function rescindPushNotifs(\nthreadID,\nnull,\n);\n- deliveryPromises[id] = fcmPush(\n+ deliveryPromises[id] = fcmPush({\nnotification,\n- delivery.androidDeviceTokens,\n- null,\n- );\n+ deviceTokens: delivery.androidDeviceTokens,\n+ });\nreceivingDeviceTokens.push(...delivery.androidDeviceTokens);\n} else if (delivery.deviceType === 'ios') {\n// New iOS\nconst { iosID, deviceTokens } = delivery;\nconst notification = prepareIOSNotification(iosID, row.unread_count);\n- deliveryPromises[id] = apnPush(notification, deviceTokens);\n+ deliveryPromises[id] = apnPush({ notification, deviceTokens });\nreceivingDeviceTokens.push(...deviceTokens);\n} else if (delivery.deviceType === 'android') {\n// New Android\n@@ -89,7 +91,7 @@ async function rescindPushNotifs(\nthreadID,\ncodeVersion,\n);\n- deliveryPromises[id] = fcmPush(notification, deviceTokens, null);\n+ deliveryPromises[id] = fcmPush({ notification, deviceTokens });\nreceivingDeviceTokens.push(...deviceTokens);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "server/src/push/send.js", "new_path": "server/src/push/send.js", "diff": "@@ -592,7 +592,7 @@ async function sendIOSNotification(\ndeviceTokens: $ReadOnlyArray<string>,\nnotificationInfo: NotificationInfo,\n): Promise<IOSResult> {\n- const response = await apnPush(notification, deviceTokens);\n+ const response = await apnPush({ notification, deviceTokens });\nconst delivery: IOSDelivery = {\nsource: notificationInfo.source,\ndeviceType: 'ios',\n@@ -634,7 +634,7 @@ async function sendAndroidNotification(\nconst collapseKey = notificationInfo.collapseKey\n? notificationInfo.collapseKey\n: null; // for Flow...\n- const response = await fcmPush(notification, deviceTokens, collapseKey);\n+ const response = await fcmPush({ notification, deviceTokens, collapseKey });\nconst androidIDs = response.fcmIDs ? response.fcmIDs : [];\nconst delivery: AndroidDelivery = {\nsource: notificationInfo.source,\n" }, { "change_type": "MODIFY", "old_path": "server/src/push/utils.js", "new_path": "server/src/push/utils.js", "diff": "@@ -67,10 +67,13 @@ const apnTokenInvalidationErrorCode = 410;\nconst apnBadRequestErrorCode = 400;\nconst apnBadTokenErrorString = 'BadDeviceToken';\n-async function apnPush(\n- notification: apn.Notification,\n- deviceTokens: $ReadOnlyArray<string>,\n-) {\n+async function apnPush({\n+ notification,\n+ deviceTokens,\n+}: {|\n+ +notification: apn.Notification,\n+ +deviceTokens: $ReadOnlyArray<string>,\n+|}) {\nconst apnProvider = await getAPNProvider();\nif (!apnProvider && process.env.NODE_ENV === 'development') {\nconsole.log('no server/secrets/apn_config.json so ignoring notifs');\n@@ -99,11 +102,15 @@ async function apnPush(\n}\n}\n-async function fcmPush(\n- notification: Object,\n- deviceTokens: $ReadOnlyArray<string>,\n- collapseKey: ?string,\n-) {\n+async function fcmPush({\n+ notification,\n+ deviceTokens,\n+ collapseKey,\n+}: {|\n+ +notification: Object,\n+ +deviceTokens: $ReadOnlyArray<string>,\n+ +collapseKey?: ?string,\n+|}) {\nconst initialized = await initializeFCMApp();\nif (!initialized && process.env.NODE_ENV === 'development') {\nconsole.log('no server/secrets/fcm_config.json so ignoring notifs');\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Change parameter format to push utils Summary: Switching to a named parameter setup with an object being passed in. Test Plan: Flow Reviewers: palys-swm, atul Reviewed By: palys-swm Subscribers: KatPo, Adrian Differential Revision: https://phabricator.ashoat.com/D1570
129,184
01.07.2021 21:06:23
14,400
09d70275f5f0a47696e9f7d765ae0f027296b1c1
[landing] Set initial landing component based on URL Summary: Set initial `activePage` based on `req.url`/`window.location.href` Test Plan: Can navigate to `/privacy` and `/terms` and it appears as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/landing.react.js", "new_path": "landing/landing.react.js", "diff": "@@ -8,10 +8,21 @@ import Privacy from './privacy.react';\nimport SubscriptionForm from './subscription-form.react';\nimport Terms from './terms.react';\n-export type ActivePage = 'home' | 'terms' | 'privacy';\n+const validEndpoints = new Set(['privacy', 'terms']);\n-function Landing(): React.Node {\n- const [activePage, setActivePage] = React.useState<ActivePage>('home');\n+export type LandingProps = {|\n+ +url: string,\n+|};\n+function Landing(props: LandingProps): React.Node {\n+ const { url } = props;\n+ const lastUrlElement = url.split('/').pop();\n+\n+ let initialPage = 'home';\n+ if (validEndpoints.has(lastUrlElement)) {\n+ initialPage = lastUrlElement;\n+ }\n+\n+ const [activePage, setActivePage] = React.useState(initialPage);\nconst navigateToHome = React.useCallback(() => setActivePage('home'), []);\nconst navigateToTerms = React.useCallback(() => setActivePage('terms'), []);\nconst navigateToPrivacy = React.useCallback(\n" }, { "change_type": "MODIFY", "old_path": "landing/root.js", "new_path": "landing/root.js", "diff": "@@ -6,7 +6,8 @@ import { hot } from 'react-hot-loader/root';\nimport Landing from './landing.react';\nfunction RootComponent() {\n- return <Landing />;\n+ const currentURL = window.location.href;\n+ return <Landing url={currentURL} />;\n}\nconst HotReloadingRootComponent: React.ComponentType<{||}> = hot(RootComponent);\n" }, { "change_type": "MODIFY", "old_path": "server/src/responders/landing-handler.js", "new_path": "server/src/responders/landing-handler.js", "diff": "@@ -7,6 +7,7 @@ import * as React from 'react';\nimport ReactDOMServer from 'react-dom/server';\nimport { promisify } from 'util';\n+import { type LandingProps } from '../landing/landing.react';\nimport { waitForStream } from '../utils/json-stream';\nimport { getLandingURLFacts } from '../utils/urls';\nimport { getMessageForException } from './utils';\n@@ -66,7 +67,8 @@ async function getAssetInfo() {\nreturn assetInfo;\n}\n-let webpackCompiledRootComponent: ?React.ComponentType<{||}> = null;\n+type LandingApp = React.ComponentType<LandingProps>;\n+let webpackCompiledRootComponent: ?LandingApp = null;\nasync function getWebpackCompiledRootComponentForSSR() {\nif (webpackCompiledRootComponent) {\nreturn webpackCompiledRootComponent;\n@@ -126,7 +128,7 @@ async function landingResponder(req: $Request, res: $Response) {\n<div id=\"react-root\">\n`);\n- const reactStream = renderToNodeStream(<Landing />);\n+ const reactStream = renderToNodeStream(<Landing url={req.url} />);\nreactStream.pipe(res, { end: false });\nawait waitForStream(reactStream);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Set initial landing component based on URL Summary: Set initial `activePage` based on `req.url`/`window.location.href` Test Plan: Can navigate to `/privacy` and `/terms` and it appears as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1575
129,184
01.07.2021 22:28:27
14,400
b40dff44398e6d835cb15eb067d30d5242f40287
[native] Move padding from `styles.icon` to `styles.sidebar` Summary: Before: After: Test Plan: `SidebarItem` looks as expected in the thread list and `SidebarListModal` Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/sidebar-item.react.js", "new_path": "native/chat/sidebar-item.react.js", "diff": "@@ -60,13 +60,12 @@ const unboundStyles = {\nheight: 30,\nflexDirection: 'row',\ndisplay: 'flex',\n- paddingLeft: 6,\n+ paddingLeft: 40,\npaddingRight: 18,\nalignItems: 'center',\nbackgroundColor: 'listBackground',\n},\nicon: {\n- paddingLeft: 34,\npaddingRight: 5,\ncolor: 'listForegroundSecondaryLabel',\n},\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Move padding from `styles.icon` to `styles.sidebar` Summary: Before: https://blob.sh/atul/6d56.png After: https://blob.sh/atul/eea6.png Test Plan: `SidebarItem` looks as expected in the thread list and `SidebarListModal` Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1576
129,184
01.07.2021 22:47:15
14,400
a8f5091f5559a491a5e006316bcf7f261f15e8cc
[native] Reduce "profile" splotch size and shift up Summary: Here's how it looks: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list-item.react.js", "new_path": "native/chat/chat-thread-list-item.react.js", "diff": "@@ -135,6 +135,7 @@ const chatThreadListItemHeight = 80;\nconst unboundStyles = {\ncolorSplotch: {\nmarginLeft: 6,\n+ marginBottom: 14,\n},\ncontainer: {\nheight: chatThreadListItemHeight,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/sidebar-item.react.js", "new_path": "native/chat/sidebar-item.react.js", "diff": "@@ -60,7 +60,7 @@ const unboundStyles = {\nheight: 30,\nflexDirection: 'row',\ndisplay: 'flex',\n- paddingLeft: 40,\n+ paddingLeft: 28,\npaddingRight: 18,\nalignItems: 'center',\nbackgroundColor: 'listBackground',\n" }, { "change_type": "MODIFY", "old_path": "native/components/color-splotch.react.js", "new_path": "native/components/color-splotch.react.js", "diff": "@@ -33,8 +33,8 @@ const styles = StyleSheet.create({\nwidth: 6,\n},\nprofile: {\n- height: 48,\n- width: 48,\n+ height: 36,\n+ width: 36,\n},\nsmall: {\nheight: 18,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Reduce "profile" splotch size and shift up Summary: Here's how it looks: https://blob.sh/atul/aff5.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1578
129,184
02.07.2021 10:25:02
14,400
a3eb34814c9b0c8fe72ba20bdfa5086c1a330af9
[native] Have `ThreadAncestorsLabel` match `threadName` and `lastActivity` color when unread Summary: Here's how it looks: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list-item.react.js", "new_path": "native/chat/chat-thread-list-item.react.js", "diff": "@@ -111,7 +111,10 @@ function ChatThreadListItem({\n<ColorSplotch color={data.threadInfo.color} size=\"profile\" />\n</View>\n<View style={styles.container}>\n- <ThreadAncestorsLabel threadInfo={data.threadInfo} />\n+ <ThreadAncestorsLabel\n+ threadInfo={data.threadInfo}\n+ unread={data.threadInfo.currentUser.unread}\n+ />\n<View style={styles.row}>\n<SingleLine style={[styles.threadName, unreadStyle]}>\n{data.threadInfo.uiName}\n" }, { "change_type": "MODIFY", "old_path": "native/components/thread-ancestors-label.react.js", "new_path": "native/components/thread-ancestors-label.react.js", "diff": "@@ -16,9 +16,10 @@ import { SingleLine } from './single-line.react';\ntype Props = {|\n+threadInfo: ThreadInfo,\n+ +unread: ?boolean,\n|};\nfunction ThreadAncestorsLabel(props: Props): React.Node {\n- const { threadInfo } = props;\n+ const { unread, threadInfo } = props;\nconst styles = useStyles(unboundStyles);\nconst ancestorThreads: $ReadOnlyArray<ThreadInfo> = useSelector((state) => {\nif (!threadIsPending(threadInfo.id)) {\n@@ -33,11 +34,15 @@ function ThreadAncestorsLabel(props: Props): React.Node {\nreturn path.join(' > ');\n}, [ancestorThreads]);\n+ const ancestorPathStyle = React.useMemo(() => {\n+ return unread ? [styles.pathText, styles.unread] : styles.pathText;\n+ }, [styles.pathText, styles.unread, unread]);\n+\nif (!ancestorPath) {\nreturn null;\n}\n- return <SingleLine style={styles.pathText}>{ancestorPath}</SingleLine>;\n+ return <SingleLine style={ancestorPathStyle}>{ancestorPath}</SingleLine>;\n}\nconst unboundStyles = {\n@@ -46,6 +51,9 @@ const unboundStyles = {\nfontSize: 12,\ncolor: 'listForegroundTertiaryLabel',\n},\n+ unread: {\n+ color: 'listForegroundLabel',\n+ },\n};\nexport default ThreadAncestorsLabel;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Have `ThreadAncestorsLabel` match `threadName` and `lastActivity` color when unread Summary: Here's how it looks: https://blob.sh/atul/7d2c.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1583
129,184
02.07.2021 13:58:24
14,400
52f640dbfa246ff80773f398f0f390e086bce88a
[native] Replace `ColorSplotch` rounded rectangle with squircle Summary: Replace `ColorSplotch` rounded rectangle with squircle Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/components/color-splotch.react.js", "new_path": "native/components/color-splotch.react.js", "diff": "// @flow\nimport React from 'react';\n-import { View, StyleSheet } from 'react-native';\n+import { StyleSheet } from 'react-native';\n+import { SquircleView } from 'react-native-figma-squircle';\ntype Props = {|\n+color: string,\n+size?: 'large' | 'small' | 'profile' | 'micro',\n|};\nfunction ColorSplotch(props: Props) {\n+ const { color, size } = props;\n+\nconst style = React.useMemo(() => {\n- const baseStyles = [styles.splotch, { backgroundColor: `#${props.color}` }];\n- if (props.size === 'small') {\n- return [...baseStyles, styles.small];\n- } else if (props.size === 'profile') {\n- return [...baseStyles, styles.profile];\n- } else if (props.size === 'micro') {\n- return [...baseStyles, styles.micro];\n+ if (size === 'profile') {\n+ return styles.profile;\n+ } else if (size === 'micro') {\n+ return styles.micro;\n}\n- return [...baseStyles, styles.large];\n- }, [props.color, props.size]);\n+ return styles.large;\n+ }, [size]);\n- return <View style={style} />;\n+ return (\n+ <SquircleView\n+ style={style}\n+ squircleParams={{\n+ cornerSmoothing: 0.95,\n+ cornerRadius: 10,\n+ fillColor: `#${color}`,\n+ }}\n+ />\n+ );\n}\nconst styles = StyleSheet.create({\n@@ -36,13 +45,6 @@ const styles = StyleSheet.create({\nheight: 36,\nwidth: 36,\n},\n- small: {\n- height: 18,\n- width: 18,\n- },\n- splotch: {\n- borderRadius: 8,\n- },\n});\nexport default ColorSplotch;\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -416,6 +416,8 @@ PODS:\n- React\n- RNScreens (2.14.0):\n- React-Core\n+ - RNSVG (12.1.1):\n+ - React\n- RNVectorIcons (6.6.0):\n- React\n- SDWebImage (5.9.3):\n@@ -528,6 +530,7 @@ DEPENDENCIES:\n- RNKeychain (from `../../node_modules/react-native-keychain`)\n- RNReanimated (from `../../node_modules/react-native-reanimated`)\n- RNScreens (from `../../node_modules/react-native-screens`)\n+ - RNSVG (from `../../node_modules/react-native-svg`)\n- RNVectorIcons (from `../../node_modules/react-native-vector-icons`)\n- UMAppLoader (from `../../node_modules/unimodules-app-loader/ios`)\n- UMBarCodeScannerInterface (from `../../node_modules/unimodules-barcode-scanner-interface/ios`)\n@@ -687,6 +690,8 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/react-native-reanimated\"\nRNScreens:\n:path: \"../../node_modules/react-native-screens\"\n+ RNSVG:\n+ :path: \"../../node_modules/react-native-svg\"\nRNVectorIcons:\n:path: \"../../node_modules/react-native-vector-icons\"\nUMAppLoader:\n@@ -794,6 +799,7 @@ SPEC CHECKSUMS:\nRNKeychain: f75b8c8b2f17d3b2aa1f25b4a0ac5b83d947ff8f\nRNReanimated: dd8c286ab5dd4ba36d3a7fef8bff7e08711b5476\nRNScreens: 2e278a90eb15092ed261d4f2271e3fc9b60d08d4\n+ RNSVG: 551acb6562324b1d52a4e0758f7ca0ec234e278f\nRNVectorIcons: 0bb4def82230be1333ddaeee9fcba45f0b288ed4\nSDWebImage: a31ee8e90a97303529e03fb0c333eae0eacb88e9\nSDWebImageWebPCoder: d0dac55073088d24b2ac1b191a71a8f8d0adac21\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"lottie-ios\": \"3.1.8\",\n\"lottie-react-native\": \"^4.0.2\",\n\"md5\": \"^2.2.1\",\n+ \"olm\": \"git+https://gitlab.matrix.org/matrix-org/olm.git#v3.2.4\",\n\"react\": \"16.13.1\",\n\"react-native\": \"0.63.4\",\n\"react-native-background-upload\": \"^5.6.0\",\n\"react-native-exit-app\": \"^1.1.0\",\n\"react-native-fast-image\": \"^8.3.0\",\n\"react-native-ffmpeg\": \"^0.4.4\",\n+ \"react-native-figma-squircle\": \"^0.1.2\",\n\"react-native-firebase\": \"^5.6.0\",\n\"react-native-floating-action\": \"^1.21.0\",\n\"react-native-fs\": \"2.15.2\",\n\"react-native-safe-area-context\": \"^3.1.9\",\n\"react-native-safe-area-view\": \"^2.0.0\",\n\"react-native-screens\": \"^2.14.0\",\n+ \"react-native-svg\": \"^12.1.1\",\n\"react-native-tab-view\": \"^2.15.2\",\n\"react-native-unimodules\": \"^0.9.0\",\n\"react-native-vector-icons\": \"^6.6.0\",\n\"reselect\": \"^4.0.0\",\n\"shallowequal\": \"^1.0.2\",\n\"simple-markdown\": \"^0.7.2\",\n- \"tinycolor2\": \"^1.4.1\",\n- \"olm\": \"git+https://gitlab.matrix.org/matrix-org/olm.git#v3.2.4\"\n+ \"tinycolor2\": \"^1.4.1\"\n},\n\"jest\": {\n\"preset\": \"react-native\"\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -6329,6 +6329,16 @@ css-select@^2.0.0:\ndomutils \"^1.7.0\"\nnth-check \"^1.0.2\"\n+css-select@^2.1.0:\n+ version \"2.1.0\"\n+ resolved \"https://registry.yarnpkg.com/css-select/-/css-select-2.1.0.tgz#6a34653356635934a81baca68d0255432105dbef\"\n+ integrity sha512-Dqk7LQKpwLoH3VovzZnkzegqNSuAziQyNZUcrdDM401iY+R5NkGBXGmtO05/yaXQziALuPogeG0b7UAgjnTJTQ==\n+ dependencies:\n+ boolbase \"^1.0.0\"\n+ css-what \"^3.2.1\"\n+ domutils \"^1.7.0\"\n+ nth-check \"^1.0.2\"\n+\ncss-tree@1.0.0-alpha.29:\nversion \"1.0.0-alpha.29\"\nresolved \"https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.29.tgz#3fa9d4ef3142cbd1c301e7664c1f352bd82f5a39\"\n@@ -6345,6 +6355,14 @@ css-tree@1.0.0-alpha.33:\nmdn-data \"2.0.4\"\nsource-map \"^0.5.3\"\n+css-tree@^1.0.0-alpha.39:\n+ version \"1.1.3\"\n+ resolved \"https://registry.yarnpkg.com/css-tree/-/css-tree-1.1.3.tgz#eb4870fb6fd7707327ec95c2ff2ab09b5e8db91d\"\n+ integrity sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==\n+ dependencies:\n+ mdn-data \"2.0.14\"\n+ source-map \"^0.6.1\"\n+\ncss-unit-converter@^1.1.1:\nversion \"1.1.1\"\nresolved \"https://registry.yarnpkg.com/css-unit-converter/-/css-unit-converter-1.1.1.tgz#d9b9281adcfd8ced935bdbaba83786897f64e996\"\n@@ -6355,6 +6373,11 @@ css-what@^2.1.2:\nresolved \"https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2\"\nintegrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==\n+css-what@^3.2.1:\n+ version \"3.4.2\"\n+ resolved \"https://registry.yarnpkg.com/css-what/-/css-what-3.4.2.tgz#ea7026fcb01777edbde52124e21f327e7ae950e4\"\n+ integrity sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ==\n+\ncssesc@^2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/cssesc/-/cssesc-2.0.0.tgz#3b13bd1bb1cb36e1bcb5a4dcd27f54c5dcb35703\"\n@@ -7949,6 +7972,11 @@ figgy-pudding@^3.5.1:\nresolved \"https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e\"\nintegrity sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==\n+figma-squircle@^0.1.2:\n+ version \"0.1.2\"\n+ resolved \"https://registry.yarnpkg.com/figma-squircle/-/figma-squircle-0.1.2.tgz#fa97de644131d99f2c42a2d8b70d56a36783c234\"\n+ integrity sha512-S5t05Sfo5N7oH4/diQEbTSbzfuiRTWTfkoyfhNTmPHhmQRu9kAFKCcTnQSyBp6bnGv0dk/1ewiPZBVtUKPq+1A==\n+\nfigures@^1.7.0:\nversion \"1.7.0\"\nresolved \"https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e\"\n@@ -11874,6 +11902,11 @@ md5@^2.2.1:\ncrypt \"~0.0.1\"\nis-buffer \"~1.1.1\"\n+mdn-data@2.0.14:\n+ version \"2.0.14\"\n+ resolved \"https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50\"\n+ integrity sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==\n+\nmdn-data@2.0.4:\nversion \"2.0.4\"\nresolved \"https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b\"\n@@ -14602,6 +14635,13 @@ react-native-ffmpeg@^0.4.4:\nresolved \"https://registry.yarnpkg.com/react-native-ffmpeg/-/react-native-ffmpeg-0.4.4.tgz#9f4dbda53c96078cecbbe83a866d4b535b957131\"\nintegrity sha512-MUBV3Xvto1Hl049Y9EaOZdjazkK1ixQzCzPEt1o7V2duSOrM2kJ2o/RiC4rSRgapU2uqYRHMZ6X4JJI7y40qXw==\n+react-native-figma-squircle@^0.1.2:\n+ version \"0.1.2\"\n+ resolved \"https://registry.yarnpkg.com/react-native-figma-squircle/-/react-native-figma-squircle-0.1.2.tgz#64973afcfb42a53cc662ac2ccfba73ced7297124\"\n+ integrity sha512-c5xeOKsz22KoW7UNyAfaAj7u9fvOiXhy6tkRojv2lLtvKyuNxZTnPH5LPtjT0RLXr7P/xRKj1BYMPKzpMz+Kuw==\n+ dependencies:\n+ figma-squircle \"^0.1.2\"\n+\nreact-native-firebase@^5.6.0:\nversion \"5.6.0\"\nresolved \"https://registry.yarnpkg.com/react-native-firebase/-/react-native-firebase-5.6.0.tgz#6f6123f53cb73477915dd55c55f3e1de91db38d2\"\n@@ -14717,6 +14757,14 @@ react-native-screens@^2.14.0:\nresolved \"https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-2.14.0.tgz#2f0534c76e5bd0a95908ca61ec5d1cb7818d5f1e\"\nintegrity sha512-7EfxpYiJVvlFQNb1NlkEz7JRELVMLNIsrKo8jHq0+vXbDq+UxnAm/dMeYIXi8hY5iwqzk43uNPL8VyGPcLfBGQ==\n+react-native-svg@^12.1.1:\n+ version \"12.1.1\"\n+ resolved \"https://registry.yarnpkg.com/react-native-svg/-/react-native-svg-12.1.1.tgz#5f292410b8bcc07bbc52b2da7ceb22caf5bcaaee\"\n+ integrity sha512-NIAJ8jCnXGCqGWXkkJ1GTzO4a3Md5at5sagYV8Vh4MXYnL4z5Rh428Wahjhh+LIjx40EE5xM5YtwyJBqOIba2Q==\n+ dependencies:\n+ css-select \"^2.1.0\"\n+ css-tree \"^1.0.0-alpha.39\"\n+\nreact-native-tab-view@^2.15.2:\nversion \"2.15.2\"\nresolved \"https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-2.15.2.tgz#4bc7832d33a119306614efee667509672a7ee64e\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Replace `ColorSplotch` rounded rectangle with squircle Summary: Replace `ColorSplotch` rounded rectangle with squircle Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1584
129,184
02.07.2021 14:15:43
14,400
c2d14134429cba1802e6d663f2c1bda490884286
[native] Change `Profile` and `Apps` icon in tab bar Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/navigation/app-navigator.react.js", "new_path": "native/navigation/app-navigator.react.js", "diff": "@@ -73,14 +73,14 @@ const profileTabOptions = {\ntabBarLabel: 'Profile',\n// eslint-disable-next-line react/display-name\ntabBarIcon: ({ color }) => (\n- <Icon name=\"bars\" style={[styles.icon, { color }]} />\n+ <Icon name=\"user-circle\" style={[styles.icon, { color }]} />\n),\n};\nconst appsTabOptions = {\ntabBarLabel: 'Apps',\n// eslint-disable-next-line react/display-name\ntabBarIcon: ({ color }) => (\n- <Icon name=\"wrench\" style={[styles.icon, { color }]} />\n+ <Icon name=\"cube\" style={[styles.icon, { color }]} />\n),\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Change `Profile` and `Apps` icon in tab bar Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1585
129,184
02.07.2021 15:26:22
14,400
9e46104552871c4585e0cd1537e74b21030a3c4e
[native] Add `unreadIndicator` prop to `SidebarItem` and conditionally change padding Summary: Here is what it looks like: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list-item.react.js", "new_path": "native/chat/chat-thread-list-item.react.js", "diff": "@@ -138,7 +138,7 @@ const chatThreadListItemHeight = 80;\nconst unboundStyles = {\ncolorSplotch: {\nmarginLeft: 6,\n- marginBottom: 14,\n+ marginBottom: 18,\n},\ncontainer: {\nheight: chatThreadListItemHeight,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list-see-more-sidebars.react.js", "new_path": "native/chat/chat-thread-list-see-more-sidebars.react.js", "diff": "@@ -49,7 +49,7 @@ const unboundStyles = {\nheight: 30,\nflexDirection: 'row',\ndisplay: 'flex',\n- paddingLeft: 40,\n+ paddingLeft: 28,\npaddingRight: 18,\nalignItems: 'center',\nbackgroundColor: 'listBackground',\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list-sidebar.react.js", "new_path": "native/chat/chat-thread-list-sidebar.react.js", "diff": "@@ -28,7 +28,11 @@ function ChatThreadListSidebar(props: Props) {\ncurrentlyOpenedSwipeableId={currentlyOpenedSwipeableId}\niconSize={16}\n>\n- <SidebarItem sidebarInfo={sidebarInfo} onPressItem={onPressItem} />\n+ <SidebarItem\n+ sidebarInfo={sidebarInfo}\n+ onPressItem={onPressItem}\n+ unreadIndicator={true}\n+ />\n</SwipeableThread>\n);\n}\n" }, { "change_type": "MODIFY", "old_path": "native/chat/sidebar-item.react.js", "new_path": "native/chat/sidebar-item.react.js", "diff": "@@ -17,6 +17,7 @@ type Props = {|\n+sidebarInfo: SidebarInfo,\n+onPressItem: (threadInfo: ThreadInfo) => void,\n+style?: ?ViewStyle,\n+ +unreadIndicator?: boolean,\n|};\nfunction SidebarItem(props: Props) {\nconst { lastUpdatedTime } = props.sidebarInfo;\n@@ -33,16 +34,46 @@ function SidebarItem(props: Props) {\n]);\nconst colors = useColors();\n+\n+ const { unreadIndicator } = props;\n+ const sidebarStyle = React.useMemo(() => {\n+ if (unreadIndicator) {\n+ return [styles.sidebar, styles.sidebarWithUnreadIndicator, props.style];\n+ }\n+ return [styles.sidebar, props.style];\n+ }, [\n+ props.style,\n+ styles.sidebar,\n+ styles.sidebarWithUnreadIndicator,\n+ unreadIndicator,\n+ ]);\n+\n+ const sidebarIconStyle = React.useMemo(() => {\n+ if (unreadIndicator) {\n+ return [styles.sidebarIcon, styles.sidebarIconWithUnreadIndicator];\n+ }\n+ return styles.sidebarIcon;\n+ }, [\n+ styles.sidebarIcon,\n+ styles.sidebarIconWithUnreadIndicator,\n+ unreadIndicator,\n+ ]);\n+\n+ let unreadDot;\n+ if (unreadIndicator) {\n+ unreadDot = <UnreadDot unread={threadInfo.currentUser.unread} />;\n+ }\n+\nreturn (\n<Button\niosFormat=\"highlight\"\niosHighlightUnderlayColor={colors.listIosHighlightUnderlay}\niosActiveOpacity={0.85}\n- style={[styles.sidebar, props.style]}\n+ style={sidebarStyle}\nonPress={onPress}\n>\n- <UnreadDot unread={threadInfo.currentUser.unread} />\n- <Icon name=\"align-right\" style={styles.icon} size={24} />\n+ {unreadDot}\n+ <Icon name=\"align-right\" style={sidebarIconStyle} size={24} />\n<SingleLine style={[styles.name, unreadStyle]}>\n{threadInfo.uiName}\n</SingleLine>\n@@ -65,10 +96,16 @@ const unboundStyles = {\nalignItems: 'center',\nbackgroundColor: 'listBackground',\n},\n- icon: {\n+ sidebarWithUnreadIndicator: {\n+ paddingLeft: 6,\n+ },\n+ sidebarIcon: {\npaddingRight: 5,\ncolor: 'listForegroundSecondaryLabel',\n},\n+ sidebarIconWithUnreadIndicator: {\n+ paddingLeft: 22,\n+ },\nname: {\ncolor: 'listForegroundSecondaryLabel',\nflex: 1,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Add `unreadIndicator` prop to `SidebarItem` and conditionally change padding Summary: Here is what it looks like: https://blob.sh/atul/4b01.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1588
129,184
02.07.2021 16:18:45
14,400
a7a3ee40922451cc6fd22413834bb62dfd183dfd
[native] Reduce `ChatThreadListItem` height and adjust margins Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list-item.react.js", "new_path": "native/chat/chat-thread-list-item.react.js", "diff": "@@ -102,15 +102,16 @@ function ChatThreadListItem({\niosFormat=\"highlight\"\niosHighlightUnderlayColor={colors.listIosHighlightUnderlay}\niosActiveOpacity={0.85}\n- style={styles.row}\n+ style={styles.container}\n>\n+ <View style={styles.content}>\n<View style={styles.colorSplotch}>\n<UnreadDot unread={data.threadInfo.currentUser.unread} />\n</View>\n<View style={styles.colorSplotch}>\n<ColorSplotch color={data.threadInfo.color} size=\"profile\" />\n</View>\n- <View style={styles.container}>\n+ <View style={styles.threadDetails}>\n<ThreadAncestorsLabel\nthreadInfo={data.threadInfo}\nunread={data.threadInfo.currentUser.unread}\n@@ -127,6 +128,7 @@ function ChatThreadListItem({\n</Text>\n</View>\n</View>\n+ </View>\n</Button>\n</SwipeableThread>\n{sidebars}\n@@ -134,18 +136,28 @@ function ChatThreadListItem({\n);\n}\n-const chatThreadListItemHeight = 80;\n+const chatThreadListItemHeight = 70;\nconst unboundStyles = {\n+ container: {\n+ height: chatThreadListItemHeight,\n+ justifyContent: 'center',\n+ backgroundColor: 'listBackground',\n+ },\n+ content: {\n+ flexDirection: 'row',\n+ justifyContent: 'space-between',\n+ alignItems: 'center',\n+ },\ncolorSplotch: {\nmarginLeft: 6,\n- marginBottom: 18,\n+ marginBottom: 12,\n},\n- container: {\n- height: chatThreadListItemHeight,\n+ threadDetails: {\npaddingLeft: 12,\npaddingRight: 18,\njustifyContent: 'center',\nflex: 1,\n+ marginTop: 5,\n},\nlastActivity: {\ncolor: 'listForegroundTertiaryLabel',\n@@ -162,7 +174,6 @@ const unboundStyles = {\nflexDirection: 'row',\njustifyContent: 'space-between',\nalignItems: 'center',\n- backgroundColor: 'listBackground',\n},\nthreadName: {\ncolor: 'listForegroundSecondaryLabel',\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Reduce `ChatThreadListItem` height and adjust margins Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1590
129,187
02.07.2021 16:14:26
14,400
1329cfa529a7c21ed424fb59a58fae048fb4f74e
Add spacer to ChatThreadList Test Plan: Visual inspection, Flow Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "lib/selectors/chat-selectors.js", "new_path": "lib/selectors/chat-selectors.js", "diff": "@@ -58,7 +58,8 @@ export type SidebarItem =\n+type: 'seeMore',\n+unread: boolean,\n+showingSidebarsInline: boolean,\n- |};\n+ |}\n+ | {| +type: 'spacer' |};\nexport type ChatThreadItem = {|\n+type: 'chatThreadItem',\n@@ -171,6 +172,11 @@ function createChatThreadItem(\nshowingSidebarsInline: sidebarItems.length !== 0,\n});\n}\n+ if (sidebarItems.length !== 0) {\n+ sidebarItems.push({\n+ type: 'spacer',\n+ });\n+ }\nreturn {\ntype: 'chatThreadItem',\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list-item.react.js", "new_path": "native/chat/chat-thread-list-item.react.js", "diff": "@@ -68,7 +68,7 @@ function ChatThreadListItem({\nkey={sidebarItem.threadInfo.id}\n/>\n);\n- } else {\n+ } else if (sidebarItem.type === 'seeMore') {\nreturn (\n<ChatThreadListSeeMoreSidebars\nthreadInfo={data.threadInfo}\n@@ -78,6 +78,8 @@ function ChatThreadListItem({\nkey=\"seeMore\"\n/>\n);\n+ } else {\n+ return <View style={styles.spacer} key=\"spacer\" />;\n}\n});\n@@ -137,6 +139,7 @@ function ChatThreadListItem({\n}\nconst chatThreadListItemHeight = 70;\n+const spacerHeight = 6;\nconst unboundStyles = {\ncontainer: {\nheight: chatThreadListItemHeight,\n@@ -184,6 +187,9 @@ const unboundStyles = {\ncolor: 'listForegroundLabel',\nfontWeight: 'bold',\n},\n+ spacer: {\n+ height: spacerHeight,\n+ },\n};\n-export { ChatThreadListItem, chatThreadListItemHeight };\n+export { ChatThreadListItem, chatThreadListItemHeight, spacerHeight };\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list.react.js", "new_path": "native/chat/chat-thread-list.react.js", "diff": "@@ -53,6 +53,7 @@ import { animateTowards } from '../utils/animation-utils';\nimport {\nChatThreadListItem,\nchatThreadListItemHeight,\n+ spacerHeight,\n} from './chat-thread-list-item.react';\nimport type {\nChatTopTabsNavigationProp,\n@@ -338,7 +339,12 @@ class ChatThreadList extends React.PureComponent<Props, State> {\nreturn 123;\n}\n- return chatThreadListItemHeight + item.sidebars.length * 30;\n+ let height = chatThreadListItemHeight;\n+ height += item.sidebars.length * 30;\n+ if (item.sidebars.length > 0) {\n+ height += spacerHeight;\n+ }\n+ return height;\n}\nstatic heightOfItems(data: $ReadOnlyArray<Item>): number {\n" }, { "change_type": "MODIFY", "old_path": "web/chat/chat-thread-list-item.react.js", "new_path": "web/chat/chat-thread-list-item.react.js", "diff": "@@ -74,7 +74,7 @@ function ChatThreadListItem(props: Props) {\nkey={sidebarInfo.threadInfo.id}\n/>\n);\n- } else {\n+ } else if (sidebarItem.type === 'seeMore') {\nreturn (\n<ChatThreadListSeeMoreSidebars\nthreadInfo={item.threadInfo}\n@@ -84,6 +84,8 @@ function ChatThreadListItem(props: Props) {\nkey=\"seeMore\"\n/>\n);\n+ } else {\n+ return <div className={css.spacer} key=\"spacer\" />;\n}\n});\n" }, { "change_type": "MODIFY", "old_path": "web/chat/chat-thread-list.css", "new_path": "web/chat/chat-thread-list.css", "diff": "@@ -4,10 +4,10 @@ div.thread {\npadding: 5px 5px 5px 15px;\n}\ndiv.thread:hover {\n- background-color: #EEEEEE;\n+ background-color: #eeeeee;\n}\ndiv.activeThread {\n- background-color: #EEEEEE;\n+ background-color: #eeeeee;\n}\ndiv.thread div.title {\nflex: 1;\n@@ -54,7 +54,7 @@ div.dark {\ncolor: #666666;\n}\n.light {\n- color: #AAAAAA;\n+ color: #aaaaaa;\n}\ndiv.italic {\nfont-style: italic;\n@@ -95,7 +95,7 @@ div.sidebar .menu > button svg {\npadding: 0 10px;\n}\n.menu > button:hover {\n- background-color: #DDDDDD;\n+ background-color: #dddddd;\n}\n.menu > button:focus {\noutline: none;\n@@ -112,7 +112,7 @@ div.sidebar .menu > button svg {\nz-index: 1;\nwidth: max-content;\noverflow: hidden;\n- background-color: #EEEEEE;\n+ background-color: #eeeeee;\nborder-radius: 5px;\nbox-shadow: 1px 1px 5px 2px #00000022;\n}\n@@ -123,7 +123,7 @@ div.sidebar .menu > button svg {\nlist-style: none;\n}\n.menuContent li:not(:last-child) {\n- border-bottom: 1px solid #DDDDDD;\n+ border-bottom: 1px solid #dddddd;\n}\n.menuContent button {\nborder: none;\n@@ -132,7 +132,7 @@ div.sidebar .menu > button svg {\nfont-size: 16px;\n}\n.menuContent button:hover {\n- background-color: #DDDDDD;\n+ background-color: #dddddd;\n}\nul.list {\n@@ -142,13 +142,13 @@ ul.list {\ndiv.search {\ndisplay: flex;\n- background-color: #DDDDDD;\n+ background-color: #dddddd;\nborder-radius: 5px;\npadding: 3px 5px;\nalign-items: center;\n}\nsvg.searchVector {\n- fill: #AAAAAA;\n+ fill: #aaaaaa;\nheight: 22px;\nwidth: 22px;\npadding: 0 3px;\n@@ -158,7 +158,7 @@ div.search > input {\ncolor: black;\npadding: 0;\nborder: none;\n- background-color: #DDDDDD;\n+ background-color: #dddddd;\nfont-family: 'Open Sans', sans-serif;\nfont-weight: 600;\nfont-size: 15px;\n@@ -172,7 +172,7 @@ svg.clearQuery {\nfont-size: 15px;\npadding-bottom: 1px;\npadding-right: 2px;\n- color: #AAAAAA;\n+ color: #aaaaaa;\n}\nsvg.clearQuery:hover {\nfont-size: 15px;\n@@ -180,3 +180,7 @@ svg.clearQuery:hover {\npadding-right: 2px;\ncolor: white;\n}\n+\n+div.spacer {\n+ height: 6px;\n+}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Add spacer to ChatThreadList Test Plan: Visual inspection, Flow Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1589
129,187
02.07.2021 16:48:01
14,400
f02936e6f0411d36511e75d6a5956f4bfabbec87
[native] Specify sidebarHeight in only one file Summary: Avoiding copy-paste. Test Plan: Flow Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list-see-more-sidebars.react.js", "new_path": "native/chat/chat-thread-list-see-more-sidebars.react.js", "diff": "@@ -8,6 +8,7 @@ import type { ThreadInfo } from 'lib/types/thread-types';\nimport Button from '../components/button.react';\nimport { useColors, useStyles } from '../themes/colors';\n+import { sidebarHeight } from './sidebar-item.react';\ntype Props = {|\n+threadInfo: ThreadInfo,\n@@ -46,7 +47,7 @@ const unboundStyles = {\nfontWeight: 'bold',\n},\nbutton: {\n- height: 30,\n+ height: sidebarHeight,\nflexDirection: 'row',\ndisplay: 'flex',\npaddingLeft: 28,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list-sidebar.react.js", "new_path": "native/chat/chat-thread-list-sidebar.react.js", "diff": "@@ -4,7 +4,7 @@ import * as React from 'react';\nimport type { ThreadInfo, SidebarInfo } from 'lib/types/thread-types';\n-import SidebarItem from './sidebar-item.react';\n+import { SidebarItem } from './sidebar-item.react';\nimport SwipeableThread from './swipeable-thread.react';\ntype Props = {|\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list.react.js", "new_path": "native/chat/chat-thread-list.react.js", "diff": "@@ -63,6 +63,7 @@ import {\ntype MessageListParams,\nuseNavigateToThread,\n} from './message-list-types';\n+import { sidebarHeight } from './sidebar-item.react';\nconst floatingActions = [\n{\n@@ -340,7 +341,7 @@ class ChatThreadList extends React.PureComponent<Props, State> {\n}\nlet height = chatThreadListItemHeight;\n- height += item.sidebars.length * 30;\n+ height += item.sidebars.length * sidebarHeight;\nif (item.sidebars.length > 0) {\nheight += spacerHeight;\n}\n" }, { "change_type": "MODIFY", "old_path": "native/chat/sidebar-item.react.js", "new_path": "native/chat/sidebar-item.react.js", "diff": "@@ -82,13 +82,14 @@ function SidebarItem(props: Props) {\n);\n}\n+const sidebarHeight = 30;\nconst unboundStyles = {\nunread: {\ncolor: 'listForegroundLabel',\nfontWeight: 'bold',\n},\nsidebar: {\n- height: 30,\n+ height: sidebarHeight,\nflexDirection: 'row',\ndisplay: 'flex',\npaddingLeft: 28,\n@@ -120,4 +121,4 @@ const unboundStyles = {\n},\n};\n-export default SidebarItem;\n+export { SidebarItem, sidebarHeight };\n" }, { "change_type": "MODIFY", "old_path": "native/chat/sidebar-list-modal.react.js", "new_path": "native/chat/sidebar-list-modal.react.js", "diff": "@@ -16,7 +16,7 @@ import { useSelector } from '../redux/redux-utils';\nimport { useIndicatorStyle } from '../themes/colors';\nimport { waitForModalInputFocus } from '../utils/timers';\nimport { useNavigateToThread } from './message-list-types';\n-import SidebarItem from './sidebar-item.react';\n+import { SidebarItem } from './sidebar-item.react';\nexport type SidebarListModalParams = {|\n+threadInfo: ThreadInfo,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Specify sidebarHeight in only one file Summary: Avoiding copy-paste. Test Plan: Flow Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1591
129,184
02.07.2021 17:03:54
14,400
ee7623330857d9969e9efd29dd6c9c22de3b03a1
[landing] Replace inactive `how-it-works` link with notion page Test Plan: na Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/privacy.react.js", "new_path": "landing/privacy.react.js", "diff": "@@ -147,7 +147,10 @@ function Privacy(): React.Node {\nto access, view or control your Content.\n</strong>{' '}\nFor more information on how Comm works, please{' '}\n- <a href=\"https://comm.app/how-it-works\">click here</a>.\n+ <a href=\"https://www.notion.so/How-Comm-works-d6217941db7c4237b9d08b427aef3234\">\n+ click here\n+ </a>\n+ .\n</li>\n<li>\n<strong>Anonymized Data.</strong> We may create aggregated,\n" }, { "change_type": "MODIFY", "old_path": "landing/terms.react.js", "new_path": "landing/terms.react.js", "diff": "@@ -71,7 +71,10 @@ function Terms(): React.Node {\n</strong>{' '}\nHowever, other Comm users may have access to and control over your\nContent. For more information on how Comm works, please{' '}\n- <a href=\"https://comm.app/how-it-works\">click here</a>.\n+ <a href=\"https://www.notion.so/How-Comm-works-d6217941db7c4237b9d08b427aef3234\">\n+ click here\n+ </a>\n+ .\n</p>\n<h2>Are there restrictions in how I can use the Services?</h2>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Replace inactive `how-it-works` link with notion page Test Plan: na Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1592
129,187
02.07.2021 18:55:16
14,400
59b2a1005a0421a9d78c9e21303ac27b97ac7d83
[native] Update Folly.podspec patch to include Futex Summary: Was seeing an error about this when archiving the iOS app. Test Plan: Make sure iOS archive build works Reviewers: atul, karol-bisztyga Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "patches/react-native+0.63.4.patch", "new_path": "patches/react-native+0.63.4.patch", "diff": "@@ -439,7 +439,7 @@ index 9ae06db..35cc24e 100644\nversions['Flipper-PeerTalk'] ||= '~> 0.0.4'\nversions['Flipper-RSocket'] ||= '~> 1.1'\ndiff --git a/node_modules/react-native/third-party-podspecs/Folly.podspec b/node_modules/react-native/third-party-podspecs/Folly.podspec\n-index 35a0522..e7ba3ca 100644\n+index 35a0522..f64af8b 100644\n--- a/node_modules/react-native/third-party-podspecs/Folly.podspec\n+++ b/node_modules/react-native/third-party-podspecs/Folly.podspec\n@@ -459,7 +459,7 @@ index 35a0522..e7ba3ca 100644\nspec.compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_HAVE_PTHREAD=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-documentation'\nspec.source_files = 'folly/String.cpp',\n'folly/Conv.cpp',\n-@@ -23,6 +24,7 @@ Pod::Spec.new do |spec|\n+@@ -23,12 +24,14 @@ Pod::Spec.new do |spec|\n'folly/FileUtil.cpp',\n'folly/Format.cpp',\n'folly/lang/SafeAssert.cpp',\n@@ -467,18 +467,36 @@ index 35a0522..e7ba3ca 100644\n'folly/ScopeGuard.cpp',\n'folly/Unicode.cpp',\n'folly/dynamic.cpp',\n-@@ -36,7 +38,9 @@ Pod::Spec.new do |spec|\n+ 'folly/json.cpp',\n+ 'folly/json_pointer.cpp',\n+ 'folly/container/detail/F14Table.cpp',\n++ 'folly/detail/Futex.cpp',\n+ 'folly/detail/Demangle.cpp',\n+ 'folly/detail/UniqueInstance.cpp',\n+ 'folly/hash/SpookyHashV2.cpp',\n+@@ -36,7 +39,10 @@ Pod::Spec.new do |spec|\n'folly/lang/CString.cpp',\n'folly/memory/detail/MallocImpl.cpp',\n'folly/net/NetOps.cpp',\n- 'folly/portability/SysUio.cpp'\n+ 'folly/portability/SysUio.cpp',\n++ 'folly/synchronization/ParkingLot.cpp',\n+ 'folly/system/ThreadId.h',\n+ 'folly/system/ThreadId.cpp'\n# workaround for https://github.com/facebook/react-native/issues/14326\nspec.preserve_paths = 'folly/*.h',\n-@@ -74,6 +78,7 @@ Pod::Spec.new do |spec|\n+@@ -50,7 +56,8 @@ Pod::Spec.new do |spec|\n+ 'folly/memory/detail/*.h',\n+ 'folly/net/*.h',\n+ 'folly/net/detail/*.h',\n+- 'folly/portability/*.h'\n++ 'folly/portability/*.h',\n++ 'folly/synchronization/*.h'\n+ spec.libraries = \"stdc++\"\n+ spec.pod_target_xcconfig = { \"USE_HEADERMAP\" => \"NO\",\n+ \"CLANG_CXX_LANGUAGE_STANDARD\" => \"c++14\",\n+@@ -74,6 +81,7 @@ Pod::Spec.new do |spec|\n'folly/system/ThreadId.h'\nend\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Update Folly.podspec patch to include Futex Summary: Was seeing an error about this when archiving the iOS app. Test Plan: Make sure iOS archive build works Reviewers: atul, karol-bisztyga Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1593
129,187
02.07.2021 18:55:42
14,400
e2aa296f95d122f6ec4b69106559cbe5b22562a8
[native] Remove duplicate OLMKit entry in Podfile Summary: The native module system is automatically detecting `OLMKit` already, so this entry is a duplicate. Test Plan: Make sure iOS build still works Reviewers: atul, karol-bisztyga Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/ios/Podfile", "new_path": "native/ios/Podfile", "diff": "@@ -9,7 +9,6 @@ target 'Comm' do\npod 'ReactNativeKeyboardInput', :path => '../../node_modules/react-native-keyboard-input'\npod 'react-native-ffmpeg/min-lts', :podspec => '../../node_modules/react-native-ffmpeg/react-native-ffmpeg.podspec'\npod 'react-native-video/VideoCaching', :podspec => '../../node_modules/react-native-video/react-native-video.podspec'\n- pod 'OLMKit', :path => '../node_modules/olm'\nconfig = use_native_modules!\nuse_react_native!(:path => config[\"reactNativePath\"])\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -482,7 +482,7 @@ DEPENDENCIES:\n- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)\n- lottie-ios (from `../../node_modules/lottie-ios`)\n- lottie-react-native (from `../../node_modules/lottie-react-native`)\n- - OLMKit (from `../node_modules/olm`)\n+ - OLMKit (from `../../node_modules/olm`)\n- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)\n- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)\n- React (from `../node_modules/react-native/`)\n@@ -599,7 +599,7 @@ EXTERNAL SOURCES:\nlottie-react-native:\n:path: \"../../node_modules/lottie-react-native\"\nOLMKit:\n- :path: \"../node_modules/olm\"\n+ :path: \"../../node_modules/olm\"\nRCTRequired:\n:path: \"../node_modules/react-native/Libraries/RCTRequired\"\nRCTTypeSafety:\n@@ -745,7 +745,7 @@ SPEC CHECKSUMS:\nFlipper-RSocket: 127954abe8b162fcaf68d2134d34dc2bd7076154\nFlipperKit: 651f50a42eb95c01b3e89a60996dd6aded529eeb\nfmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9\n- Folly: 00d27e2e16cec51d7b55bb9d7224c193f29853c6\n+ Folly: c3ac3a75964f7c9dfa0163cc80f5b639a116ca30\nglog: 40a13f7840415b9a77023fbcae0f1e6f43192af3\nlibevent: 4049cae6c81cdb3654a443be001fb9bdceff7913\nlibwebp: e90b9c01d99205d03b6bb8f2c8c415e5a4ef66f0\n@@ -820,6 +820,6 @@ SPEC CHECKSUMS:\nYoga: 4bd86afe9883422a7c4028c00e34790f560923d6\nYogaKit: f782866e155069a2cca2517aafea43200b01fd5a\n-PODFILE CHECKSUM: 8f8059edfc975934a0c3081447c954a2bebeaf07\n+PODFILE CHECKSUM: 85fdfbf3b50f1814c23a136e76f57782706c0830\nCOCOAPODS: 1.10.1\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Remove duplicate OLMKit entry in Podfile Summary: The native module system is automatically detecting `OLMKit` already, so this entry is a duplicate. Test Plan: Make sure iOS build still works Reviewers: atul, karol-bisztyga Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1594
129,187
02.07.2021 20:25:43
14,400
5fd44636ef06e2161a191a6792e584b5f54db6bd
[native] Skip extraneous routes in resetState Summary: We were crashing because the `oldRoute` for `TabNavigator` had an extra tab. This diff makes sure us skip the extra tab. Test Plan: Test to make sure problem is solved Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/navigation/root-router.js", "new_path": "native/navigation/root-router.js", "diff": "@@ -69,7 +69,9 @@ export type RootRouterNavigationProp<\n|};\ntype ResetStateRoute = {\n+ +name: string,\n+state?: { +routes: $ReadOnlyArray<ResetStateRoute> },\n+ ...\n};\nfunction resetState<Route: ResetStateRoute>(\nnewPartialRoute: Route,\n@@ -86,10 +88,19 @@ function resetState<Route: ResetStateRoute>(\ninvariant(oldRoute.state, 'resetState found non-matching state');\nconst routes = [];\n- for (let i = 0; i < newPartialRoute.state.routes.length; i++) {\n- routes.push(\n- resetState(newPartialRoute.state.routes[i], oldRoute.state.routes[i]),\n- );\n+ let newRouteIndex = 0;\n+ let oldRouteIndex = 0;\n+ while (newRouteIndex < newPartialRoute.state.routes.length) {\n+ const newSubroute = newPartialRoute.state.routes[newRouteIndex];\n+ let oldSubroute = oldRoute.state.routes[oldRouteIndex];\n+ invariant(oldSubroute, 'resetState found a missing oldRoute');\n+ while (oldSubroute.name !== newSubroute.name) {\n+ oldRouteIndex++;\n+ oldSubroute = oldRoute.state.routes[oldRouteIndex];\n+ }\n+ routes.push(resetState(newSubroute, oldSubroute));\n+ newRouteIndex++;\n+ oldRouteIndex++;\n}\nlet newState = {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Skip extraneous routes in resetState Summary: We were crashing because the `oldRoute` for `TabNavigator` had an extra tab. This diff makes sure us skip the extra tab. Test Plan: Test to make sure problem is solved Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1596
129,187
02.07.2021 19:02:04
14,400
a98891a19551b61bd5124cfab48f3a3dfa7f754e
[native] codeVersion -> 88
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -282,8 +282,8 @@ android {\napplicationId 'app.comm'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 86\n- versionName '0.0.86'\n+ versionCode 88\n+ versionName '0.0.88'\nmissingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.debug.plist", "new_path": "native/ios/Comm/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.86</string>\n+ <string>0.0.88</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>86</string>\n+ <string>88</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.release.plist", "new_path": "native/ios/Comm/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.86</string>\n+ <string>0.0.88</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>86</string>\n+ <string>88</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -280,7 +280,7 @@ const persistConfig = {\ntimeout: __DEV__ ? 0 : undefined,\n};\n-const codeVersion = 86;\n+const codeVersion = 88;\n// This local exists to avoid a circular dependency where redux-setup needs to\n// import all the navigation and screen stuff, but some of those screens want to\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] codeVersion -> 88
129,187
02.07.2021 21:38:57
14,400
dbb21c92deee83a4b13e23baab88cb0d384699b7
[server] Use correct bundle ID in Apple push notif Summary: This was a dumb oversight on my part... Test Plan: Test in prod! Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "server/src/push/providers.js", "new_path": "server/src/push/providers.js", "diff": "@@ -71,6 +71,10 @@ function endAPNs() {\n}\n}\n+function getAPNsNotificationTopic(codeVersion: ?number): string {\n+ return codeVersion && codeVersion >= 87 ? 'app.comm' : 'org.squadcal.app';\n+}\n+\nexport {\ngetAPNPushProfileForCodeVersion,\ngetFCMPushProfileForCodeVersion,\n@@ -78,4 +82,5 @@ export {\ngetFCMProvider,\nendFirebase,\nendAPNs,\n+ getAPNsNotificationTopic,\n};\n" }, { "change_type": "MODIFY", "old_path": "server/src/push/rescind.js", "new_path": "server/src/push/rescind.js", "diff": "@@ -9,6 +9,7 @@ import { promiseAll } from 'lib/utils/promises';\nimport createIDs from '../creators/id-creator';\nimport { dbQuery, SQL, SQLStatement } from '../database/database';\n+import { getAPNsNotificationTopic } from './providers';\nimport { apnPush, fcmPush } from './utils';\n// Returns list of deviceTokens that have been updated\n@@ -81,7 +82,11 @@ async function rescindPushNotifs(\n} else if (delivery.deviceType === 'ios') {\n// New iOS\nconst { iosID, deviceTokens, codeVersion } = delivery;\n- const notification = prepareIOSNotification(iosID, row.unread_count);\n+ const notification = prepareIOSNotification(\n+ iosID,\n+ row.unread_count,\n+ codeVersion,\n+ );\ndeliveryPromises[id] = apnPush({\nnotification,\ndeviceTokens,\n@@ -160,11 +165,12 @@ async function rescindPushNotifs(\nfunction prepareIOSNotification(\niosID: string,\nunreadCount: number,\n+ codeVersion: ?number,\n): apn.Notification {\nconst notification = new apn.Notification();\nnotification.contentAvailable = true;\nnotification.badge = unreadCount;\n- notification.topic = 'org.squadcal.app';\n+ notification.topic = getAPNsNotificationTopic(codeVersion);\nnotification.payload = {\nmanagedAps: {\naction: 'CLEAR',\n" }, { "change_type": "MODIFY", "old_path": "server/src/push/send.js", "new_path": "server/src/push/send.js", "diff": "@@ -37,6 +37,7 @@ import { fetchCollapsableNotifs } from '../fetchers/message-fetchers';\nimport { fetchServerThreadInfos } from '../fetchers/thread-fetchers';\nimport { fetchUserInfos } from '../fetchers/user-fetchers';\nimport type { Viewer } from '../session/viewer';\n+import { getAPNsNotificationTopic } from './providers';\nimport { apnPush, fcmPush, getUnreadCounts } from './utils';\ntype Device = {|\n@@ -162,6 +163,7 @@ async function sendPushNotifs(pushInfo: PushInfo) {\nnotifInfo.collapseKey,\nbadgeOnly,\nunreadCounts[userID],\n+ codeVersion,\n);\ndeliveryPromises.push(\nsendIOSNotification(notification, [...deviceTokens], {\n@@ -463,10 +465,11 @@ function prepareIOSNotification(\ncollapseKey: ?string,\nbadgeOnly: boolean,\nunreadCount: number,\n+ codeVersion: ?number,\n): apn.Notification {\nconst uniqueID = uuidv4();\nconst notification = new apn.Notification();\n- notification.topic = 'org.squadcal.app';\n+ notification.topic = getAPNsNotificationTopic(codeVersion);\nconst { merged, ...rest } = notifTextsForMessageInfo(\nallMessageInfos,\n@@ -769,7 +772,7 @@ async function updateBadgeCount(\nfor (const [codeVer, deviceTokens] of iosVersionsToTokens) {\nconst codeVersion = parseInt(codeVer, 10); // only for Flow\nconst notification = new apn.Notification();\n- notification.topic = 'org.squadcal.app';\n+ notification.topic = getAPNsNotificationTopic(codeVersion);\nnotification.badge = unreadCount;\nnotification.pushType = 'alert';\ndeliveryPromises.push(\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Use correct bundle ID in Apple push notif Summary: This was a dumb oversight on my part... Test Plan: Test in prod! Reviewers: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1599
129,184
02.07.2021 20:11:23
14,400
5102eb7c2cb71b9deb475ac29a6a8721e08f15aa
[landing] Introduce `Support` page Summary: Placeholder support page with support email address for soft launch. Known issue: the footer isn't "sticky," will address in subsequent diff. Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/landing.react.js", "new_path": "landing/landing.react.js", "diff": "@@ -6,9 +6,10 @@ import Home from './home.react';\nimport css from './landing.css';\nimport Privacy from './privacy.react';\nimport SubscriptionForm from './subscription-form.react';\n+import Support from './support.react';\nimport Terms from './terms.react';\n-const validEndpoints = new Set(['privacy', 'terms']);\n+const validEndpoints = new Set(['privacy', 'terms', 'support']);\nexport type LandingProps = {|\n+url: string,\n@@ -29,6 +30,10 @@ function Landing(props: LandingProps): React.Node {\n() => setActivePage('privacy'),\n[],\n);\n+ const navigateToSupport = React.useCallback(\n+ () => setActivePage('support'),\n+ [],\n+ );\nlet visibleNode;\nif (activePage === 'home') {\n@@ -37,6 +42,8 @@ function Landing(props: LandingProps): React.Node {\nvisibleNode = <Terms />;\n} else if (activePage === 'privacy') {\nvisibleNode = <Privacy />;\n+ } else if (activePage === 'support') {\n+ visibleNode = <Support />;\n}\nreturn (\n@@ -56,6 +63,9 @@ function Landing(props: LandingProps): React.Node {\n</a>\n</div>\n+ <a href=\"#\" onClick={navigateToSupport}>\n+ Support\n+ </a>\n<a href=\"#\" onClick={navigateToTerms}>\nTerms of Use\n</a>\n" }, { "change_type": "ADD", "old_path": null, "new_path": "landing/support.react.js", "diff": "+// @flow\n+\n+import * as React from 'react';\n+\n+import css from './landing.css';\n+\n+function Support(): React.Node {\n+ return (\n+ <div className={css.legal_container}>\n+ <h1>Support</h1>\n+\n+ <p>\n+ If you have any feedback, questions, or concerns, you can reach us at{' '}\n+ <a href=\"mailto:support@comm.app\">support@comm.app</a>.\n+ </p>\n+ </div>\n+ );\n+}\n+\n+export default Support;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Introduce `Support` page Summary: Placeholder support page with support email address for soft launch. Known issue: the footer isn't "sticky," will address in subsequent diff. Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1595
129,187
02.07.2021 21:06:16
14,400
0a6add784345d89b00b843fa65739597741f66a7
[native] Change Android appID to app.comm.android Summary: Apparently `app.comm` has already been used. Test Plan: Run the app Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -279,7 +279,7 @@ android {\n}\ndefaultConfig {\n- applicationId 'app.comm'\n+ applicationId 'app.comm.android'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\nversionCode 88\n" }, { "change_type": "MODIFY", "old_path": "native/android/app/google-services.json", "new_path": "native/android/app/google-services.json", "diff": "\"client\": [\n{\n\"client_info\": {\n- \"mobilesdk_app_id\": \"1:514969426283:android:7b8abbd750fed8d5ce142e\",\n+ \"mobilesdk_app_id\": \"1:514969426283:android:6b655c12f6243f86ce142e\",\n\"android_client_info\": {\n- \"package_name\": \"app.comm\"\n+ \"package_name\": \"app.comm.android\"\n}\n},\n\"oauth_client\": [\n" }, { "change_type": "MODIFY", "old_path": "native/android/app/src/cpp/jsiInstaller.cpp", "new_path": "native/android/app/src/cpp/jsiInstaller.cpp", "diff": "@@ -11,7 +11,7 @@ namespace react = facebook::react;\nclass CommHybrid : public jni::HybridClass<CommHybrid> {\npublic:\n- static auto constexpr kJavaDescriptor = \"Lapp/comm/fbjni/CommHybrid;\";\n+ static auto constexpr kJavaDescriptor = \"Lapp/comm/android/fbjni/CommHybrid;\";\nstatic void initHybrid(\njni::alias_ref<jhybridobject> jThis,\n" }, { "change_type": "RENAME", "old_path": "native/android/app/src/debug/java/app/comm/ReactNativeFlipper.java", "new_path": "native/android/app/src/debug/java/app/comm/android/ReactNativeFlipper.java", "diff": "* <p>This source code is licensed under the MIT license found in the LICENSE file in the root\n* directory of this source tree.\n*/\n-package app.comm;\n+package app.comm.android;\nimport android.content.Context;\nimport com.facebook.flipper.android.AndroidFlipperClient;\n" }, { "change_type": "MODIFY", "old_path": "native/android/app/src/main/AndroidManifest.xml", "new_path": "native/android/app/src/main/AndroidManifest.xml", "diff": "<manifest\nxmlns:android=\"http://schemas.android.com/apk/res/android\"\nxmlns:tools=\"http://schemas.android.com/tools\"\n- package=\"app.comm\"\n+ package=\"app.comm.android\"\n>\n<uses-permission android:name=\"android.permission.INTERNET\" />\n<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\" />\n" }, { "change_type": "RENAME", "old_path": "native/android/app/src/main/java/app/comm/AndroidLifecycleModule.java", "new_path": "native/android/app/src/main/java/app/comm/android/AndroidLifecycleModule.java", "diff": "-package app.comm;\n+package app.comm.android;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\n" }, { "change_type": "RENAME", "old_path": "native/android/app/src/main/java/app/comm/CommCoreJSIModulePackage.java", "new_path": "native/android/app/src/main/java/app/comm/android/CommCoreJSIModulePackage.java", "diff": "-package app.comm;\n+package app.comm.android;\nimport com.facebook.react.bridge.JSIModulePackage;\nimport com.facebook.react.bridge.JSIModuleSpec;\n@@ -6,7 +6,7 @@ import com.facebook.react.bridge.JavaScriptContextHolder;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport java.util.Collections;\nimport java.util.List;\n-import app.comm.fbjni.CommHybrid;\n+import app.comm.android.fbjni.CommHybrid;\npublic class CommCoreJSIModulePackage implements JSIModulePackage {\n@Override\n" }, { "change_type": "RENAME", "old_path": "native/android/app/src/main/java/app/comm/CommPackage.java", "new_path": "native/android/app/src/main/java/app/comm/android/CommPackage.java", "diff": "-package app.comm;\n+package app.comm.android;\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.bridge.NativeModule;\n" }, { "change_type": "RENAME", "old_path": "native/android/app/src/main/java/app/comm/MainActivity.java", "new_path": "native/android/app/src/main/java/app/comm/android/MainActivity.java", "diff": "-package app.comm;\n+package app.comm.android;\nimport com.facebook.react.ReactFragmentActivity;\nimport android.os.Bundle;\n" }, { "change_type": "RENAME", "old_path": "native/android/app/src/main/java/app/comm/MainApplication.java", "new_path": "native/android/app/src/main/java/app/comm/android/MainApplication.java", "diff": "-package app.comm;\n+package app.comm.android;\n-import app.comm.generated.BasePackageList;\n+import app.comm.android.generated.BasePackageList;\nimport androidx.multidex.MultiDexApplication;\nimport android.content.Context;\n@@ -107,7 +107,7 @@ public class MainApplication extends MultiDexApplication implements ReactApplica\ntry {\n// We use reflection here to pick up the class that initializes Flipper,\n// since Flipper library is not available in release mode\n- Class<?> aClass = Class.forName(\"app.comm.ReactNativeFlipper\");\n+ Class<?> aClass = Class.forName(\"app.comm.android.ReactNativeFlipper\");\naClass\n.getMethod(\n\"initializeFlipper\",\n" }, { "change_type": "RENAME", "old_path": "native/android/app/src/main/java/app/comm/SplashActivity.java", "new_path": "native/android/app/src/main/java/app/comm/android/SplashActivity.java", "diff": "-package app.comm;\n+package app.comm.android;\nimport android.content.Intent;\nimport android.os.Bundle;\n" }, { "change_type": "RENAME", "old_path": "native/android/app/src/main/java/app/comm/fbjni/CommHybrid.java", "new_path": "native/android/app/src/main/java/app/comm/android/fbjni/CommHybrid.java", "diff": "-package app.comm.fbjni;\n+package app.comm.android.fbjni;\nimport android.content.Context;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Change Android appID to app.comm.android Summary: Apparently `app.comm` has already been used. Test Plan: Run the app Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1598
129,187
04.07.2021 18:21:17
14,400
619f3079d3cb45d82142a1da2c40d8f45c3eae82
[native] codeVersion -> 89 Android-only release to change the app ID to `app.comm.android` because apparently `app.comm` was already taken.
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -282,8 +282,8 @@ android {\napplicationId 'app.comm.android'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 88\n- versionName '0.0.88'\n+ versionCode 89\n+ versionName '0.0.89'\nmissingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.debug.plist", "new_path": "native/ios/Comm/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.88</string>\n+ <string>0.0.89</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>88</string>\n+ <string>89</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.release.plist", "new_path": "native/ios/Comm/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.88</string>\n+ <string>0.0.89</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>88</string>\n+ <string>89</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -280,7 +280,7 @@ const persistConfig = {\ntimeout: __DEV__ ? 0 : undefined,\n};\n-const codeVersion = 88;\n+const codeVersion = 89;\n// This local exists to avoid a circular dependency where redux-setup needs to\n// import all the navigation and screen stuff, but some of those screens want to\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] codeVersion -> 89 Android-only release to change the app ID to `app.comm.android` because apparently `app.comm` was already taken.
129,187
03.07.2021 21:14:35
14,400
545e00c1c1d8f4c6362424f89a79a19f4466f01d
[native] Reduce unread font-weight in ThreadList Summary: See screenshot in following diff Test Plan: Visual inspection Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list-item.react.js", "new_path": "native/chat/chat-thread-list-item.react.js", "diff": "@@ -87,8 +87,28 @@ function ChatThreadListItem({\nonPressItem(data.threadInfo, data.pendingPersonalThreadUserInfo);\n}, [onPressItem, data.threadInfo, data.pendingPersonalThreadUserInfo]);\n+ const threadNameStyle = React.useMemo(() => {\n+ if (!data.threadInfo.currentUser.unread) {\n+ return styles.threadName;\n+ }\n+ return [styles.threadName, styles.unreadThreadName];\n+ }, [\n+ data.threadInfo.currentUser.unread,\n+ styles.threadName,\n+ styles.unreadThreadName,\n+ ]);\n+\nconst lastActivity = shortAbsoluteDate(data.lastUpdatedTime);\n- const unreadStyle = data.threadInfo.currentUser.unread ? styles.unread : null;\n+ const lastActivityStyle = React.useMemo(() => {\n+ if (!data.threadInfo.currentUser.unread) {\n+ return styles.lastActivity;\n+ }\n+ return [styles.lastActivity, styles.unreadLastActivity];\n+ }, [\n+ data.threadInfo.currentUser.unread,\n+ styles.lastActivity,\n+ styles.unreadLastActivity,\n+ ]);\nreturn (\n<>\n@@ -119,15 +139,13 @@ function ChatThreadListItem({\nunread={data.threadInfo.currentUser.unread}\n/>\n<View style={styles.row}>\n- <SingleLine style={[styles.threadName, unreadStyle]}>\n+ <SingleLine style={threadNameStyle}>\n{data.threadInfo.uiName}\n</SingleLine>\n</View>\n<View style={styles.row}>\n{lastMessage}\n- <Text style={[styles.lastActivity, unreadStyle]}>\n- {lastActivity}\n- </Text>\n+ <Text style={lastActivityStyle}>{lastActivity}</Text>\n</View>\n</View>\n</View>\n@@ -167,6 +185,10 @@ const unboundStyles = {\nfontSize: 14,\nmarginLeft: 10,\n},\n+ unreadLastActivity: {\n+ color: 'listForegroundLabel',\n+ fontWeight: 'bold',\n+ },\nnoMessages: {\ncolor: 'listForegroundTertiaryLabel',\nflex: 1,\n@@ -183,9 +205,9 @@ const unboundStyles = {\nflex: 1,\nfontSize: 18,\n},\n- unread: {\n+ unreadThreadName: {\ncolor: 'listForegroundLabel',\n- fontWeight: 'bold',\n+ fontWeight: '500',\n},\nspacer: {\nheight: spacerHeight,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/inline-sidebar.react.js", "new_path": "native/chat/inline-sidebar.react.js", "diff": "@@ -86,6 +86,7 @@ const unboundStyles = {\nheight: inlineSidebarHeight,\n},\nunread: {\n+ color: 'listForegroundLabel',\nfontWeight: 'bold',\n},\nsidebar: {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Reduce unread font-weight in ThreadList Summary: See screenshot in following diff Test Plan: Visual inspection Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1602
129,187
03.07.2021 21:16:12
14,400
3f7c0df3b7bf1baa6526c43e34503e24375094d7
[native] Increase thread name size in ChatThreadListItem Summary: Here's how it looks: Test Plan: Visual inspection Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list-item.react.js", "new_path": "native/chat/chat-thread-list-item.react.js", "diff": "@@ -203,7 +203,7 @@ const unboundStyles = {\nthreadName: {\ncolor: 'listForegroundSecondaryLabel',\nflex: 1,\n- fontSize: 18,\n+ fontSize: 21,\n},\nunreadThreadName: {\ncolor: 'listForegroundLabel',\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Increase thread name size in ChatThreadListItem Summary: Here's how it looks: https://www.dropbox.com/s/x68b04z21nwe9bd/Screen%20Shot%202021-07-03%20at%209.13.07%20PM.png?dl=0 Test Plan: Visual inspection Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1603
129,187
05.07.2021 12:59:02
14,400
4877bc6a80b2226f5aec48f58fde90885a4cdeb5
[lib] Delete reports from ReportStore on log in/out Test Plan: I haven't really tested this... Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "lib/reducers/report-store-reducer.js", "new_path": "lib/reducers/report-store-reducer.js", "diff": "@@ -52,12 +52,12 @@ export default function reduceReportStore(\naction.payload.sessionChange.cookieInvalidated)\n) {\nreturn {\n- queuedReports: updatedReports,\n+ queuedReports: [],\nenabledReports: isDev ? defaultDevEnabledReports : defaultEnabledReports,\n};\n} else if (action.type === logInActionTypes.success) {\nreturn {\n- queuedReports: updatedReports,\n+ queuedReports: [],\nenabledReports:\nisStaff(action.payload.currentUserInfo.id) || isDev\n? defaultDevEnabledReports\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Delete reports from ReportStore on log in/out Test Plan: I haven't really tested this... Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1605
129,187
05.07.2021 13:09:51
14,400
dd5e0da0050fd4f89b877d31d41c9241f64b3a1c
[server] Update ashoat's message to new accounts for Comm soft launch Test Plan: Flow Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "server/src/creators/account-creator.js", "new_path": "server/src/creators/account-creator.js", "diff": "@@ -40,7 +40,7 @@ import {\nconst { commbot } = bots;\nconst ashoatMessages = [\n- 'welcome to SquadCal! thanks for helping to test the alpha.',\n+ 'welcome to Comm!',\n'as you inevitably discover bugs, have feature requests, or design ' +\n'suggestions, feel free to message them to me in the app.',\n];\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Update ashoat's message to new accounts for Comm soft launch Test Plan: Flow Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1607
129,187
05.07.2021 13:10:14
14,400
ac53099a8e8b6ff2b71eb56efb808f6bf59815a9
[native] Update notif alert to reference Comm instead of SquadCal Test Plan: Flow Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/push/push-handler.react.js", "new_path": "native/push/push-handler.react.js", "diff": "@@ -147,7 +147,7 @@ class PushHandler extends React.PureComponent<Props, State> {\nandroidNotificationChannelID,\n'Default',\nfirebase.notifications.Android.Importance.Max,\n- ).setDescription('SquadCal notifications channel');\n+ ).setDescription('Comm notifications channel');\nfirebase.notifications().android.createChannel(channel);\nthis.androidTokenListener = firebase\n.messaging()\n@@ -421,8 +421,8 @@ class PushHandler extends React.PureComponent<Props, State> {\nif (deviceType === 'ios') {\nAlert.alert(\n'Need notif permissions',\n- 'SquadCal needs notification permissions to keep you in the loop! ' +\n- 'Please enable in Settings App -> Notifications -> SquadCal.',\n+ 'Comm needs notification permissions to keep you in the loop! ' +\n+ 'Please enable in Settings App -> Notifications -> Comm.',\n[{ text: 'OK' }],\n);\n} else if (deviceType === 'android') {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Update notif alert to reference Comm instead of SquadCal Test Plan: Flow Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1608
129,187
05.07.2021 14:01:14
14,400
24f7a69f1f4150673cabfd71cb2aa2ae3d97839c
[native] codeVersion -> 90
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -282,8 +282,8 @@ android {\napplicationId 'app.comm.android'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 89\n- versionName '0.0.89'\n+ versionCode 90\n+ versionName '0.0.90'\nmissingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.debug.plist", "new_path": "native/ios/Comm/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.89</string>\n+ <string>0.0.90</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>89</string>\n+ <string>90</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.release.plist", "new_path": "native/ios/Comm/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.89</string>\n+ <string>0.0.90</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>89</string>\n+ <string>90</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -280,7 +280,7 @@ const persistConfig = {\ntimeout: __DEV__ ? 0 : undefined,\n};\n-const codeVersion = 89;\n+const codeVersion = 90;\n// This local exists to avoid a circular dependency where redux-setup needs to\n// import all the navigation and screen stuff, but some of those screens want to\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] codeVersion -> 90
129,184
05.07.2021 15:10:09
14,400
87de4c723e107b65308725829907d67ddc5089f4
[android] Change floating action color from green to brand purple Summary: Before: After: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list.react.js", "new_path": "native/chat/chat-thread-list.react.js", "diff": "@@ -448,7 +448,7 @@ class ChatThreadList extends React.PureComponent<Props, State> {\nactions={floatingActions}\noverrideWithAction\nonPressItem={this.composeThread}\n- color=\"#66AA66\"\n+ color=\"#7e57c2\"\n/>\n);\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[android] Change floating action color from green to brand purple Summary: Before: https://blob.sh/atul/float_green.png After: https://blob.sh/atul/float_purple.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1609
129,187
05.07.2021 16:11:35
14,400
9373ec763d9edb33ec511570a34963ebf16eda53
[server] Rename backups from squadcal to comm Test Plan: Test in prod! Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "server/src/cron/backups.js", "new_path": "server/src/cron/backups.js", "diff": "@@ -40,7 +40,7 @@ async function backupDB() {\n}\nconst dateString = dateFormat('yyyy-mm-dd-HH:MM');\n- const filename = `squadcal.${dateString}.sql.gz`;\n+ const filename = `comm.${dateString}.sql.gz`;\nconst filePath = `${backupConfig.directory}/${filename}`;\nconst mysqlDump = childProcess.spawn(\n@@ -146,7 +146,7 @@ async function deleteOldestBackup() {\nconst files = await readdir(backupConfig.directory);\nlet oldestFile;\nfor (const file of files) {\n- if (!file.endsWith('.sql.gz') || !file.startsWith('squadcal.')) {\n+ if (!file.endsWith('.sql.gz') || !file.startsWith('comm.')) {\ncontinue;\n}\nconst stat = await lstat(`${backupConfig.directory}/${file}`);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Rename backups from squadcal to comm Test Plan: Test in prod! Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1610
129,187
05.07.2021 16:31:59
14,400
89bca8ad182ba7a5e1b1e8ad38361ab9d44864ed
[server] Switch UNIX user from squadcal to comm Test Plan: Test in prod! Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "server/bash/backup_phabricator.sh", "new_path": "server/bash/backup_phabricator.sh", "diff": "@@ -10,7 +10,7 @@ PHABRICATOR_PATH=/var/www/phacility/phabricator\nBACKUP_PATH=/mnt/backup\n# The user that will be owning the backup files\n-BACKUP_USER=squadcal\n+BACKUP_USER=comm\n# The maximum amount of space to spend on Phabricator backups\nMAX_DISK_USAGE_KB=204800 # 200 MiB\n" }, { "change_type": "MODIFY", "old_path": "server/bash/deploy.sh", "new_path": "server/bash/deploy.sh", "diff": "MAX_DISK_USAGE_KB=3145728 # 3 GiB\n# The user that spawns the Node server\n-DAEMON_USER=squadcal\n+DAEMON_USER=comm\n# Input to git clone\nGIT_CLONE_PARAMS=https://github.com/CommE2E/comm.git\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Switch UNIX user from squadcal to comm Test Plan: Test in prod! Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1611
129,187
05.07.2021 16:32:11
14,400
13edd054e8deb53eac3c808d7f1e108df4cbfa6c
[server] Change systemd service from squadcal to comm Test Plan: Test in prod! Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "server/bash/deploy.sh", "new_path": "server/bash/deploy.sh", "diff": "@@ -36,11 +36,11 @@ su $DAEMON_USER -c \"cd server && PORT=3001 timeout 60 bash/run-prod.sh\"\nset -e\n# STEP 3: flip it over\n-systemctl stop squadcal || true\n+systemctl stop comm || true\nrm \"$1\"\nln -s \"$CHECKOUT_PATH\" \"$1\"\nchown -h $DAEMON_USER:$DAEMON_USER \"$1\"\n-systemctl restart squadcal\n+systemctl restart comm\n# STEP 4: clean out old checkouts\ncheckouts=($(ls -dtr \"$1\".*))\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Change systemd service from squadcal to comm Test Plan: Test in prod! Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1612
129,184
05.07.2021 16:51:47
14,400
fb3b3b08b83d81cca758ee711601e172d41c788a
[landing] Reduce font size for legal pages Summary: Reduce font size (at largest and medium breakpoint) for legal pages Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/landing.css", "new_path": "landing/landing.css", "diff": "@@ -157,6 +157,16 @@ div.legal_container {\npadding-left: 60px;\npadding-right: 60px;\n}\n+div.legal_container h1 {\n+ font-size: 42px;\n+}\n+div.legal_container h2 {\n+ font-size: 38px;\n+}\n+div.legal_container p,\n+li {\n+ font-size: 20px;\n+}\ndiv.legal_container a {\ncolor: #7e57c2;\n}\n@@ -198,6 +208,17 @@ div.body_grid > div + .starting_section {\nli {\nfont-size: 20px;\n}\n+ /* ===== LEGAL PAGE STYLING ===== */\n+ div.legal_container h1 {\n+ font-size: 28px;\n+ }\n+ div.legal_container h2 {\n+ font-size: 24px;\n+ }\n+ div.legal_container p,\n+ li {\n+ font-size: 16px;\n+ }\n}\n/* ===== SMALLEST BREAKPOINT ===== */\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Reduce font size for legal pages Summary: Reduce font size (at largest and medium breakpoint) for legal pages Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1613
129,187
05.07.2021 18:21:12
14,400
3ae6b8d8693f06d026532f3b0a2622cc4cf13fcb
[server] Fix personal thread detection code to require actual membership Test Plan: Test in prod! Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "server/src/creators/thread-creator.js", "new_path": "server/src/creators/thread-creator.js", "diff": "@@ -239,8 +239,8 @@ async function createThread(\nINNER JOIN memberships m2\nON m2.thread = t.id AND m2.user = ${otherMemberID}\nWHERE t.type = ${threadTypes.PERSONAL}\n- AND m1.role != -1\n- AND m2.role != -1\n+ AND m1.role > 0\n+ AND m2.role > 0\n`;\n} else if (sourceMessageID) {\nexistingThreadQuery = SQL`\n" }, { "change_type": "MODIFY", "old_path": "server/src/updaters/relationship-updaters.js", "new_path": "server/src/updaters/relationship-updaters.js", "diff": "@@ -272,8 +272,8 @@ async function createPersonalThreads(\nINNER JOIN memberships m2\nON m2.thread = t.id AND m2.user IN (${request.userIDs})\nWHERE t.type = ${threadTypes.PERSONAL}\n- AND m1.role != -1\n- AND m2.role != -1\n+ AND m1.role > 0\n+ AND m2.role > 0\n`;\nconst [personalThreadsResult] = await dbQuery(personalThreadsQuery);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Fix personal thread detection code to require actual membership Test Plan: Test in prod! Reviewers: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1614
129,184
05.07.2021 19:00:09
14,400
ec9f47416fe2d599d1ada432e9e0234e2d03d578
[native] Replace ">" with chevron icon in `ThreadAncestorsLabel` Summary: Before: After: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/components/thread-ancestors-label.react.js", "new_path": "native/components/thread-ancestors-label.react.js", "diff": "// @flow\nimport * as React from 'react';\n+import { Text, View } from 'react-native';\n+import Icon from 'react-native-vector-icons/FontAwesome5';\nimport genesis from 'lib/facts/genesis';\nimport {\n@@ -11,8 +13,7 @@ import { threadIsPending } from 'lib/shared/thread-utils';\nimport { type ThreadInfo } from 'lib/types/thread-types';\nimport { useSelector } from '../redux/redux-utils';\n-import { useStyles } from '../themes/colors';\n-import { SingleLine } from './single-line.react';\n+import { useColors, useStyles } from '../themes/colors';\ntype Props = {|\n+threadInfo: ThreadInfo,\n@@ -21,6 +22,7 @@ type Props = {|\nfunction ThreadAncestorsLabel(props: Props): React.Node {\nconst { unread, threadInfo } = props;\nconst styles = useStyles(unboundStyles);\n+ const colors = useColors();\nconst ancestorThreads: $ReadOnlyArray<ThreadInfo> = useSelector((state) => {\nif (!threadIsPending(threadInfo.id)) {\nreturn ancestorThreadInfos(threadInfo.id)(state).slice(0, -1);\n@@ -29,10 +31,30 @@ function ThreadAncestorsLabel(props: Props): React.Node {\nreturn genesisThreadInfo ? [genesisThreadInfo] : [];\n});\n- const ancestorPath: string = React.useMemo(() => {\n- const path = ancestorThreads.map((each) => each.uiName);\n- return path.join(' > ');\n- }, [ancestorThreads]);\n+ const chevronIcon = React.useMemo(\n+ () => (\n+ <Icon\n+ name=\"chevron-right\"\n+ size={8}\n+ color={colors.listForegroundTertiaryLabel}\n+ />\n+ ),\n+ [colors.listForegroundTertiaryLabel],\n+ );\n+\n+ const ancestorPath = React.useMemo(() => {\n+ const path = [];\n+ for (const thread of ancestorThreads) {\n+ path.push(<Text key={thread.id}>{thread.uiName}</Text>);\n+ path.push(\n+ <View key={`>${thread.id}`} style={styles.chevron}>\n+ {chevronIcon}\n+ </View>,\n+ );\n+ }\n+ path.pop();\n+ return path;\n+ }, [ancestorThreads, chevronIcon, styles.chevron]);\nconst ancestorPathStyle = React.useMemo(() => {\nreturn unread ? [styles.pathText, styles.unread] : styles.pathText;\n@@ -42,7 +64,11 @@ function ThreadAncestorsLabel(props: Props): React.Node {\nreturn null;\n}\n- return <SingleLine style={ancestorPathStyle}>{ancestorPath}</SingleLine>;\n+ return (\n+ <Text numberOfLines={1} style={ancestorPathStyle}>\n+ {ancestorPath}\n+ </Text>\n+ );\n}\nconst unboundStyles = {\n@@ -54,6 +80,9 @@ const unboundStyles = {\nunread: {\ncolor: 'listForegroundLabel',\n},\n+ chevron: {\n+ paddingHorizontal: 3,\n+ },\n};\nexport default ThreadAncestorsLabel;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Replace ">" with chevron icon in `ThreadAncestorsLabel` Summary: Before: https://blob.sh/atul/ancestry-geq-path.png After: https://blob.sh/atul/ancestry-chevron-path.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1615
129,184
07.07.2021 12:14:03
14,400
57c11fea93b60f5e85ef2d1017aa4072490d8055
Update `react-router-dom` libdef Summary: Updated `react-router-dom` libdef because flow was complaining about `useHistory` hook not being exported Test Plan: Flow no longer complains Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "server/flow-typed/npm/react-router-dom_v5.x.x.js", "new_path": "server/flow-typed/npm/react-router-dom_v5.x.x.js", "diff": "-// flow-typed signature: 5c3ecc173e04f53b410aa08d80e28aa2\n-// flow-typed version: cb4e8f3aa2/react-router-dom_v5.x.x/flow_>=v0.98.x <=v0.103.x\n+// flow-typed signature: 2d02538a529a09fdbf202a871fbb5c75\n+// flow-typed version: 5f4b3cb313/react-router-dom_v5.x.x/flow_>=v0.104.x\ndeclare module \"react-router-dom\" {\ndeclare export var BrowserRouter: React$ComponentType<{|\n@@ -18,39 +18,43 @@ declare module \"react-router-dom\" {\n|}>\ndeclare export var Link: React$ComponentType<{\n- className?: string,\n- to: string | LocationShape,\n- replace?: boolean,\n- children?: React$Node\n+ +className?: string,\n+ +to: string | LocationShape,\n+ +replace?: boolean,\n+ +children?: React$Node,\n+ ...\n}>\ndeclare export var NavLink: React$ComponentType<{\n- to: string | LocationShape,\n- activeClassName?: string,\n- className?: string,\n- activeStyle?: { +[string]: mixed },\n- style?: { +[string]: mixed },\n- isActive?: (match: Match, location: Location) => boolean,\n- children?: React$Node,\n- exact?: boolean,\n- strict?: boolean\n+ +to: string | LocationShape,\n+ +activeClassName?: string,\n+ +className?: string,\n+ +activeStyle?: { +[string]: mixed, ... },\n+ +style?: { +[string]: mixed, ... },\n+ +isActive?: (match: Match, location: Location) => boolean,\n+ +children?: React$Node,\n+ +exact?: boolean,\n+ +strict?: boolean,\n+ ...\n}>\n// NOTE: Below are duplicated from react-router. If updating these, please\n// update the react-router and react-router-native types as well.\n- declare export type Location = {\n+ declare export type Location = $ReadOnly<{\npathname: string,\nsearch: string,\nhash: string,\nstate?: any,\n- key?: string\n- };\n+ key?: string,\n+ ...\n+ }>;\ndeclare export type LocationShape = {\npathname?: string,\nsearch?: string,\nhash?: string,\n- state?: any\n+ state?: any,\n+ ...\n};\ndeclare export type HistoryAction = \"PUSH\" | \"REPLACE\" | \"POP\";\n@@ -71,16 +75,15 @@ declare module \"react-router-dom\" {\nblock(\ncallback: string | (location: Location, action: HistoryAction) => ?string\n): () => void,\n- // createMemoryHistory\n- index?: number,\n- entries?: Array<Location>\n+ ...\n};\ndeclare export type Match = {\n- params: { [key: string]: ?string },\n+ params: { [key: string]: ?string, ... },\nisExact: boolean,\npath: string,\n- url: string\n+ url: string,\n+ ...\n};\ndeclare export type ContextRouter = {|\n@@ -94,7 +97,8 @@ declare module \"react-router-dom\" {\nhistory: RouterHistory | void,\nlocation: Location | void,\nmatch: Match | void,\n- staticContext?: StaticRouterContext | void\n+ staticContext?: StaticRouterContext | void,\n+ ...\n};\ndeclare export type GetUserConfirmation = (\n@@ -102,9 +106,7 @@ declare module \"react-router-dom\" {\ncallback: (confirmed: boolean) => void\n) => void;\n- declare export type StaticRouterContext = {\n- url?: string\n- };\n+ declare export type StaticRouterContext = { url?: string, ... };\ndeclare export var StaticRouter: React$ComponentType<{|\nbasename?: string,\n@@ -155,7 +157,7 @@ declare module \"react-router-dom\" {\nlocation?: Location\n|}>\n- declare export function withRouter<Props: {}, Component: React$ComponentType<Props>>(\n+ declare export function withRouter<Props: {...}, Component: React$ComponentType<Props>>(\nWrappedComponent: Component\n): React$ComponentType<$Diff<React$ElementConfig<Component>, ContextRouterVoid>>;\n@@ -163,7 +165,8 @@ declare module \"react-router-dom\" {\npath?: string | string[],\nexact?: boolean,\nsensitive?: boolean,\n- strict?: boolean\n+ strict?: boolean,\n+ ...\n};\ndeclare export function matchPath(\n@@ -172,5 +175,10 @@ declare module \"react-router-dom\" {\nparent?: Match\n): null | Match;\n- declare export function generatePath(pattern?: string, params?: { +[string]: mixed }): string;\n+ declare export function useHistory(): $PropertyType<ContextRouter, 'history'>;\n+ declare export function useLocation(): $PropertyType<ContextRouter, 'location'>;\n+ declare export function useParams(): $PropertyType<$PropertyType<ContextRouter, 'match'>, 'params'>;\n+ declare export function useRouteMatch(path?: MatchPathOptions | string | string[]): $PropertyType<ContextRouter, 'match'>;\n+\n+ declare export function generatePath(pattern?: string, params?: { +[string]: mixed, ... }): string;\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Update `react-router-dom` libdef Summary: Updated `react-router-dom` libdef because flow was complaining about `useHistory` hook not being exported Test Plan: Flow no longer complains Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1616
129,184
07.07.2021 17:06:24
14,400
1da424ccb4ff20c3c2d998f3a20c8ecbe6b094df
Update `react-router` & `react-router-dom` 5.1.2 -> 5.2.0 Test Plan: na Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/package.json", "new_path": "landing/package.json", "diff": "\"lib\": \"0.0.1\",\n\"react\": \"16.13.1\",\n\"react-dom\": \"16.13.1\",\n- \"react-hot-loader\": \"^4.12.14\"\n+ \"react-hot-loader\": \"^4.12.14\",\n+ \"react-router\": \"^5.2.0\",\n+ \"react-router-dom\": \"^5.2.0\"\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "server/package.json", "new_path": "server/package.json", "diff": "\"react-dom\": \"16.13.1\",\n\"react-html-email\": \"^3.0.0\",\n\"react-redux\": \"^7.1.1\",\n- \"react-router\": \"^5.1.2\",\n+ \"react-router\": \"^5.2.0\",\n\"redis\": \"^3.1.1\",\n\"redux\": \"^4.0.4\",\n\"replacestream\": \"^4.0.3\",\n" }, { "change_type": "MODIFY", "old_path": "web/package.json", "new_path": "web/package.json", "diff": "\"react-feather\": \"^2.0.3\",\n\"react-hot-loader\": \"^4.12.14\",\n\"react-redux\": \"^7.1.1\",\n- \"react-router\": \"^5.1.2\",\n- \"react-router-dom\": \"^5.1.2\",\n+ \"react-router\": \"^5.2.0\",\n+ \"react-router-dom\": \"^5.2.0\",\n\"react-switch\": \"^5.0.1\",\n\"react-timeago\": \"^4.4.0\",\n\"redux\": \"^4.0.4\",\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "core-js-pure \"^3.0.0\"\nregenerator-runtime \"^0.13.4\"\n-\"@babel/runtime@^7.0.0\", \"@babel/runtime@^7.1.2\", \"@babel/runtime@^7.4.0\", \"@babel/runtime@^7.5.5\", \"@babel/runtime@^7.8.4\", \"@babel/runtime@^7.8.7\":\n+\"@babel/runtime@^7.0.0\", \"@babel/runtime@^7.1.2\", \"@babel/runtime@^7.5.5\", \"@babel/runtime@^7.8.4\", \"@babel/runtime@^7.8.7\":\nversion \"7.11.2\"\nresolved \"https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.11.2.tgz#f549c13c754cc40b87644b9fa9f09a6a95fe0736\"\nintegrity sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==\ndependencies:\nregenerator-runtime \"^0.13.4\"\n+\"@babel/runtime@^7.12.1\":\n+ version \"7.14.6\"\n+ resolved \"https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.6.tgz#535203bc0892efc7dec60bdc27b2ecf6e409062d\"\n+ integrity sha512-/PCB2uJ7oM44tz8YhC4Z/6PeOKXp4K588f+5M3clr1M4zbqztlo0XEfJ2LEzj/FgwfgGcIdl8n7YYjTCI0BYwg==\n+ dependencies:\n+ regenerator-runtime \"^0.13.4\"\n+\n\"@babel/runtime@^7.13.10\":\nversion \"7.13.10\"\nresolved \"https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.10.tgz#47d42a57b6095f4468da440388fdbad8bebf0d7d\"\n@@ -8852,11 +8859,6 @@ gtoken@^5.0.0:\njws \"^4.0.0\"\nmime \"^2.2.0\"\n-gud@^1.0.0:\n- version \"1.0.0\"\n- resolved \"https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0\"\n- integrity sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw==\n-\nhandle-thing@^2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.0.tgz#0e039695ff50c93fc288557d696f3c1dc6776754\"\n@@ -12267,14 +12269,13 @@ min-document@^2.19.0:\ndependencies:\ndom-walk \"^0.1.0\"\n-mini-create-react-context@^0.3.0:\n- version \"0.3.2\"\n- resolved \"https://registry.yarnpkg.com/mini-create-react-context/-/mini-create-react-context-0.3.2.tgz#79fc598f283dd623da8e088b05db8cddab250189\"\n- integrity sha512-2v+OeetEyliMt5VHMXsBhABoJ0/M4RCe7fatd/fBy6SMiKazUSEt3gxxypfnk2SHMkdBYvorHRoQxuGoiwbzAw==\n+mini-create-react-context@^0.4.0:\n+ version \"0.4.1\"\n+ resolved \"https://registry.yarnpkg.com/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz#072171561bfdc922da08a60c2197a497cc2d1d5e\"\n+ integrity sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==\ndependencies:\n- \"@babel/runtime\" \"^7.4.0\"\n- gud \"^1.0.0\"\n- tiny-warning \"^1.0.2\"\n+ \"@babel/runtime\" \"^7.12.1\"\n+ tiny-warning \"^1.0.3\"\nmini-css-extract-plugin@^0.11.2:\nversion \"0.11.2\"\n@@ -14845,29 +14846,29 @@ react-refresh@^0.4.0:\nresolved \"https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.4.2.tgz#54a277a6caaac2803d88f1d6f13c1dcfbd81e334\"\nintegrity sha512-kv5QlFFSZWo7OlJFNYbxRtY66JImuP2LcrFgyJfQaf85gSP+byzG21UbDQEYjU7f//ny8rwiEkO6py2Y+fEgAQ==\n-react-router-dom@^5.1.2:\n- version \"5.1.2\"\n- resolved \"https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.1.2.tgz#06701b834352f44d37fbb6311f870f84c76b9c18\"\n- integrity sha512-7BPHAaIwWpZS074UKaw1FjVdZBSVWEk8IuDXdB+OkLb8vd/WRQIpA4ag9WQk61aEfQs47wHyjWUoUGGZxpQXew==\n+react-router-dom@^5.2.0:\n+ version \"5.2.0\"\n+ resolved \"https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.2.0.tgz#9e65a4d0c45e13289e66c7b17c7e175d0ea15662\"\n+ integrity sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==\ndependencies:\n\"@babel/runtime\" \"^7.1.2\"\nhistory \"^4.9.0\"\nloose-envify \"^1.3.1\"\nprop-types \"^15.6.2\"\n- react-router \"5.1.2\"\n+ react-router \"5.2.0\"\ntiny-invariant \"^1.0.2\"\ntiny-warning \"^1.0.0\"\n-react-router@5.1.2, react-router@^5.1.2:\n- version \"5.1.2\"\n- resolved \"https://registry.yarnpkg.com/react-router/-/react-router-5.1.2.tgz#6ea51d789cb36a6be1ba5f7c0d48dd9e817d3418\"\n- integrity sha512-yjEuMFy1ONK246B+rsa0cUam5OeAQ8pyclRDgpxuSCrAlJ1qN9uZ5IgyKC7gQg0w8OM50NXHEegPh/ks9YuR2A==\n+react-router@5.2.0, react-router@^5.2.0:\n+ version \"5.2.0\"\n+ resolved \"https://registry.yarnpkg.com/react-router/-/react-router-5.2.0.tgz#424e75641ca8747fbf76e5ecca69781aa37ea293\"\n+ integrity sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==\ndependencies:\n\"@babel/runtime\" \"^7.1.2\"\nhistory \"^4.9.0\"\nhoist-non-react-statics \"^3.1.0\"\nloose-envify \"^1.3.1\"\n- mini-create-react-context \"^0.3.0\"\n+ mini-create-react-context \"^0.4.0\"\npath-to-regexp \"^1.7.0\"\nprop-types \"^15.6.2\"\nreact-is \"^16.6.0\"\n@@ -17140,7 +17141,7 @@ tiny-invariant@^1.0.2:\nresolved \"https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.0.6.tgz#b3f9b38835e36a41c843a3b0907a5a7b3755de73\"\nintegrity sha512-FOyLWWVjG+aC0UqG76V53yAWdXfH8bO6FNmyZOuUrzDzK8DI3/JRY25UD7+g49JWM1LXwymsKERB+DzI0dTEQA==\n-tiny-warning@^1.0.0, tiny-warning@^1.0.2:\n+tiny-warning@^1.0.0, tiny-warning@^1.0.3:\nversion \"1.0.3\"\nresolved \"https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754\"\nintegrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Update `react-router` & `react-router-dom` 5.1.2 -> 5.2.0 Test Plan: na Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1617
129,184
07.07.2021 17:11:20
14,400
65a221e3ad4a96204e5da692d65e433c38439acf
[landing] Introduce `landing-ssr` and make it the server entry point Summary: Introduce `LandingSSR` component and modify NodeServerRendering entry point to address issue where `Landing` wasn't getting `RouterContext` from `StaticRouter` Test Plan: Able to use `useLocation` hook, `useHistory` hook, etc Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "ADD", "old_path": null, "new_path": "landing/landing-ssr.react.js", "diff": "+// @flow\n+\n+import * as React from 'react';\n+import { StaticRouter } from 'react-router';\n+\n+import Landing from './landing.react';\n+\n+export type Props = {|\n+ +url: string,\n+|};\n+function LandingSSR(props: Props): React.Node {\n+ const { url } = props;\n+ const routerContext = React.useMemo(() => ({}), []);\n+ return (\n+ <StaticRouter\n+ location={url}\n+ basename=\"/commlanding\"\n+ context={routerContext}\n+ >\n+ <Landing url={url} />\n+ </StaticRouter>\n+ );\n+}\n+\n+export default LandingSSR;\n" }, { "change_type": "MODIFY", "old_path": "landing/root.js", "new_path": "landing/root.js", "diff": "import * as React from 'react';\nimport { hot } from 'react-hot-loader/root';\n+import { BrowserRouter } from 'react-router-dom';\nimport Landing from './landing.react';\nfunction RootComponent() {\n- const currentURL = window.location.href;\n- return <Landing url={currentURL} />;\n+ return (\n+ <BrowserRouter basename=\"/commlanding\">\n+ <Landing url={window.location.href} />\n+ </BrowserRouter>\n+ );\n}\nconst HotReloadingRootComponent: React.ComponentType<{||}> = hot(RootComponent);\n" }, { "change_type": "MODIFY", "old_path": "landing/webpack.config.cjs", "new_path": "landing/webpack.config.cjs", "diff": "@@ -52,7 +52,7 @@ const baseProdBrowserConfig = {\nconst baseNodeServerRenderingConfig = {\nexternals: ['react', 'react-dom', 'react-redux'],\nentry: {\n- server: ['./landing.react.js'],\n+ server: ['./landing-ssr.react.js'],\n},\noutput: {\nfilename: 'landing.build.cjs',\n@@ -63,7 +63,8 @@ const baseNodeServerRenderingConfig = {\n};\nmodule.exports = function (env) {\n- const browserConfig = env === 'prod'\n+ const browserConfig =\n+ env === 'prod'\n? createProdBrowserConfig(baseProdBrowserConfig, babelConfig)\n: createDevBrowserConfig(baseDevBrowserConfig, babelConfig);\nconst nodeConfig = createNodeServerRenderingConfig(\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Introduce `landing-ssr` and make it the server entry point Summary: Introduce `LandingSSR` component and modify NodeServerRendering entry point to address issue where `Landing` wasn't getting `RouterContext` from `StaticRouter` Test Plan: Able to use `useLocation` hook, `useHistory` hook, etc Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1618
129,184
07.07.2021 17:41:04
14,400
af91e1e1c4164ccde461ac058ddc5cf3fd3d291e
[landing] Use `Switch`, `Route`, and `Link` in `landing` Summary: Replace `activePage` state for "navigating" between components with `react-router` Switch, Route, and Link components Test Plan: Able to navigate between pages (typing out url, clicking links, browser forward/back) as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/landing.react.js", "new_path": "landing/landing.react.js", "diff": "// @flow\nimport * as React from 'react';\n+import { Switch, Route, Link, useLocation } from 'react-router-dom';\nimport Home from './home.react';\nimport css from './landing.css';\n@@ -9,69 +10,41 @@ import SubscriptionForm from './subscription-form.react';\nimport Support from './support.react';\nimport Terms from './terms.react';\n-const validEndpoints = new Set(['privacy', 'terms', 'support']);\n-\nexport type LandingProps = {|\n+url: string,\n|};\nfunction Landing(props: LandingProps): React.Node {\n- const { url } = props;\n- const lastUrlElement = url.split('/').pop();\n-\n- let initialPage = 'home';\n- if (validEndpoints.has(lastUrlElement)) {\n- initialPage = lastUrlElement;\n- }\n-\n- const [activePage, setActivePage] = React.useState(initialPage);\n- const navigateToHome = React.useCallback(() => setActivePage('home'), []);\n- const navigateToTerms = React.useCallback(() => setActivePage('terms'), []);\n- const navigateToPrivacy = React.useCallback(\n- () => setActivePage('privacy'),\n- [],\n- );\n- const navigateToSupport = React.useCallback(\n- () => setActivePage('support'),\n- [],\n- );\n+ const { url } = props; // eslint-disable-line\n- let visibleNode;\n- if (activePage === 'home') {\n- visibleNode = <Home />;\n- } else if (activePage === 'terms') {\n- visibleNode = <Terms />;\n- } else if (activePage === 'privacy') {\n- visibleNode = <Privacy />;\n- } else if (activePage === 'support') {\n- visibleNode = <Support />;\n- }\n+ const { pathname } = useLocation();\n+ React.useEffect(() => {\n+ window?.scrollTo(0, 0);\n+ }, [pathname]);\nreturn (\n<>\n<div className={css.header_grid}>\n- <a href=\"#\" onClick={navigateToHome}>\n+ <Link to=\"/\">\n<h1 className={css.logo}>Comm</h1>\n- </a>\n+ </Link>\n</div>\n- {visibleNode}\n+\n+ <Switch>\n+ <Route path=\"/support\" component={Support} />\n+ <Route path=\"/terms\" component={Terms} />\n+ <Route path=\"/privacy\" component={Privacy} />\n+ <Route path=\"/\" component={Home} />\n+ </Switch>\n+\n<div className={css.footer_blur}>\n<div className={css.footer_grid}>\n<div className={css.sitemap}>\n<div className={css.footer_logo}>\n- <a href=\"#\" onClick={navigateToHome}>\n- Comm\n- </a>\n+ <Link to=\"/\">Comm</Link>\n</div>\n-\n- <a href=\"#\" onClick={navigateToSupport}>\n- Support\n- </a>\n- <a href=\"#\" onClick={navigateToTerms}>\n- Terms of Use\n- </a>\n- <a href=\"#\" onClick={navigateToPrivacy}>\n- Privacy Policy\n- </a>\n+ <Link to=\"/support\">Support</Link>\n+ <Link to=\"/terms\">Terms of Use</Link>\n+ <Link to=\"/privacy\">Privacy Policy</Link>\n<a href=\"https://www.notion.so/How-Comm-works-d6217941db7c4237b9d08b427aef3234\">\nHow Comm works\n</a>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Use `Switch`, `Route`, and `Link` in `landing` Summary: Replace `activePage` state for "navigating" between components with `react-router` Switch, Route, and Link components Test Plan: Able to navigate between pages (typing out url, clicking links, browser forward/back) as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1619
129,184
07.07.2021 17:48:19
14,400
73a30f5a1eab6d8517c914326115b0529888c3a7
[landing] Remove `url` prop from `landing` Summary: We no longer need `url` prop for `landing` component. However, we still need it for the `LandingSSR` component to give to the StaticRouter Test Plan: Continues to work as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/landing-ssr.react.js", "new_path": "landing/landing-ssr.react.js", "diff": "@@ -5,10 +5,10 @@ import { StaticRouter } from 'react-router';\nimport Landing from './landing.react';\n-export type Props = {|\n+export type LandingSSRProps = {|\n+url: string,\n|};\n-function LandingSSR(props: Props): React.Node {\n+function LandingSSR(props: LandingSSRProps): React.Node {\nconst { url } = props;\nconst routerContext = React.useMemo(() => ({}), []);\nreturn (\n@@ -17,7 +17,7 @@ function LandingSSR(props: Props): React.Node {\nbasename=\"/commlanding\"\ncontext={routerContext}\n>\n- <Landing url={url} />\n+ <Landing />\n</StaticRouter>\n);\n}\n" }, { "change_type": "MODIFY", "old_path": "landing/landing.react.js", "new_path": "landing/landing.react.js", "diff": "@@ -10,12 +10,7 @@ import SubscriptionForm from './subscription-form.react';\nimport Support from './support.react';\nimport Terms from './terms.react';\n-export type LandingProps = {|\n- +url: string,\n-|};\n-function Landing(props: LandingProps): React.Node {\n- const { url } = props; // eslint-disable-line\n-\n+function Landing(): React.Node {\nconst { pathname } = useLocation();\nReact.useEffect(() => {\nwindow?.scrollTo(0, 0);\n" }, { "change_type": "MODIFY", "old_path": "landing/root.js", "new_path": "landing/root.js", "diff": "@@ -9,7 +9,7 @@ import Landing from './landing.react';\nfunction RootComponent() {\nreturn (\n<BrowserRouter basename=\"/commlanding\">\n- <Landing url={window.location.href} />\n+ <Landing />\n</BrowserRouter>\n);\n}\n" }, { "change_type": "MODIFY", "old_path": "server/src/responders/landing-handler.js", "new_path": "server/src/responders/landing-handler.js", "diff": "@@ -7,7 +7,7 @@ import * as React from 'react';\nimport ReactDOMServer from 'react-dom/server';\nimport { promisify } from 'util';\n-import { type LandingProps } from '../landing/landing.react';\n+import { type LandingSSRProps } from '../landing/landing-ssr.react';\nimport { waitForStream } from '../utils/json-stream';\nimport { getLandingURLFacts } from '../utils/urls';\nimport { getMessageForException } from './utils';\n@@ -67,7 +67,7 @@ async function getAssetInfo() {\nreturn assetInfo;\n}\n-type LandingApp = React.ComponentType<LandingProps>;\n+type LandingApp = React.ComponentType<LandingSSRProps>;\nlet webpackCompiledRootComponent: ?LandingApp = null;\nasync function getWebpackCompiledRootComponentForSSR() {\nif (webpackCompiledRootComponent) {\n@@ -90,7 +90,7 @@ const { basePath } = getLandingURLFacts();\nconst { renderToNodeStream } = ReactDOMServer;\nasync function landingResponder(req: $Request, res: $Response) {\n- const [{ jsURL, fontsURL, cssInclude }, Landing] = await Promise.all([\n+ const [{ jsURL, fontsURL, cssInclude }, LandingSSR] = await Promise.all([\ngetAssetInfo(),\ngetWebpackCompiledRootComponentForSSR(),\n]);\n@@ -128,7 +128,7 @@ async function landingResponder(req: $Request, res: $Response) {\n<div id=\"react-root\">\n`);\n- const reactStream = renderToNodeStream(<Landing url={req.url} />);\n+ const reactStream = renderToNodeStream(<LandingSSR url={req.url} />);\nreactStream.pipe(res, { end: false });\nawait waitForStream(reactStream);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Remove `url` prop from `landing` Summary: We no longer need `url` prop for `landing` component. However, we still need it for the `LandingSSR` component to give to the StaticRouter Test Plan: Continues to work as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1620
129,184
07.07.2021 18:28:08
14,400
580019c92f9ec1b67ea4eac380320c5c976e2b25
[landing] Conditionally select router `basename` based on env Summary: Conditionally select router `basename` based on env Test Plan: hrefs match up Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/landing-ssr.react.js", "new_path": "landing/landing-ssr.react.js", "diff": "@@ -7,16 +7,13 @@ import Landing from './landing.react';\nexport type LandingSSRProps = {|\n+url: string,\n+ +basename: string,\n|};\nfunction LandingSSR(props: LandingSSRProps): React.Node {\n- const { url } = props;\n+ const { url, basename } = props;\nconst routerContext = React.useMemo(() => ({}), []);\nreturn (\n- <StaticRouter\n- location={url}\n- basename=\"/commlanding\"\n- context={routerContext}\n- >\n+ <StaticRouter location={url} basename={basename} context={routerContext}>\n<Landing />\n</StaticRouter>\n);\n" }, { "change_type": "MODIFY", "old_path": "landing/root.js", "new_path": "landing/root.js", "diff": "@@ -6,9 +6,11 @@ import { BrowserRouter } from 'react-router-dom';\nimport Landing from './landing.react';\n+declare var routerBasename: string;\n+\nfunction RootComponent() {\nreturn (\n- <BrowserRouter basename=\"/commlanding\">\n+ <BrowserRouter basename={routerBasename}>\n<Landing />\n</BrowserRouter>\n);\n" }, { "change_type": "MODIFY", "old_path": "landing/webpack.config.cjs", "new_path": "landing/webpack.config.cjs", "diff": "@@ -73,7 +73,7 @@ module.exports = function (env) {\n);\nconst nodeServerRenderingConfig = {\n...nodeConfig,\n- mode: env === 'dev' ? 'development' : 'production',\n+ mode: env === 'prod' ? 'production' : 'development',\n};\nreturn [browserConfig, nodeServerRenderingConfig];\n};\n" }, { "change_type": "MODIFY", "old_path": "server/src/responders/landing-handler.js", "new_path": "server/src/responders/landing-handler.js", "diff": "@@ -128,12 +128,17 @@ async function landingResponder(req: $Request, res: $Response) {\n<div id=\"react-root\">\n`);\n- const reactStream = renderToNodeStream(<LandingSSR url={req.url} />);\n+ // We remove trailing slash for `react-router`\n+ const routerBasename = basePath.replace(/\\/$/, '');\n+ const reactStream = renderToNodeStream(\n+ <LandingSSR url={req.url} basename={routerBasename} />,\n+ );\nreactStream.pipe(res, { end: false });\nawait waitForStream(reactStream);\n// prettier-ignore\nres.end(html`</div>\n+ <script>var routerBasename = \"${routerBasename}\";</script>\n<script src=\"${jsURL}\"></script>\n</body>\n</html>\n" }, { "change_type": "MODIFY", "old_path": "web/webpack.config.cjs", "new_path": "web/webpack.config.cjs", "diff": "@@ -63,7 +63,8 @@ const baseNodeServerRenderingConfig = {\n};\nmodule.exports = function (env) {\n- const browserConfig = env === 'prod'\n+ const browserConfig =\n+ env === 'prod'\n? createProdBrowserConfig(baseProdBrowserConfig, babelConfig)\n: createDevBrowserConfig(baseDevBrowserConfig, babelConfig);\nconst nodeConfig = createNodeServerRenderingConfig(\n@@ -72,7 +73,7 @@ module.exports = function (env) {\n);\nconst nodeServerRenderingConfig = {\n...nodeConfig,\n- mode: env === 'dev' ? 'development' : 'production',\n+ mode: env === 'prod' ? 'production' : 'development',\n};\nreturn [browserConfig, nodeServerRenderingConfig];\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Conditionally select router `basename` based on env Summary: Conditionally select router `basename` based on env Test Plan: hrefs match up Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1621
129,184
08.07.2021 16:38:02
14,400
ab7f21bef691114652894699cbe3c7463452f9f5
[native] Update `AppsDirectory` icons Summary: Update `AppsDirectory` with SWMansionIcon Here's how it looks: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/apps/app-listing.react.js", "new_path": "native/apps/app-listing.react.js", "diff": "import * as React from 'react';\nimport { View, Text, TouchableOpacity } from 'react-native';\n-import Icon from 'react-native-vector-icons/FontAwesome';\nimport { useDispatch } from 'react-redux';\nimport {\n@@ -11,6 +10,7 @@ import {\n} from 'lib/reducers/enabled-apps-reducer';\nimport type { SupportedApps } from 'lib/types/enabled-apps';\n+import SWMansionIcon from '../components/swmansion-icon.react';\nimport { useStyles } from '../themes/colors';\ntype Props = {|\n@@ -18,7 +18,7 @@ type Props = {|\n+available: boolean,\n+enabled: boolean,\n+appName: string,\n- +appIcon: 'calendar' | 'book' | 'tasks' | 'folder',\n+ +appIcon: 'calendar' | 'document-filled' | 'check-round' | 'package',\n+appCopy: string,\n|};\nfunction AppListing(props: Props) {\n@@ -42,7 +42,10 @@ function AppListing(props: Props) {\nif (available) {\ncallToAction = (\n<TouchableOpacity onPress={enabled ? disableApp : enableApp}>\n- <Icon name={enabled ? 'check' : 'plus'} style={styles.plusIcon} />\n+ <SWMansionIcon\n+ name={enabled ? 'check-circle' : 'plus-circle'}\n+ style={styles.plusIcon}\n+ />\n</TouchableOpacity>\n);\n} else {\n@@ -52,7 +55,10 @@ function AppListing(props: Props) {\nreturn (\n<View style={styles.cell}>\n<View style={styles.appContent}>\n- <Icon name={appIcon} style={[styles.appIcon, { color: textColor }]} />\n+ <SWMansionIcon\n+ name={appIcon}\n+ style={[styles.appIcon, { color: textColor }]}\n+ />\n<View>\n<Text style={[styles.appName, { color: textColor }]}>{appName}</Text>\n<Text style={[styles.appCopy, { color: textColor }]}>{appCopy}</Text>\n@@ -75,11 +81,11 @@ const unboundStyles = {\nalignItems: 'center',\n},\nappIcon: {\n- fontSize: 28,\n+ fontSize: 36,\npaddingRight: 18,\n},\nplusIcon: {\n- fontSize: 20,\n+ fontSize: 24,\ncolor: 'white',\n},\nappName: {\n" }, { "change_type": "MODIFY", "old_path": "native/apps/apps-directory.react.js", "new_path": "native/apps/apps-directory.react.js", "diff": "@@ -15,28 +15,28 @@ const APP_DIRECTORY_DATA = [\navailable: true,\nappName: 'Calendar',\nappIcon: 'calendar',\n- appCopy: 'Shared calendar for you and your community',\n+ appCopy: 'Shared calendar for your community',\n},\n{\nid: 'wiki',\navailable: false,\nappName: 'Wiki',\n- appIcon: 'book',\n- appCopy: 'Connect your community mail account',\n+ appIcon: 'document-filled',\n+ appCopy: 'Shared wiki for your community',\n},\n{\nid: 'tasks',\navailable: false,\nappName: 'Tasks',\n- appIcon: 'tasks',\n- appCopy: 'Shared tasks for you and your community',\n+ appIcon: 'check-round',\n+ appCopy: 'Shared tasks for your community',\n},\n{\nid: 'files',\navailable: false,\nappName: 'Files',\n- appIcon: 'folder',\n- appCopy: 'Shared files for you and your community',\n+ appIcon: 'package',\n+ appCopy: 'Shared files for your community',\n},\n];\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Update `AppsDirectory` icons Summary: Update `AppsDirectory` with SWMansionIcon Here's how it looks: https://blob.sh/atul/56aa.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1642
129,184
08.07.2021 17:05:22
14,400
0f43e1dc8df1cc9e8da63068d0e5ac4589549bad
[native] Use `SWMansionIcon` for `ComposeThreadButton` Summary: Here's how it looks: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/compose-thread-button.react.js", "new_path": "native/chat/compose-thread-button.react.js", "diff": "import * as React from 'react';\nimport { StyleSheet } from 'react-native';\n-import Icon from 'react-native-vector-icons/MaterialCommunityIcons';\nimport { createPendingThread } from 'lib/shared/thread-utils';\nimport { threadTypes } from 'lib/types/thread-types';\nimport Button from '../components/button.react';\n+import SWMansionIcon from '../components/swmansion-icon.react';\nimport { MessageListRouteName } from '../navigation/route-names';\nimport { useSelector } from '../redux/redux-utils';\nimport { type Colors, useColors } from '../themes/colors';\n@@ -26,8 +26,8 @@ class ComposeThreadButton extends React.PureComponent<Props> {\nconst { link: linkColor } = this.props.colors;\nreturn (\n<Button onPress={this.onPress} androidBorderlessRipple={true}>\n- <Icon\n- name=\"pencil-plus-outline\"\n+ <SWMansionIcon\n+ name=\"edit-4\"\nsize={26}\nstyle={styles.composeButton}\ncolor={linkColor}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use `SWMansionIcon` for `ComposeThreadButton` Summary: Here's how it looks: https://blob.sh/atul/0cdf.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1643
129,187
08.07.2021 18:10:39
14,400
ab6f411779b2b4d173f76d2eaa538e493bf3a5df
Update all react-router libdefs Summary: We should keep all of these in sync Test Plan: Flow Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "ADD", "old_path": null, "new_path": "landing/flow-typed/npm/react-router-dom_v5.x.x.js", "diff": "+// flow-typed signature: 2d02538a529a09fdbf202a871fbb5c75\n+// flow-typed version: 5f4b3cb313/react-router-dom_v5.x.x/flow_>=v0.104.x\n+\n+declare module \"react-router-dom\" {\n+ declare export var BrowserRouter: React$ComponentType<{|\n+ basename?: string,\n+ forceRefresh?: boolean,\n+ getUserConfirmation?: GetUserConfirmation,\n+ keyLength?: number,\n+ children?: React$Node\n+ |}>\n+\n+ declare export var HashRouter: React$ComponentType<{|\n+ basename?: string,\n+ getUserConfirmation?: GetUserConfirmation,\n+ hashType?: \"slash\" | \"noslash\" | \"hashbang\",\n+ children?: React$Node\n+ |}>\n+\n+ declare export var Link: React$ComponentType<{\n+ +className?: string,\n+ +to: string | LocationShape,\n+ +replace?: boolean,\n+ +children?: React$Node,\n+ ...\n+ }>\n+\n+ declare export var NavLink: React$ComponentType<{\n+ +to: string | LocationShape,\n+ +activeClassName?: string,\n+ +className?: string,\n+ +activeStyle?: { +[string]: mixed, ... },\n+ +style?: { +[string]: mixed, ... },\n+ +isActive?: (match: Match, location: Location) => boolean,\n+ +children?: React$Node,\n+ +exact?: boolean,\n+ +strict?: boolean,\n+ ...\n+ }>\n+\n+ // NOTE: Below are duplicated from react-router. If updating these, please\n+ // update the react-router and react-router-native types as well.\n+ declare export type Location = $ReadOnly<{\n+ pathname: string,\n+ search: string,\n+ hash: string,\n+ state?: any,\n+ key?: string,\n+ ...\n+ }>;\n+\n+ declare export type LocationShape = {\n+ pathname?: string,\n+ search?: string,\n+ hash?: string,\n+ state?: any,\n+ ...\n+ };\n+\n+ declare export type HistoryAction = \"PUSH\" | \"REPLACE\" | \"POP\";\n+\n+ declare export type RouterHistory = {\n+ length: number,\n+ location: Location,\n+ action: HistoryAction,\n+ listen(\n+ callback: (location: Location, action: HistoryAction) => void\n+ ): () => void,\n+ push(path: string | LocationShape, state?: any): void,\n+ replace(path: string | LocationShape, state?: any): void,\n+ go(n: number): void,\n+ goBack(): void,\n+ goForward(): void,\n+ canGo?: (n: number) => boolean,\n+ block(\n+ callback: string | (location: Location, action: HistoryAction) => ?string\n+ ): () => void,\n+ ...\n+ };\n+\n+ declare export type Match = {\n+ params: { [key: string]: ?string, ... },\n+ isExact: boolean,\n+ path: string,\n+ url: string,\n+ ...\n+ };\n+\n+ declare export type ContextRouter = {|\n+ history: RouterHistory,\n+ location: Location,\n+ match: Match,\n+ staticContext?: StaticRouterContext\n+ |};\n+\n+ declare type ContextRouterVoid = {\n+ history: RouterHistory | void,\n+ location: Location | void,\n+ match: Match | void,\n+ staticContext?: StaticRouterContext | void,\n+ ...\n+ };\n+\n+ declare export type GetUserConfirmation = (\n+ message: string,\n+ callback: (confirmed: boolean) => void\n+ ) => void;\n+\n+ declare export type StaticRouterContext = { url?: string, ... };\n+\n+ declare export var StaticRouter: React$ComponentType<{|\n+ basename?: string,\n+ location?: string | Location,\n+ context: StaticRouterContext,\n+ children?: React$Node\n+ |}>\n+\n+ declare export var MemoryRouter: React$ComponentType<{|\n+ initialEntries?: Array<LocationShape | string>,\n+ initialIndex?: number,\n+ getUserConfirmation?: GetUserConfirmation,\n+ keyLength?: number,\n+ children?: React$Node\n+ |}>\n+\n+ declare export var Router: React$ComponentType<{|\n+ history: RouterHistory,\n+ children?: React$Node\n+ |}>\n+\n+ declare export var Prompt: React$ComponentType<{|\n+ message: string | ((location: Location) => string | boolean),\n+ when?: boolean\n+ |}>\n+\n+ declare export var Redirect: React$ComponentType<{|\n+ to: string | LocationShape,\n+ push?: boolean,\n+ from?: string,\n+ exact?: boolean,\n+ strict?: boolean\n+ |}>\n+\n+ declare export var Route: React$ComponentType<{|\n+ component?: React$ComponentType<*>,\n+ render?: (router: ContextRouter) => React$Node,\n+ children?: React$ComponentType<ContextRouter> | React$Node,\n+ path?: string | Array<string>,\n+ exact?: boolean,\n+ strict?: boolean,\n+ location?: LocationShape,\n+ sensitive?: boolean\n+ |}>\n+\n+ declare export var Switch: React$ComponentType<{|\n+ children?: React$Node,\n+ location?: Location\n+ |}>\n+\n+ declare export function withRouter<Props: {...}, Component: React$ComponentType<Props>>(\n+ WrappedComponent: Component\n+ ): React$ComponentType<$Diff<React$ElementConfig<Component>, ContextRouterVoid>>;\n+\n+ declare type MatchPathOptions = {\n+ path?: string | string[],\n+ exact?: boolean,\n+ sensitive?: boolean,\n+ strict?: boolean,\n+ ...\n+ };\n+\n+ declare export function matchPath(\n+ pathname: string,\n+ options?: MatchPathOptions | string | string[],\n+ parent?: Match\n+ ): null | Match;\n+\n+ declare export function useHistory(): $PropertyType<ContextRouter, 'history'>;\n+ declare export function useLocation(): $PropertyType<ContextRouter, 'location'>;\n+ declare export function useParams(): $PropertyType<$PropertyType<ContextRouter, 'match'>, 'params'>;\n+ declare export function useRouteMatch(path?: MatchPathOptions | string | string[]): $PropertyType<ContextRouter, 'match'>;\n+\n+ declare export function generatePath(pattern?: string, params?: { +[string]: mixed, ... }): string;\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "landing/flow-typed/npm/react-router_v5.x.x.js", "diff": "+// flow-typed signature: 7a910df5fd688ad6d23c9ceaa43bf1ea\n+// flow-typed version: 5f4b3cb313/react-router_v5.x.x/flow_>=v0.104.x\n+\n+declare module \"react-router\" {\n+ // NOTE: many of these are re-exported by react-router-dom and\n+ // react-router-native, so when making changes, please be sure to update those\n+ // as well.\n+ declare export type Location = $ReadOnly<{\n+ pathname: string,\n+ search: string,\n+ hash: string,\n+ state?: any,\n+ key?: string,\n+ ...\n+ }>;\n+\n+ declare export type LocationShape = {\n+ pathname?: string,\n+ search?: string,\n+ hash?: string,\n+ state?: any,\n+ ...\n+ };\n+\n+ declare export type HistoryAction = \"PUSH\" | \"REPLACE\" | \"POP\";\n+\n+ declare export type RouterHistory = {\n+ length: number,\n+ location: Location,\n+ action: HistoryAction,\n+ listen(\n+ callback: (location: Location, action: HistoryAction) => void\n+ ): () => void,\n+ push(path: string | LocationShape, state?: any): void,\n+ replace(path: string | LocationShape, state?: any): void,\n+ go(n: number): void,\n+ goBack(): void,\n+ goForward(): void,\n+ canGo?: (n: number) => boolean,\n+ block(\n+ callback: string | (location: Location, action: HistoryAction) => ?string\n+ ): () => void,\n+ ...\n+ };\n+\n+ declare export type Match = {\n+ params: { [key: string]: ?string, ... },\n+ isExact: boolean,\n+ path: string,\n+ url: string,\n+ ...\n+ };\n+\n+ declare export type ContextRouter = {|\n+ history: RouterHistory,\n+ location: Location,\n+ match: Match,\n+ staticContext?: StaticRouterContext\n+ |};\n+\n+ declare export type GetUserConfirmation = (\n+ message: string,\n+ callback: (confirmed: boolean) => void\n+ ) => void;\n+\n+ declare type StaticRouterContext = { url?: string, ... };\n+\n+ declare export class StaticRouter extends React$Component<{\n+ basename?: string,\n+ location?: string | Location,\n+ context: StaticRouterContext,\n+ children?: React$Node,\n+ ...\n+ }> {}\n+\n+ declare export class MemoryRouter extends React$Component<{\n+ initialEntries?: Array<LocationShape | string>,\n+ initialIndex?: number,\n+ getUserConfirmation?: GetUserConfirmation,\n+ keyLength?: number,\n+ children?: React$Node,\n+ ...\n+ }> {}\n+\n+ declare export class Router extends React$Component<{\n+ history: RouterHistory,\n+ children?: React$Node,\n+ ...\n+ }> {}\n+\n+ declare export class Prompt extends React$Component<{\n+ message: string | ((location: Location) => string | true),\n+ when?: boolean,\n+ ...\n+ }> {}\n+\n+ declare export class Redirect extends React$Component<{|\n+ to: string | LocationShape,\n+ push?: boolean,\n+ from?: string,\n+ exact?: boolean,\n+ strict?: boolean\n+ |}> {}\n+\n+\n+ declare export class Route extends React$Component<{|\n+ component?: React$ComponentType<*>,\n+ render?: (router: ContextRouter) => React$Node,\n+ children?: React$ComponentType<ContextRouter> | React$Node,\n+ path?: string | Array<string>,\n+ exact?: boolean,\n+ strict?: boolean,\n+ location?: LocationShape,\n+ sensitive?: boolean\n+ |}> {}\n+\n+ declare export class Switch extends React$Component<{|\n+ children?: React$Node,\n+ location?: Location\n+ |}> {}\n+\n+ declare export function withRouter<P>(\n+ Component: React$ComponentType<{| ...ContextRouter, ...P |}>\n+ ): React$ComponentType<P>;\n+\n+ declare type MatchPathOptions = {\n+ path?: string | string[],\n+ exact?: boolean,\n+ strict?: boolean,\n+ sensitive?: boolean,\n+ ...\n+ };\n+\n+ declare export function matchPath(\n+ pathname: string,\n+ options?: MatchPathOptions | string | string[]\n+ ): null | Match;\n+\n+ declare export function useHistory(): $PropertyType<ContextRouter, 'history'>;\n+ declare export function useLocation(): $PropertyType<ContextRouter, 'location'>;\n+ declare export function useParams(): $PropertyType<$PropertyType<ContextRouter, 'match'>, 'params'>;\n+ declare export function useRouteMatch(path?: MatchPathOptions | string | string[]): $PropertyType<ContextRouter, 'match'>;\n+\n+ declare export function generatePath(pattern?: string, params?: {...}): string;\n+\n+ declare export default {\n+ StaticRouter: typeof StaticRouter,\n+ MemoryRouter: typeof MemoryRouter,\n+ Router: typeof Router,\n+ Prompt: typeof Prompt,\n+ Redirect: typeof Redirect,\n+ Route: typeof Route,\n+ Switch: typeof Switch,\n+ withRouter: typeof withRouter,\n+ matchPath: typeof matchPath,\n+ generatePath: typeof generatePath,\n+ ...\n+ };\n+}\n" }, { "change_type": "MODIFY", "old_path": "server/flow-typed/npm/react-router_v5.x.x.js", "new_path": "server/flow-typed/npm/react-router_v5.x.x.js", "diff": "-// flow-typed signature: 80f03b85756c359f80a69bddbefbf16d\n-// flow-typed version: 0fc30f59a5/react-router_v5.x.x/flow_>=v0.63.x <=v0.103.x\n+// flow-typed signature: 7a910df5fd688ad6d23c9ceaa43bf1ea\n+// flow-typed version: 5f4b3cb313/react-router_v5.x.x/flow_>=v0.104.x\ndeclare module \"react-router\" {\n// NOTE: many of these are re-exported by react-router-dom and\n// react-router-native, so when making changes, please be sure to update those\n// as well.\n- declare export type Location = {\n+ declare export type Location = $ReadOnly<{\npathname: string,\nsearch: string,\nhash: string,\nstate?: any,\n- key?: string\n- };\n+ key?: string,\n+ ...\n+ }>;\ndeclare export type LocationShape = {\npathname?: string,\nsearch?: string,\nhash?: string,\n- state?: any\n+ state?: any,\n+ ...\n};\ndeclare export type HistoryAction = \"PUSH\" | \"REPLACE\" | \"POP\";\n@@ -38,16 +40,15 @@ declare module \"react-router\" {\nblock(\ncallback: string | (location: Location, action: HistoryAction) => ?string\n): () => void,\n- // createMemoryHistory\n- index?: number,\n- entries?: Array<Location>\n+ ...\n};\ndeclare export type Match = {\n- params: { [key: string]: ?string },\n+ params: { [key: string]: ?string, ... },\nisExact: boolean,\npath: string,\n- url: string\n+ url: string,\n+ ...\n};\ndeclare export type ContextRouter = {|\n@@ -62,15 +63,14 @@ declare module \"react-router\" {\ncallback: (confirmed: boolean) => void\n) => void;\n- declare type StaticRouterContext = {\n- url?: string\n- };\n+ declare type StaticRouterContext = { url?: string, ... };\ndeclare export class StaticRouter extends React$Component<{\nbasename?: string,\nlocation?: string | Location,\ncontext: StaticRouterContext,\n- children?: React$Node\n+ children?: React$Node,\n+ ...\n}> {}\ndeclare export class MemoryRouter extends React$Component<{\n@@ -78,17 +78,20 @@ declare module \"react-router\" {\ninitialIndex?: number,\ngetUserConfirmation?: GetUserConfirmation,\nkeyLength?: number,\n- children?: React$Node\n+ children?: React$Node,\n+ ...\n}> {}\ndeclare export class Router extends React$Component<{\nhistory: RouterHistory,\n- children?: React$Node\n+ children?: React$Node,\n+ ...\n}> {}\ndeclare export class Prompt extends React$Component<{\nmessage: string | ((location: Location) => string | true),\n- when?: boolean\n+ when?: boolean,\n+ ...\n}> {}\ndeclare export class Redirect extends React$Component<{|\n@@ -124,7 +127,8 @@ declare module \"react-router\" {\npath?: string | string[],\nexact?: boolean,\nstrict?: boolean,\n- sensitive?: boolean\n+ sensitive?: boolean,\n+ ...\n};\ndeclare export function matchPath(\n@@ -132,7 +136,12 @@ declare module \"react-router\" {\noptions?: MatchPathOptions | string | string[]\n): null | Match;\n- declare export function generatePath(pattern?: string, params?: {}): string;\n+ declare export function useHistory(): $PropertyType<ContextRouter, 'history'>;\n+ declare export function useLocation(): $PropertyType<ContextRouter, 'location'>;\n+ declare export function useParams(): $PropertyType<$PropertyType<ContextRouter, 'match'>, 'params'>;\n+ declare export function useRouteMatch(path?: MatchPathOptions | string | string[]): $PropertyType<ContextRouter, 'match'>;\n+\n+ declare export function generatePath(pattern?: string, params?: {...}): string;\ndeclare export default {\nStaticRouter: typeof StaticRouter,\n@@ -145,5 +154,6 @@ declare module \"react-router\" {\nwithRouter: typeof withRouter,\nmatchPath: typeof matchPath,\ngeneratePath: typeof generatePath,\n+ ...\n};\n}\n" }, { "change_type": "MODIFY", "old_path": "web/flow-typed/npm/react-router-dom_v5.x.x.js", "new_path": "web/flow-typed/npm/react-router-dom_v5.x.x.js", "diff": "-// flow-typed signature: 5c3ecc173e04f53b410aa08d80e28aa2\n-// flow-typed version: cb4e8f3aa2/react-router-dom_v5.x.x/flow_>=v0.98.x <=v0.103.x\n+// flow-typed signature: 2d02538a529a09fdbf202a871fbb5c75\n+// flow-typed version: 5f4b3cb313/react-router-dom_v5.x.x/flow_>=v0.104.x\ndeclare module \"react-router-dom\" {\ndeclare export var BrowserRouter: React$ComponentType<{|\n@@ -18,39 +18,43 @@ declare module \"react-router-dom\" {\n|}>\ndeclare export var Link: React$ComponentType<{\n- className?: string,\n- to: string | LocationShape,\n- replace?: boolean,\n- children?: React$Node\n+ +className?: string,\n+ +to: string | LocationShape,\n+ +replace?: boolean,\n+ +children?: React$Node,\n+ ...\n}>\ndeclare export var NavLink: React$ComponentType<{\n- to: string | LocationShape,\n- activeClassName?: string,\n- className?: string,\n- activeStyle?: { +[string]: mixed },\n- style?: { +[string]: mixed },\n- isActive?: (match: Match, location: Location) => boolean,\n- children?: React$Node,\n- exact?: boolean,\n- strict?: boolean\n+ +to: string | LocationShape,\n+ +activeClassName?: string,\n+ +className?: string,\n+ +activeStyle?: { +[string]: mixed, ... },\n+ +style?: { +[string]: mixed, ... },\n+ +isActive?: (match: Match, location: Location) => boolean,\n+ +children?: React$Node,\n+ +exact?: boolean,\n+ +strict?: boolean,\n+ ...\n}>\n// NOTE: Below are duplicated from react-router. If updating these, please\n// update the react-router and react-router-native types as well.\n- declare export type Location = {\n+ declare export type Location = $ReadOnly<{\npathname: string,\nsearch: string,\nhash: string,\nstate?: any,\n- key?: string\n- };\n+ key?: string,\n+ ...\n+ }>;\ndeclare export type LocationShape = {\npathname?: string,\nsearch?: string,\nhash?: string,\n- state?: any\n+ state?: any,\n+ ...\n};\ndeclare export type HistoryAction = \"PUSH\" | \"REPLACE\" | \"POP\";\n@@ -71,16 +75,15 @@ declare module \"react-router-dom\" {\nblock(\ncallback: string | (location: Location, action: HistoryAction) => ?string\n): () => void,\n- // createMemoryHistory\n- index?: number,\n- entries?: Array<Location>\n+ ...\n};\ndeclare export type Match = {\n- params: { [key: string]: ?string },\n+ params: { [key: string]: ?string, ... },\nisExact: boolean,\npath: string,\n- url: string\n+ url: string,\n+ ...\n};\ndeclare export type ContextRouter = {|\n@@ -94,7 +97,8 @@ declare module \"react-router-dom\" {\nhistory: RouterHistory | void,\nlocation: Location | void,\nmatch: Match | void,\n- staticContext?: StaticRouterContext | void\n+ staticContext?: StaticRouterContext | void,\n+ ...\n};\ndeclare export type GetUserConfirmation = (\n@@ -102,9 +106,7 @@ declare module \"react-router-dom\" {\ncallback: (confirmed: boolean) => void\n) => void;\n- declare export type StaticRouterContext = {\n- url?: string\n- };\n+ declare export type StaticRouterContext = { url?: string, ... };\ndeclare export var StaticRouter: React$ComponentType<{|\nbasename?: string,\n@@ -155,7 +157,7 @@ declare module \"react-router-dom\" {\nlocation?: Location\n|}>\n- declare export function withRouter<Props: {}, Component: React$ComponentType<Props>>(\n+ declare export function withRouter<Props: {...}, Component: React$ComponentType<Props>>(\nWrappedComponent: Component\n): React$ComponentType<$Diff<React$ElementConfig<Component>, ContextRouterVoid>>;\n@@ -163,7 +165,8 @@ declare module \"react-router-dom\" {\npath?: string | string[],\nexact?: boolean,\nsensitive?: boolean,\n- strict?: boolean\n+ strict?: boolean,\n+ ...\n};\ndeclare export function matchPath(\n@@ -172,5 +175,10 @@ declare module \"react-router-dom\" {\nparent?: Match\n): null | Match;\n- declare export function generatePath(pattern?: string, params?: { +[string]: mixed }): string;\n+ declare export function useHistory(): $PropertyType<ContextRouter, 'history'>;\n+ declare export function useLocation(): $PropertyType<ContextRouter, 'location'>;\n+ declare export function useParams(): $PropertyType<$PropertyType<ContextRouter, 'match'>, 'params'>;\n+ declare export function useRouteMatch(path?: MatchPathOptions | string | string[]): $PropertyType<ContextRouter, 'match'>;\n+\n+ declare export function generatePath(pattern?: string, params?: { +[string]: mixed, ... }): string;\n}\n" }, { "change_type": "MODIFY", "old_path": "web/flow-typed/npm/react-router_v5.x.x.js", "new_path": "web/flow-typed/npm/react-router_v5.x.x.js", "diff": "-// flow-typed signature: 80f03b85756c359f80a69bddbefbf16d\n-// flow-typed version: 0fc30f59a5/react-router_v5.x.x/flow_>=v0.63.x <=v0.103.x\n+// flow-typed signature: 7a910df5fd688ad6d23c9ceaa43bf1ea\n+// flow-typed version: 5f4b3cb313/react-router_v5.x.x/flow_>=v0.104.x\ndeclare module \"react-router\" {\n// NOTE: many of these are re-exported by react-router-dom and\n// react-router-native, so when making changes, please be sure to update those\n// as well.\n- declare export type Location = {\n+ declare export type Location = $ReadOnly<{\npathname: string,\nsearch: string,\nhash: string,\nstate?: any,\n- key?: string\n- };\n+ key?: string,\n+ ...\n+ }>;\ndeclare export type LocationShape = {\npathname?: string,\nsearch?: string,\nhash?: string,\n- state?: any\n+ state?: any,\n+ ...\n};\ndeclare export type HistoryAction = \"PUSH\" | \"REPLACE\" | \"POP\";\n@@ -38,16 +40,15 @@ declare module \"react-router\" {\nblock(\ncallback: string | (location: Location, action: HistoryAction) => ?string\n): () => void,\n- // createMemoryHistory\n- index?: number,\n- entries?: Array<Location>\n+ ...\n};\ndeclare export type Match = {\n- params: { [key: string]: ?string },\n+ params: { [key: string]: ?string, ... },\nisExact: boolean,\npath: string,\n- url: string\n+ url: string,\n+ ...\n};\ndeclare export type ContextRouter = {|\n@@ -62,15 +63,14 @@ declare module \"react-router\" {\ncallback: (confirmed: boolean) => void\n) => void;\n- declare type StaticRouterContext = {\n- url?: string\n- };\n+ declare type StaticRouterContext = { url?: string, ... };\ndeclare export class StaticRouter extends React$Component<{\nbasename?: string,\nlocation?: string | Location,\ncontext: StaticRouterContext,\n- children?: React$Node\n+ children?: React$Node,\n+ ...\n}> {}\ndeclare export class MemoryRouter extends React$Component<{\n@@ -78,17 +78,20 @@ declare module \"react-router\" {\ninitialIndex?: number,\ngetUserConfirmation?: GetUserConfirmation,\nkeyLength?: number,\n- children?: React$Node\n+ children?: React$Node,\n+ ...\n}> {}\ndeclare export class Router extends React$Component<{\nhistory: RouterHistory,\n- children?: React$Node\n+ children?: React$Node,\n+ ...\n}> {}\ndeclare export class Prompt extends React$Component<{\nmessage: string | ((location: Location) => string | true),\n- when?: boolean\n+ when?: boolean,\n+ ...\n}> {}\ndeclare export class Redirect extends React$Component<{|\n@@ -124,7 +127,8 @@ declare module \"react-router\" {\npath?: string | string[],\nexact?: boolean,\nstrict?: boolean,\n- sensitive?: boolean\n+ sensitive?: boolean,\n+ ...\n};\ndeclare export function matchPath(\n@@ -132,7 +136,12 @@ declare module \"react-router\" {\noptions?: MatchPathOptions | string | string[]\n): null | Match;\n- declare export function generatePath(pattern?: string, params?: {}): string;\n+ declare export function useHistory(): $PropertyType<ContextRouter, 'history'>;\n+ declare export function useLocation(): $PropertyType<ContextRouter, 'location'>;\n+ declare export function useParams(): $PropertyType<$PropertyType<ContextRouter, 'match'>, 'params'>;\n+ declare export function useRouteMatch(path?: MatchPathOptions | string | string[]): $PropertyType<ContextRouter, 'match'>;\n+\n+ declare export function generatePath(pattern?: string, params?: {...}): string;\ndeclare export default {\nStaticRouter: typeof StaticRouter,\n@@ -145,5 +154,6 @@ declare module \"react-router\" {\nwithRouter: typeof withRouter,\nmatchPath: typeof matchPath,\ngeneratePath: typeof generatePath,\n+ ...\n};\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Update all react-router libdefs Summary: We should keep all of these in sync Test Plan: Flow Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1646
129,187
08.07.2021 17:51:45
14,400
c8a837ebc379b9b193a0b9f48ca669f6279c517d
Avoid specifying serverFlow twice in .lintstagedrc.js Test Plan: Make sure precommit still works Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": ".lintstagedrc.js", "new_path": ".lintstagedrc.js", "diff": "@@ -24,7 +24,7 @@ module.exports = {\n'{server,web,lib}/**/*.js': function serverFlow(files) {\nreturn 'yarn workspace server flow --quiet';\n},\n- '{landing,lib}/**/*.js': function serverFlow(files) {\n+ '{landing,lib}/**/*.js': function landingFlow(files) {\nreturn 'yarn workspace landing flow --quiet';\n},\n'native/**/*.{h,cpp}': function clangFormat(files) {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Avoid specifying serverFlow twice in .lintstagedrc.js Test Plan: Make sure precommit still works Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1644
129,187
08.07.2021 18:08:06
14,400
85d63aac24b9146ff4c754e42a902c3c30ce1b81
[landing] Get rid of unused particles CSS selector Summary: The new version of Flow noticed this, but for some reason the old version didn't. Test Plan: Flow Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/home.react.js", "new_path": "landing/home.react.js", "diff": "@@ -68,7 +68,7 @@ function Home(): React.Node {\nreturn (\n<div>\n- <StarBackground className={css.particles} />\n+ <StarBackground />\n<div className={css.body_grid}>\n<div className={`${css.hero_image} ${css.starting_section}`}>\n<lottie-player\n" }, { "change_type": "MODIFY", "old_path": "landing/landing.css", "new_path": "landing/landing.css", "diff": "@@ -179,9 +179,6 @@ div.footer_blur {\nbackground-color: rgba(255, 255, 255, 0.125);\nbackdrop-filter: blur(3px);\n}\n-div.particles {\n- z-index: -1;\n-}\n/* ===== LAYOUT HACKS ===== */\ndiv.body_grid > div + .starting_section {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Get rid of unused particles CSS selector Summary: The new version of Flow noticed this, but for some reason the old version didn't. Test Plan: Flow Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1645
129,184
08.07.2021 19:38:03
14,400
61fee8758deb1aa0c74b622042a76951483e7d22
[native] Style tab bar navigator based on figma prototype Summary: Here's how it looks: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/navigation/app-navigator.react.js", "new_path": "native/navigation/app-navigator.react.js", "diff": "@@ -93,7 +93,13 @@ const Tab = createBottomTabNavigator<\nTabParamList,\nTabNavigationProp<>,\n>();\n-const tabBarOptions = { keyboardHidesTabBar: false };\n+const tabBarOptions = {\n+ keyboardHidesTabBar: false,\n+ activeTintColor: '#AE94DB',\n+ style: {\n+ backgroundColor: '#0A0A0A',\n+ },\n+};\nfunction TabNavigator() {\nconst chatBadge = useSelector(unreadCount);\nconst isCalendarEnabled = useSelector((state) => state.enabledApps.calendar);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Style tab bar navigator based on figma prototype Summary: Here's how it looks: https://blob.sh/atul/f0c4.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1648
129,187
09.07.2021 13:43:41
14,400
1e961407cdb62a2cb65e9cadf472d109fcc5c5f5
[server] Fix up landing URL to match client request before passing down Test Plan: It works on dev. We'll have to test on prod to know for sure, but I tested the RegEx locally with the prod config Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "server/src/responders/landing-handler.js", "new_path": "server/src/responders/landing-handler.js", "diff": "@@ -86,9 +86,15 @@ async function getWebpackCompiledRootComponentForSSR() {\n}\n}\n-const { basePath } = getLandingURLFacts();\n+const { basePath, baseRoutePath } = getLandingURLFacts();\nconst { renderToNodeStream } = ReactDOMServer;\n+const replaceURLRegex = new RegExp(`^${baseRoutePath}(.*)$`);\n+const replaceURLModifier = `${basePath}$1`;\n+function clientURLFromLocalURL(url: string): string {\n+ return url.replace(replaceURLRegex, replaceURLModifier);\n+}\n+\nasync function landingResponder(req: $Request, res: $Response) {\nconst [{ jsURL, fontsURL, cssInclude }, LandingSSR] = await Promise.all([\ngetAssetInfo(),\n@@ -130,8 +136,9 @@ async function landingResponder(req: $Request, res: $Response) {\n// We remove trailing slash for `react-router`\nconst routerBasename = basePath.replace(/\\/$/, '');\n+ const publicURL = clientURLFromLocalURL(req.url);\nconst reactStream = renderToNodeStream(\n- <LandingSSR url={req.url} basename={routerBasename} />,\n+ <LandingSSR url={publicURL} basename={routerBasename} />,\n);\nreactStream.pipe(res, { end: false });\nawait waitForStream(reactStream);\n" }, { "change_type": "MODIFY", "old_path": "server/src/server.js", "new_path": "server/src/server.js", "diff": "@@ -24,9 +24,10 @@ import {\nmultimediaUploadResponder,\nuploadDownloadResponder,\n} from './uploads/uploads';\n-import { getGlobalURLFacts } from './utils/urls';\n+import { getGlobalURLFacts, getLandingURLFacts } from './utils/urls';\nconst { baseRoutePath } = getGlobalURLFacts();\n+const landingBaseRoutePath = getLandingURLFacts().baseRoutePath;\nif (cluster.isMaster) {\nconst cpuCount = os.cpus().length;\n@@ -96,7 +97,7 @@ if (cluster.isMaster) {\n// $FlowFixMe express-ws has side effects that can't be typed\nrouter.ws('/ws', onConnection);\n- router.get('/commlanding/*', landingHandler);\n+ router.get(`${landingBaseRoutePath}*`, landingHandler);\nrouter.get('*', htmlHandler(websiteResponder));\nrouter.post(\n" }, { "change_type": "MODIFY", "old_path": "server/src/utils/urls.js", "new_path": "server/src/utils/urls.js", "diff": "@@ -12,17 +12,21 @@ function getGlobalURLFacts(): GlobalURLFacts {\nreturn baseURLFacts;\n}\n-type SiteURLFacts = {|\n+type AppURLFacts = {|\n+baseDomain: string,\n+basePath: string,\n+https: boolean,\n|};\n+type LandingURLFacts = {|\n+ ...AppURLFacts,\n+ +baseRoutePath: string,\n+|};\n-function getAppURLFacts(): SiteURLFacts {\n+function getAppURLFacts(): AppURLFacts {\nreturn appURLFacts;\n}\n-function getLandingURLFacts(): SiteURLFacts {\n+function getLandingURLFacts(): LandingURLFacts {\nreturn landingURLFacts;\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Fix up landing URL to match client request before passing down Test Plan: It works on dev. We'll have to test on prod to know for sure, but I tested the RegEx locally with the prod config Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1650
129,184
09.07.2021 14:27:13
14,400
34ccb12c498780335ba5f14a2a599f8136335495
[landing] Narrow landing page and shift "Comm" header to match Summary: Narrow legal pages to `max-width` of `1080px` and have "Comm" header match Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "landing/landing.css", "new_path": "landing/landing.css", "diff": "@@ -63,6 +63,8 @@ div.footer_grid {\npadding-right: 60px;\npadding-top: 20px;\npadding-bottom: 40px;\n+ transition-property: max-width;\n+ transition: 300ms;\n}\n/* ===== CSS HEADER GRID LAYOUT ===== */\n@@ -71,6 +73,12 @@ div.header_grid {\ngrid-template-areas: 'logo logo';\n}\n+div.header_legal {\n+ max-width: 1080px;\n+ transition-property: max-width;\n+ transition: 300ms;\n+}\n+\ndiv.header_grid a {\ncolor: white;\n}\n@@ -151,7 +159,7 @@ div.subscribe_updates {\n/* ===== LEGAL PAGE STYLING ===== */\ndiv.legal_container {\n- max-width: 1920px;\n+ max-width: 1080px;\nmargin-left: auto;\nmargin-right: auto;\npadding-left: 60px;\n" }, { "change_type": "MODIFY", "old_path": "landing/landing.react.js", "new_path": "landing/landing.react.js", "diff": "// @flow\nimport * as React from 'react';\n-import { Switch, Route, Link, useLocation } from 'react-router-dom';\n+import { Link, useLocation, useRouteMatch } from 'react-router-dom';\nimport Home from './home.react';\nimport css from './landing.css';\n@@ -16,20 +16,37 @@ function Landing(): React.Node {\nwindow?.scrollTo(0, 0);\n}, [pathname]);\n+ const onPrivacy = useRouteMatch({ path: '/privacy' });\n+ const onTerms = useRouteMatch({ path: '/terms' });\n+ const onSupport = useRouteMatch({ path: '/support' });\n+ const headerStyle = React.useMemo(\n+ () =>\n+ onPrivacy || onTerms || onSupport\n+ ? `${css.header_grid} ${css.header_legal}`\n+ : css.header_grid,\n+ [onPrivacy, onSupport, onTerms],\n+ );\n+\n+ const activeNode = React.useMemo(() => {\n+ if (onPrivacy) {\n+ return <Privacy />;\n+ } else if (onTerms) {\n+ return <Terms />;\n+ } else if (onSupport) {\n+ return <Support />;\n+ }\n+ return <Home />;\n+ }, [onPrivacy, onSupport, onTerms]);\n+\nreturn (\n<>\n- <div className={css.header_grid}>\n+ <div className={headerStyle}>\n<Link to=\"/\">\n<h1 className={css.logo}>Comm</h1>\n</Link>\n</div>\n- <Switch>\n- <Route path=\"/support\" component={Support} />\n- <Route path=\"/terms\" component={Terms} />\n- <Route path=\"/privacy\" component={Privacy} />\n- <Route path=\"/\" component={Home} />\n- </Switch>\n+ {activeNode}\n<div className={css.footer_blur}>\n<div className={css.footer_grid}>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[landing] Narrow landing page and shift "Comm" header to match Summary: Narrow legal pages to `max-width` of `1080px` and have "Comm" header match Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1652
129,184
09.07.2021 13:49:02
14,400
5d0d1a7d5a6f878bdecb124fef9a738c94acbafc
[native] Style top bar navigator based on figma prototype Summary: Here's how it looks: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/chat.react.js", "new_path": "native/chat/chat.react.js", "diff": "@@ -25,6 +25,7 @@ import { threadIsPending } from 'lib/shared/thread-utils';\nimport { firstLine } from 'lib/utils/string-utils';\nimport KeyboardAvoidingView from '../components/keyboard-avoiding-view.react';\n+import SWMansionIcon from '../components/swmansion-icon.react';\nimport { InputStateContext } from '../input/input-state';\nimport HeaderBackButton from '../navigation/header-back-button.react';\nimport { defaultStackScreenOptions } from '../navigation/options';\n@@ -40,7 +41,7 @@ import {\ntype ChatParamList,\ntype ChatTopTabsParamList,\n} from '../navigation/route-names';\n-import { useStyles } from '../themes/colors';\n+import { useColors, useStyles } from '../themes/colors';\nimport BackgroundChatThreadList from './background-chat-thread-list.react';\nimport ChatHeader from './chat-header.react';\nimport ChatRouter, { type ChatRouterNavigationProp } from './chat-router';\n@@ -68,6 +69,7 @@ const unboundStyles = {\nelevation: 0,\nshadowOffset: { width: 0, height: 0 },\nborderBottomWidth: 0,\n+ backgroundColor: '#0A0A0A',\n},\n};\n@@ -77,15 +79,41 @@ export type ChatTopTabsNavigationProp<\nconst homeChatThreadListOptions = {\ntitle: 'Home',\n+ // eslint-disable-next-line react/display-name\n+ tabBarIcon: ({ color }) => (\n+ <SWMansionIcon name=\"home-1\" size={22} style={{ color }} />\n+ ),\n};\nconst backgroundChatThreadListOptions = {\ntitle: 'Background',\n+ // eslint-disable-next-line react/display-name\n+ tabBarIcon: ({ color }) => (\n+ <SWMansionIcon name=\"bell-disabled\" size={22} style={{ color }} />\n+ ),\n};\nconst ChatThreadsTopTab = createMaterialTopTabNavigator();\n-const ChatThreadsComponent = () => {\n+function ChatThreadsComponent(): React.Node {\n+ const colors = useColors();\n+ const { tabBarBackground, tabBarAccent } = colors;\n+ const tabBarOptions = React.useMemo(\n+ () => ({\n+ showIcon: true,\n+ style: {\n+ backgroundColor: tabBarBackground,\n+ },\n+ tabStyle: {\n+ flexDirection: 'row',\n+ },\n+ indicatorStyle: {\n+ borderColor: tabBarAccent,\n+ borderBottomWidth: 2,\n+ },\n+ }),\n+ [tabBarAccent, tabBarBackground],\n+ );\nreturn (\n- <ChatThreadsTopTab.Navigator>\n+ <ChatThreadsTopTab.Navigator tabBarOptions={tabBarOptions}>\n<ChatThreadsTopTab.Screen\nname={HomeChatThreadListRouteName}\ncomponent={HomeChatThreadList}\n@@ -98,7 +126,7 @@ const ChatThreadsComponent = () => {\n/>\n</ChatThreadsTopTab.Navigator>\n);\n-};\n+}\ntype ChatNavigatorProps = StackNavigatorProps<ChatRouterNavigationProp<>>;\nfunction ChatNavigator({\n" }, { "change_type": "MODIFY", "old_path": "native/chat/compose-thread-button.react.js", "new_path": "native/chat/compose-thread-button.react.js", "diff": "@@ -23,14 +23,14 @@ type Props = {|\n|};\nclass ComposeThreadButton extends React.PureComponent<Props> {\nrender() {\n- const { link: linkColor } = this.props.colors;\n+ const { listForegroundSecondaryLabel } = this.props.colors;\nreturn (\n<Button onPress={this.onPress} androidBorderlessRipple={true}>\n<SWMansionIcon\nname=\"edit-4\"\nsize={26}\nstyle={styles.composeButton}\n- color={linkColor}\n+ color={listForegroundSecondaryLabel}\n/>\n</Button>\n);\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -70,6 +70,9 @@ const light = Object.freeze({\nblockQuoteBorder: '#C0C0C0',\ncodeBackground: '#DCDCDC',\ndisconnectedBarBackground: '#C6C6C6',\n+\n+ tabBarBackground: '#F5F5F5',\n+ tabBarAccent: '#AE94DB',\n});\nexport type Colors = $Exact<typeof light>;\n@@ -133,6 +136,9 @@ const dark: Colors = Object.freeze({\nblockQuoteBorder: '#808080',\ncodeBackground: '#222222',\ndisconnectedBarBackground: '#666666',\n+\n+ tabBarBackground: '#0A0A0A',\n+ tabBarAccent: '#AE94DB',\n});\nconst colors = { light, dark };\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Style top bar navigator based on figma prototype Summary: Here's how it looks: https://blob.sh/atul/84c9.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1651
129,184
09.07.2021 16:35:16
14,400
bc948712e4dd4de054d5434acfe1181a31eacd4c
[native] Use `listBackground` color from figma and increase tab bar `borderTopWidth` Summary: Here's what it looks like: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/navigation/app-navigator.react.js", "new_path": "native/navigation/app-navigator.react.js", "diff": "@@ -98,6 +98,7 @@ const tabBarOptions = {\nactiveTintColor: '#AE94DB',\nstyle: {\nbackgroundColor: '#0A0A0A',\n+ borderTopWidth: 1,\n},\n};\nfunction TabNavigator() {\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -115,7 +115,7 @@ const dark: Colors = Object.freeze({\nlistForegroundSecondaryLabel: '#CCCCCC',\nlistForegroundTertiaryLabel: '#999999',\nlistForegroundQuaternaryLabel: '#555555',\n- listBackground: '#1C1C1E',\n+ listBackground: '#0A0A0A',\nlistBackgroundLabel: '#C7C7CC',\nlistBackgroundSecondaryLabel: '#BBBBBB',\nlistBackgroundTernaryLabel: '#888888',\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use `listBackground` color from figma and increase tab bar `borderTopWidth` Summary: Here's what it looks like: https://blob.sh/atul/ac43.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1654
129,184
09.07.2021 18:02:11
14,400
71d892e1045022499b1786fa53ba3c47d800908b
[native] Restyle `Search` component Summary: w/o query: selected: w/ query: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list.react.js", "new_path": "native/chat/chat-thread-list.react.js", "diff": "@@ -584,7 +584,7 @@ const unboundStyles = {\nsearch: {\nmarginBottom: 8,\nmarginHorizontal: 18,\n- marginTop: 12,\n+ marginTop: 16,\n},\ncancelSearchButton: {\nposition: 'absolute',\n@@ -597,7 +597,8 @@ const unboundStyles = {\ncancelSearchButtonText: {\ncolor: 'link',\nfontSize: 16,\n- paddingHorizontal: 10,\n+ paddingHorizontal: 16,\n+ paddingTop: 8,\n},\nflatList: {\nflex: 1,\n" }, { "change_type": "MODIFY", "old_path": "native/components/search.react.js", "new_path": "native/components/search.react.js", "diff": "@@ -8,13 +8,13 @@ import {\nText,\nPlatform,\n} from 'react-native';\n-import Icon from 'react-native-vector-icons/FontAwesome';\nimport { isLoggedIn } from 'lib/selectors/user-selectors';\nimport { useSelector } from '../redux/redux-utils';\nimport { useStyles, useColors } from '../themes/colors';\nimport type { ViewStyle } from '../types/styles';\n+import SWMansionIcon from './swmansion-icon.react';\ntype Props = {|\n...React.ElementConfig<typeof TextInput>,\n@@ -53,7 +53,7 @@ function ForwardedSearch(props: Props, ref: React.Ref<typeof TextInput>) {\nactiveOpacity={0.5}\nstyle={styles.clearSearchButton}\n>\n- <Icon name=\"times-circle\" size={18} color={iconColor} />\n+ <SWMansionIcon name=\"cross-circle\" size={20} color={iconColor} />\n</TouchableOpacity>\n);\n}\n@@ -91,7 +91,7 @@ function ForwardedSearch(props: Props, ref: React.Ref<typeof TextInput>) {\nreturn (\n<View style={[styles.search, containerStyle]}>\n- <Icon name=\"search\" size={18} color={iconColor} />\n+ <SWMansionIcon name=\"search\" size={22} color={iconColor} />\n{textNode}\n{clearSearchInputIcon}\n</View>\n@@ -126,7 +126,8 @@ const unboundStyles = {\nborderBottomColor: 'transparent',\n},\nclearSearchButton: {\n- padding: 5,\n+ paddingVertical: 5,\n+ paddingLeft: 5,\n},\n};\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -60,7 +60,7 @@ const light = Object.freeze({\nlistInputButton: '#888888',\nlistInputBackground: '#DDDDDD',\nlistIosHighlightUnderlay: '#DDDDDDDD',\n- listSearchBackground: '#DDDDDD',\n+ listSearchBackground: '#E2E2E2',\nlistSearchIcon: '#AAAAAA',\nlistChatBubble: '#DDDDDDBB',\nnavigationCard: '#FFFFFF',\n@@ -85,7 +85,7 @@ const dark: Colors = Object.freeze({\nredText: '#FF4444',\ngreenText: '#44FF44',\nlink: '#129AFF',\n- panelBackground: '#1C1C1E',\n+ panelBackground: '#0A0A0A',\npanelBackgroundLabel: '#C7C7CC',\npanelForeground: '#3A3A3C',\npanelForegroundBorder: '#2C2C2E',\n@@ -100,7 +100,7 @@ const dark: Colors = Object.freeze({\nmodalForegroundLabel: 'white',\nmodalForegroundSecondaryLabel: '#AAAAAA',\nmodalForegroundTertiaryLabel: '#666666',\n- modalBackground: '#2C2C2E',\n+ modalBackground: '#0A0A0A',\nmodalBackgroundLabel: '#CCCCCC',\nmodalBackgroundSecondaryLabel: '#555555',\nmodalIosHighlightUnderlay: '#AAAAAA88',\n@@ -126,7 +126,7 @@ const dark: Colors = Object.freeze({\nlistInputButton: '#AAAAAA',\nlistInputBackground: '#38383C',\nlistIosHighlightUnderlay: '#BBBBBB88',\n- listSearchBackground: '#555555',\n+ listSearchBackground: '#1D1D1D',\nlistSearchIcon: '#AAAAAA',\nlistChatBubble: '#444444DD',\nnavigationCard: '#2A2A2A',\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Restyle `Search` component Summary: w/o query: https://blob.sh/atul/df6d.png selected: https://blob.sh/atul/c401.png w/ query: https://blob.sh/atul/9c0b.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1655
129,184
10.07.2021 19:44:06
14,400
b73280dc27bca87082e3fdea936c207840c84d87
[native] Restyle `Chat.Navigator` Summary: Here's what it looks like: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/chat.react.js", "new_path": "native/chat/chat.react.js", "diff": "@@ -181,11 +181,6 @@ const header = (props: CoreStackHeaderProps) => {\nreturn <ChatHeader {...castProps} />;\n};\nconst headerBackButton = (props) => <HeaderBackButton {...props} />;\n-const screenOptions = {\n- ...defaultStackScreenOptions,\n- header,\n- headerLeft: headerBackButton,\n-};\nconst chatThreadListOptions = ({ navigation }) => ({\nheaderTitle: 'Threads',\n@@ -193,7 +188,7 @@ const chatThreadListOptions = ({ navigation }) => ({\nPlatform.OS === 'ios'\n? () => <ComposeThreadButton navigate={navigation.navigate} />\n: undefined,\n- headerBackTitle: 'Back',\n+ headerBackTitleVisible: false,\nheaderStyle: unboundStyles.threadListHeaderStyle,\n});\nconst messageListOptions = ({ navigation, route }) => ({\n@@ -221,19 +216,19 @@ const messageListOptions = ({ navigation, route }) => ({\n/>\n)\n: undefined,\n- headerBackTitle: 'Back',\n+ headerBackTitleVisible: false,\n});\nconst composeThreadOptions = {\nheaderTitle: 'Compose thread',\n- headerBackTitle: 'Back',\n+ headerBackTitleVisible: false,\n};\nconst threadSettingsOptions = ({ route }) => ({\nheaderTitle: firstLine(route.params.threadInfo.uiName),\n- headerBackTitle: 'Back',\n+ headerBackTitleVisible: false,\n});\nconst deleteThreadOptions = {\nheaderTitle: 'Delete thread',\n- headerBackTitle: 'Back',\n+ headerBackTitleVisible: false,\n};\nexport type ChatNavigationProp<\n@@ -247,6 +242,7 @@ const Chat = createChatNavigator<\n>();\nexport default function ChatComponent() {\nconst styles = useStyles(unboundStyles);\n+ const colors = useColors();\nconst behavior = Platform.select({\nandroid: 'height',\ndefault: 'padding',\n@@ -256,6 +252,20 @@ export default function ChatComponent() {\nif (loggedIn) {\ndraftUpdater = <ThreadDraftUpdater />;\n}\n+\n+ const screenOptions = React.useMemo(\n+ () => ({\n+ ...defaultStackScreenOptions,\n+ header,\n+ headerLeft: headerBackButton,\n+ headerStyle: {\n+ backgroundColor: colors.tabBarBackground,\n+ borderBottomWidth: 1,\n+ },\n+ }),\n+ [colors.tabBarBackground],\n+ );\n+\nreturn (\n<View style={styles.view}>\n<KeyboardAvoidingView\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Restyle `Chat.Navigator` Summary: Here's what it looks like: https://blob.sh/atul/3891.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1657
129,184
10.07.2021 21:48:11
14,400
4a4e3aee4a3abd29069137bf9f6a30357a727b25
[native] Restyle `ChatInputBar` Summary: iOS: android: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-input-bar.react.js", "new_path": "native/chat/chat-input-bar.react.js", "diff": "@@ -15,7 +15,6 @@ import {\n} from 'react-native';\nimport { TextInputKeyboardMangerIOS } from 'react-native-keyboard-input';\nimport Animated, { Easing } from 'react-native-reanimated';\n-import FAIcon from 'react-native-vector-icons/FontAwesome';\nimport Icon from 'react-native-vector-icons/Ionicons';\nimport { useDispatch } from 'react-redux';\n@@ -54,6 +53,7 @@ import {\nimport Button from '../components/button.react';\nimport ClearableTextInput from '../components/clearable-text-input.react';\n+import SWMansionIcon from '../components/swmansion-icon.react';\nimport { type UpdateDraft, type MoveDraft, useDrafts } from '../data/core-data';\nimport { type InputState, InputStateContext } from '../input/input-state';\nimport { getKeyboardHeight } from '../keyboard/keyboard';\n@@ -93,7 +93,7 @@ const {\n/* eslint-enable import/no-named-as-default-member */\nconst expandoButtonsAnimationConfig = {\n- duration: 500,\n+ duration: 150,\neasing: Easing.inOut(Easing.ease),\n};\nconst sendButtonAnimationConfig = {\n@@ -201,7 +201,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nconst expandoButtonsWidth = interpolate(expandoButtonsOpen, {\ninputRange: [0, 1],\n- outputRange: [22, 60],\n+ outputRange: [22, 66],\n});\nthis.expandoButtonsStyle = {\n...unboundStyles.expandoButtons,\n@@ -496,9 +496,9 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nstyle={this.props.styles.expandButton}\n>\n<Animated.View style={this.expandIconStyle}>\n- <FAIcon\n+ <SWMansionIcon\nname=\"chevron-right\"\n- size={19}\n+ size={22}\ncolor={this.props.colors.listInputButton}\n/>\n</Animated.View>\n@@ -516,9 +516,9 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nactiveOpacity={0.4}\n>\n<Animated.View style={this.cameraRollIconStyle}>\n- <Icon\n- name=\"md-image\"\n- size={25}\n+ <SWMansionIcon\n+ name=\"image-1\"\n+ size={24}\ncolor={this.props.colors.listInputButton}\n/>\n</Animated.View>\n@@ -529,9 +529,9 @@ class ChatInputBar extends React.PureComponent<Props, State> {\ndisabled={!this.state.buttonsExpanded}\n>\n<Animated.View style={this.cameraIconStyle}>\n- <FAIcon\n+ <SWMansionIcon\nname=\"camera\"\n- size={20}\n+ size={24}\ncolor={this.props.colors.listInputButton}\n/>\n</Animated.View>\n@@ -715,12 +715,12 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nconst unboundStyles = {\ncameraIcon: {\n- paddingBottom: Platform.OS === 'android' ? 11 : 10,\n- paddingRight: 3,\n+ paddingBottom: Platform.OS === 'android' ? 12 : 11,\n+ paddingRight: 4,\n},\ncameraRollIcon: {\n- paddingBottom: Platform.OS === 'android' ? 8 : 7,\n- paddingRight: 8,\n+ paddingBottom: Platform.OS === 'android' ? 12 : 11,\n+ paddingRight: 6,\n},\ncontainer: {\nbackgroundColor: 'listBackground',\n@@ -731,7 +731,7 @@ const unboundStyles = {\nright: 0,\n},\nexpandIcon: {\n- paddingBottom: Platform.OS === 'android' ? 12 : 10,\n+ paddingBottom: Platform.OS === 'android' ? 13 : 11,\n},\nexpandoButtons: {\nalignSelf: 'flex-end',\n@@ -774,21 +774,23 @@ const unboundStyles = {\n},\nsendButton: {\nposition: 'absolute',\n- bottom: Platform.OS === 'android' ? 4 : 3,\n+ bottom: 4,\nleft: 0,\n},\nsendIcon: {\npaddingLeft: 9,\npaddingRight: 8,\n- paddingVertical: 5,\n+ paddingVertical: 6,\n},\ntextInput: {\nbackgroundColor: 'listInputBackground',\n- borderRadius: 10,\n+ borderRadius: 12,\ncolor: 'listForegroundLabel',\nfontSize: 16,\nmarginLeft: 4,\n- marginVertical: 5,\n+ marginRight: 4,\n+ marginTop: 6,\n+ marginBottom: 8,\nmaxHeight: 250,\npaddingHorizontal: 10,\npaddingVertical: 5,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Restyle `ChatInputBar` Summary: iOS: https://blob.sh/atul/chat-input-bar-ios.png https://blob.sh/atul/chat-input-bar-icons.mov android: https://blob.sh/atul/chat-input-bar-android.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1658
129,184
10.07.2021 23:04:34
14,400
fb854833791d51bdabe6dbfa81014be03960de8e
[native] Swap out floppy disk Summary: Here's how it looks: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/media/image-modal.react.js", "new_path": "native/media/image-modal.react.js", "diff": "@@ -17,12 +17,12 @@ import {\n} from 'react-native-gesture-handler';\nimport Orientation from 'react-native-orientation-locker';\nimport Animated from 'react-native-reanimated';\n-import Icon from 'react-native-vector-icons/Ionicons';\nimport { type MediaInfo, type Dimensions } from 'lib/types/media-types';\nimport { useIsReportEnabled } from 'lib/utils/report-utils';\nimport type { ChatMultimediaMessageInfoItem } from '../chat/multimedia-message.react';\n+import SWMansionIcon from '../components/swmansion-icon.react';\nimport ConnectedStatusBar from '../connected-status-bar.react';\nimport type { AppNavigationProp } from '../navigation/app-navigator.react';\nimport {\n@@ -1055,10 +1055,7 @@ class ImageModal extends React.PureComponent<Props, State> {\nonLayout={this.onSaveButtonLayout}\nref={this.saveButtonRef}\n>\n- <Icon\n- name={Platform.OS === 'ios' ? 'ios-save' : 'md-save'}\n- style={styles.saveButtonIcon}\n- />\n+ <SWMansionIcon name=\"save\" style={styles.saveButtonIcon} />\n<Text style={styles.saveButtonText}>Save</Text>\n</TouchableOpacity>\n</Animated.View>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Swap out floppy disk Summary: Here's how it looks: https://blob.sh/atul/6285.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1659
129,184
11.07.2021 00:12:25
14,400
b312040d1069938f4d95cb608f1b3bfe19707d6c
[native] Style header chevrons based on the designs Summary: Here's how it looks: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/message-list-header-title.react.js", "new_path": "native/chat/message-list-header-title.react.js", "diff": "@@ -93,7 +93,7 @@ const unboundStyles = {\nforwardIcon: {\npaddingLeft: 7,\npaddingTop: 3,\n- color: 'link',\n+ color: 'headerChevron',\nflex: 1,\nminWidth: 25,\n},\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/header-back-button.react.js", "new_path": "native/navigation/header-back-button.react.js", "diff": "@@ -7,10 +7,10 @@ import { useColors } from '../themes/colors';\ntype Props = React.ElementConfig<typeof BaseHeaderBackButton>;\nfunction HeaderBackButton(props: Props) {\n- const { link: tintColor } = useColors();\n+ const { headerChevron } = useColors();\nif (!props.canGoBack) {\nreturn null;\n}\n- return <BaseHeaderBackButton {...props} tintColor={tintColor} />;\n+ return <BaseHeaderBackButton {...props} tintColor={headerChevron} />;\n}\nexport default HeaderBackButton;\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -73,6 +73,7 @@ const light = Object.freeze({\ntabBarBackground: '#F5F5F5',\ntabBarAccent: '#AE94DB',\n+ headerChevron: '#0A0A0A',\n});\nexport type Colors = $Exact<typeof light>;\n@@ -139,6 +140,7 @@ const dark: Colors = Object.freeze({\ntabBarBackground: '#0A0A0A',\ntabBarAccent: '#AE94DB',\n+ headerChevron: '#FFFFFF',\n});\nconst colors = { light, dark };\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Style header chevrons based on the designs Summary: Here's how it looks: https://blob.sh/atul/fa33.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1660
129,184
11.07.2021 00:46:13
14,400
f939fde1852151f4fa5938212497bbc5de36e6b7
[native] Restyle `Profile.Navigator` headerStyle Summary: Here's how it looks: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/profile/profile.react.js", "new_path": "native/profile/profile.react.js", "diff": "@@ -23,7 +23,7 @@ import {\ntype ScreenParamList,\ntype ProfileParamList,\n} from '../navigation/route-names';\n-import { useStyles } from '../themes/colors';\n+import { useStyles, useColors } from '../themes/colors';\nimport AppearancePreferences from './appearance-preferences.react';\nimport BuildInfo from './build-info.react';\nimport DeleteAccount from './delete-account.react';\n@@ -36,10 +36,6 @@ import RelationshipList from './relationship-list.react';\nconst header = (props: StackHeaderProps) => <ProfileHeader {...props} />;\nconst headerBackButton = (props) => <HeaderBackButton {...props} />;\n-const screenOptions = {\n- header,\n- headerLeft: headerBackButton,\n-};\nconst profileScreenOptions = { headerTitle: 'Profile' };\nconst editPasswordOptions = { headerTitle: 'Change password' };\nconst deleteAccountOptions = { headerTitle: 'Delete account' };\n@@ -47,14 +43,8 @@ const buildInfoOptions = { headerTitle: 'Build info' };\nconst devToolsOptions = { headerTitle: 'Developer tools' };\nconst appearanceOptions = { headerTitle: 'Appearance' };\nconst privacyOptions = { headerTitle: 'Privacy' };\n-const friendListOptions = {\n- headerTitle: 'Friend list',\n- headerBackTitle: 'Back',\n-};\n-const blockListOptions = {\n- headerTitle: 'Block list',\n- headerBackTitle: 'Back',\n-};\n+const friendListOptions = { headerTitle: 'Friend list' };\n+const blockListOptions = { headerTitle: 'Block list' };\nexport type ProfileNavigationProp<\nRouteName: $Keys<ProfileParamList> = $Keys<ProfileParamList>,\n@@ -67,6 +57,20 @@ const Profile = createStackNavigator<\n>();\nfunction ProfileComponent() {\nconst styles = useStyles(unboundStyles);\n+ const colors = useColors();\n+\n+ const screenOptions = React.useMemo(\n+ () => ({\n+ header,\n+ headerLeft: headerBackButton,\n+ headerStyle: {\n+ backgroundColor: colors.tabBarBackground,\n+ shadowOpacity: 0,\n+ },\n+ }),\n+ [colors.tabBarBackground],\n+ );\n+\nreturn (\n<View style={styles.view}>\n<KeyboardAvoidingView\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -69,7 +69,7 @@ const light = Object.freeze({\nblockQuoteBackground: '#D3D3D3',\nblockQuoteBorder: '#C0C0C0',\ncodeBackground: '#DCDCDC',\n- disconnectedBarBackground: '#C6C6C6',\n+ disconnectedBarBackground: '#FFFFFF',\ntabBarBackground: '#F5F5F5',\ntabBarAccent: '#AE94DB',\n@@ -125,18 +125,18 @@ const dark: Colors = Object.freeze({\nlistInputBar: '#555555',\nlistInputBorder: '#333333',\nlistInputButton: '#AAAAAA',\n- listInputBackground: '#38383C',\n+ listInputBackground: '#1D1D1D',\nlistIosHighlightUnderlay: '#BBBBBB88',\nlistSearchBackground: '#1D1D1D',\nlistSearchIcon: '#AAAAAA',\n- listChatBubble: '#444444DD',\n+ listChatBubble: '#26252A',\nnavigationCard: '#2A2A2A',\nfloatingButtonBackground: '#666666',\nfloatingButtonLabel: 'white',\nblockQuoteBackground: '#A9A9A9',\nblockQuoteBorder: '#808080',\ncodeBackground: '#222222',\n- disconnectedBarBackground: '#666666',\n+ disconnectedBarBackground: '#1D1D1D',\ntabBarBackground: '#0A0A0A',\ntabBarAccent: '#AE94DB',\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Restyle `Profile.Navigator` headerStyle Summary: Here's how it looks: https://blob.sh/atul/a225.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1661
129,184
11.07.2021 01:07:36
14,400
f6265f1323d404e0397a7d5f9384e1883dd2eefd
[native] Use `threadInfo.color` for `ChatInputBar` selection color Summary: Here's how it looks: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-input-bar.react.js", "new_path": "native/chat/chat-input-bar.react.js", "diff": "@@ -549,6 +549,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nstyle={this.props.styles.textInput}\ntextInputRef={this.textInputRef}\nref={this.clearableTextInputRef}\n+ selectionColor={`#${this.props.threadInfo.color}`}\n/>\n<Animated.View style={this.sendButtonContainerStyle}>\n<TouchableOpacity\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use `threadInfo.color` for `ChatInputBar` selection color Summary: Here's how it looks: https://blob.sh/atul/6050.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1662
129,184
11.07.2021 18:57:53
14,400
65af1ea5ef137cd47a583c41d595e6b56b0a8af4
[native] Replace pencil icon w/ SWMansion icon Summary: Here's what it looks like: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/settings/thread-settings-description.react.js", "new_path": "native/chat/settings/thread-settings-description.react.js", "diff": "import invariant from 'invariant';\nimport * as React from 'react';\nimport { Text, Alert, ActivityIndicator, TextInput, View } from 'react-native';\n-import Icon from 'react-native-vector-icons/FontAwesome';\nimport {\nchangeThreadSettingsActionTypes,\n@@ -26,6 +25,7 @@ import {\nimport Button from '../../components/button.react';\nimport EditSettingButton from '../../components/edit-setting-button.react';\n+import SWMansionIcon from '../../components/swmansion-icon.react';\nimport { useSelector } from '../../redux/redux-utils';\nimport { type Colors, useStyles, useColors } from '../../themes/colors';\nimport type {\n@@ -146,9 +146,9 @@ class ThreadSettingsDescription extends React.PureComponent<Props> {\n<Text style={this.props.styles.addDescriptionText}>\nAdd a description...\n</Text>\n- <Icon\n- name=\"pencil\"\n- size={16}\n+ <SWMansionIcon\n+ name=\"edit-1\"\n+ size={20}\nstyle={this.props.styles.editIcon}\n/>\n</Button>\n" }, { "change_type": "MODIFY", "old_path": "native/components/edit-setting-button.react.js", "new_path": "native/components/edit-setting-button.react.js", "diff": "import * as React from 'react';\nimport { TouchableOpacity, StyleSheet, Platform } from 'react-native';\n-import Icon from 'react-native-vector-icons/FontAwesome';\nimport { useColors } from '../themes/colors';\nimport type { TextStyle } from '../types/styles';\n+import SWMansionIcon from './swmansion-icon.react';\ntype Props = {|\n+onPress: () => void,\n@@ -21,10 +21,15 @@ function EditSettingButton(props: Props) {\nif (props.style) {\nappliedStyles.push(props.style);\n}\n- const { link: linkColor } = colors;\n+ const { modalForegroundSecondaryLabel } = colors;\nreturn (\n<TouchableOpacity onPress={props.onPress}>\n- <Icon name=\"pencil\" size={16} style={appliedStyles} color={linkColor} />\n+ <SWMansionIcon\n+ name=\"edit-1\"\n+ size={20}\n+ style={appliedStyles}\n+ color={modalForegroundSecondaryLabel}\n+ />\n</TouchableOpacity>\n);\n}\n" }, { "change_type": "MODIFY", "old_path": "native/components/pencil-icon.react.js", "new_path": "native/components/pencil-icon.react.js", "diff": "import * as React from 'react';\nimport { Platform } from 'react-native';\n-import Icon from 'react-native-vector-icons/FontAwesome';\nimport { useStyles } from '../themes/colors';\n+import SWMansionIcon from './swmansion-icon.react';\nfunction PencilIcon() {\nconst styles = useStyles(unboundStyles);\n- return <Icon name=\"pencil\" size={16} style={styles.editIcon} />;\n+ return <SWMansionIcon name=\"edit-1\" size={20} style={styles.editIcon} />;\n}\nconst unboundStyles = {\neditIcon: {\n- color: 'link',\n+ color: 'modalForegroundSecondaryLabel',\nlineHeight: 20,\npaddingTop: Platform.select({ android: 1, default: 0 }),\ntextAlign: 'right',\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -75,6 +75,7 @@ const light = Object.freeze({\ntabBarAccent: '#AE94DB',\nheaderChevron: '#0A0A0A',\nnavigationChevron: '#A4A4A2',\n+ editButton: '#A4A4A2',\n});\nexport type Colors = $Exact<typeof light>;\n@@ -143,6 +144,7 @@ const dark: Colors = Object.freeze({\ntabBarAccent: '#AE94DB',\nheaderChevron: '#FFFFFF',\nnavigationChevron: '#5B5B5D',\n+ editButton: '#5B5B5D',\n});\nconst colors = { light, dark };\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Replace pencil icon w/ SWMansion icon Summary: Here's what it looks like: https://blob.sh/atul/dd59.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1664
129,184
11.07.2021 19:05:40
14,400
6ced494db96d42a7c2186313e2a9a47aa2ac6954
[native] Fix `ComposeThreadButton` alignment Summary: Here's what it looks like: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/compose-thread-button.react.js", "new_path": "native/chat/compose-thread-button.react.js", "diff": "@@ -54,7 +54,7 @@ class ComposeThreadButton extends React.PureComponent<Props> {\nconst styles = StyleSheet.create({\ncomposeButton: {\n- paddingHorizontal: 10,\n+ marginRight: 16,\n},\n});\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Fix `ComposeThreadButton` alignment Summary: Here's what it looks like: https://blob.sh/atul/fb20.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1665
129,184
11.07.2021 20:58:35
14,400
87377a11032571aa9b8789775a1a3ab4b8415e2c
[native] Use `SWMansionIcon` for log-in-panel and register-panel Summary: Here's what it looks like: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/account/log-in-panel.react.js", "new_path": "native/account/log-in-panel.react.js", "diff": "@@ -4,7 +4,6 @@ import invariant from 'invariant';\nimport * as React from 'react';\nimport { View, StyleSheet, Alert, Keyboard, Platform } from 'react-native';\nimport Animated from 'react-native-reanimated';\n-import Icon from 'react-native-vector-icons/FontAwesome';\nimport { logInActionTypes, logIn } from 'lib/actions/user-actions';\nimport { createLoadingStatusSelector } from 'lib/selectors/loading-selectors';\n@@ -25,6 +24,7 @@ import {\ntype DispatchActionPromise,\n} from 'lib/utils/action-utils';\n+import SWMansionIcon from '../components/swmansion-icon.react';\nimport { NavContext } from '../navigation/navigation-context';\nimport { useSelector } from '../redux/redux-utils';\nimport { nativeLogInExtraInfoSelector } from '../selectors/account-selectors';\n@@ -98,7 +98,12 @@ class LogInPanel extends React.PureComponent<Props> {\nreturn (\n<Panel opacityValue={this.props.opacityValue}>\n<View style={styles.row}>\n- <Icon name=\"user\" size={22} color=\"#777\" style={styles.icon} />\n+ <SWMansionIcon\n+ name=\"user\"\n+ size={22}\n+ color=\"#555\"\n+ style={styles.icon}\n+ />\n<TextInput\nstyle={styles.input}\nvalue={this.usernameInputText}\n@@ -119,7 +124,12 @@ class LogInPanel extends React.PureComponent<Props> {\n/>\n</View>\n<View style={styles.row}>\n- <Icon name=\"lock\" size={22} color=\"#777\" style={styles.icon} />\n+ <SWMansionIcon\n+ name=\"lock-on\"\n+ size={22}\n+ color=\"#555\"\n+ style={styles.icon}\n+ />\n<TextInput\nstyle={styles.input}\nvalue={this.passwordInputText}\n@@ -323,7 +333,7 @@ const styles = StyleSheet.create({\njustifyContent: 'flex-end',\n},\nicon: {\n- bottom: 8,\n+ bottom: 10,\nleft: 4,\nposition: 'absolute',\n},\n" }, { "change_type": "MODIFY", "old_path": "native/account/register-panel.react.js", "new_path": "native/account/register-panel.react.js", "diff": "@@ -12,7 +12,6 @@ import {\nLinking,\n} from 'react-native';\nimport Animated from 'react-native-reanimated';\n-import Icon from 'react-native-vector-icons/FontAwesome';\nimport { registerActionTypes, register } from 'lib/actions/user-actions';\nimport { createLoadingStatusSelector } from 'lib/selectors/loading-selectors';\n@@ -30,6 +29,7 @@ import {\ntype DispatchActionPromise,\n} from 'lib/utils/action-utils';\n+import SWMansionIcon from '../components/swmansion-icon.react';\nimport { NavContext } from '../navigation/navigation-context';\nimport { useSelector } from '../redux/redux-utils';\nimport { nativeLogInExtraInfoSelector } from '../selectors/account-selectors';\n@@ -91,7 +91,12 @@ class RegisterPanel extends React.PureComponent<Props, State> {\nreturn (\n<Panel opacityValue={this.props.opacityValue} style={styles.container}>\n<View style={styles.row}>\n- <Icon name=\"user\" size={22} color=\"#777\" style={styles.icon} />\n+ <SWMansionIcon\n+ name=\"user\"\n+ size={22}\n+ color=\"#555\"\n+ style={styles.icon}\n+ />\n<TextInput\nstyle={styles.input}\nvalue={this.props.registerState.state.usernameInputText}\n@@ -111,7 +116,12 @@ class RegisterPanel extends React.PureComponent<Props, State> {\n/>\n</View>\n<View style={styles.row}>\n- <Icon name=\"lock\" size={22} color=\"#777\" style={styles.icon} />\n+ <SWMansionIcon\n+ name=\"lock-on\"\n+ size={22}\n+ color=\"#555\"\n+ style={styles.icon}\n+ />\n<TextInput\nstyle={styles.input}\nvalue={this.props.registerState.state.passwordInputText}\n@@ -397,7 +407,7 @@ const styles = StyleSheet.create({\nfontWeight: 'bold',\n},\nicon: {\n- bottom: 8,\n+ bottom: 10,\nleft: 4,\nposition: 'absolute',\n},\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use `SWMansionIcon` for log-in-panel and register-panel Summary: Here's what it looks like: https://blob.sh/atul/8ca9.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1667
129,191
07.07.2021 09:25:54
-7,200
c232a30bc1355a881865108b4503da0163aae281
[native] Introduce inner multimedia message Summary: Split multimedia message and create a new component which will be rendered by the tooltip. Test Plan: Open a thread with mutimedia message and check if it's rendered correctly Reviewers: ashoat Subscribers: KatPo, Adrian, atul
[ { "change_type": "ADD", "old_path": null, "new_path": "native/chat/inner-multimedia-message.react.js", "diff": "+// @flow\n+import invariant from 'invariant';\n+import * as React from 'react';\n+import { StyleSheet, View } from 'react-native';\n+\n+import type { Corners, Media } from 'lib/types/media-types';\n+\n+import type { VerticalBounds } from '../types/layout-types';\n+import type { ViewStyle } from '../types/styles';\n+import MultimediaMessageMultimedia from './multimedia-message-multimedia.react';\n+import type { ChatMultimediaMessageInfoItem } from './multimedia-message.react';\n+import {\n+ allCorners,\n+ filterCorners,\n+ getRoundedContainerStyle,\n+} from './rounded-corners';\n+\n+function getMediaPerRow(mediaCount: number) {\n+ if (mediaCount === 0) {\n+ return 0; // ???\n+ } else if (mediaCount === 1) {\n+ return 1;\n+ } else if (mediaCount === 2) {\n+ return 2;\n+ } else if (mediaCount === 3) {\n+ return 3;\n+ } else if (mediaCount === 4) {\n+ return 2;\n+ } else {\n+ return 3;\n+ }\n+}\n+\n+const borderRadius = 16;\n+\n+type Props = {|\n+ +item: ChatMultimediaMessageInfoItem,\n+ +verticalBounds: ?VerticalBounds,\n+|};\n+class InnerMultimediaMessage extends React.PureComponent<Props> {\n+ render() {\n+ const { item } = this.props;\n+ const containerStyle = {\n+ height: item.contentHeight,\n+ width: item.contentWidth,\n+ };\n+ return <View style={containerStyle}>{this.renderContent()}</View>;\n+ }\n+\n+ renderContent(): React.Node {\n+ const { messageInfo } = this.props.item;\n+ invariant(messageInfo.media.length > 0, 'should have media');\n+ if (messageInfo.media.length === 1) {\n+ return this.renderImage(messageInfo.media[0], 0, allCorners);\n+ }\n+\n+ const mediaPerRow = getMediaPerRow(messageInfo.media.length);\n+\n+ const rows = [];\n+ for (let i = 0; i < messageInfo.media.length; i += mediaPerRow) {\n+ const rowMedia = messageInfo.media.slice(i, i + mediaPerRow);\n+\n+ const firstRow = i === 0;\n+ const lastRow = i + mediaPerRow >= messageInfo.media.length;\n+\n+ const row = [];\n+ let j = 0;\n+ for (; j < rowMedia.length; j++) {\n+ const media = rowMedia[j];\n+ const firstInRow = j === 0;\n+ const lastInRow = j + 1 === rowMedia.length;\n+ const inLastColumn = j + 1 === mediaPerRow;\n+ const corners = {\n+ topLeft: firstRow && firstInRow,\n+ topRight: firstRow && inLastColumn,\n+ bottomLeft: lastRow && firstInRow,\n+ bottomRight: lastRow && inLastColumn,\n+ };\n+ const style = lastInRow ? null : styles.imageBeforeImage;\n+ row.push(this.renderImage(media, i + j, corners, style));\n+ }\n+ for (; j < mediaPerRow; j++) {\n+ const key = `filler${j}`;\n+ const style =\n+ j + 1 < mediaPerRow\n+ ? [styles.filler, styles.imageBeforeImage]\n+ : styles.filler;\n+ row.push(<View style={style} key={key} />);\n+ }\n+\n+ const rowStyle = lastRow ? styles.row : [styles.row, styles.rowAboveRow];\n+ rows.push(\n+ <View style={rowStyle} key={i}>\n+ {row}\n+ </View>,\n+ );\n+ }\n+\n+ return <View style={styles.grid}>{rows}</View>;\n+ }\n+\n+ renderImage(\n+ media: Media,\n+ index: number,\n+ corners: Corners,\n+ style?: ViewStyle,\n+ ): React.Node {\n+ const filteredCorners = filterCorners(corners, this.props.item);\n+ const roundedStyle = getRoundedContainerStyle(\n+ filteredCorners,\n+ borderRadius,\n+ );\n+ const { pendingUploads } = this.props.item;\n+ const mediaInfo = {\n+ ...media,\n+ corners: filteredCorners,\n+ index,\n+ };\n+ const pendingUpload = pendingUploads && pendingUploads[media.id];\n+ return (\n+ <MultimediaMessageMultimedia\n+ mediaInfo={mediaInfo}\n+ verticalBounds={this.props.verticalBounds}\n+ style={[style, roundedStyle]}\n+ postInProgress={!!pendingUploads}\n+ pendingUpload={pendingUpload}\n+ item={this.props.item}\n+ key={index}\n+ />\n+ );\n+ }\n+}\n+\n+const spaceBetweenImages = 4;\n+const styles = StyleSheet.create({\n+ filler: {\n+ flex: 1,\n+ },\n+ grid: {\n+ flex: 1,\n+ justifyContent: 'space-between',\n+ },\n+ imageBeforeImage: {\n+ marginRight: spaceBetweenImages,\n+ },\n+ row: {\n+ flex: 1,\n+ flexDirection: 'row',\n+ justifyContent: 'space-between',\n+ },\n+ rowAboveRow: {\n+ marginBottom: spaceBetweenImages,\n+ },\n+});\n+\n+export {\n+ InnerMultimediaMessage,\n+ getMediaPerRow,\n+ spaceBetweenImages,\n+ borderRadius as multimediaMessageBorderRadius,\n+};\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-message.react.js", "new_path": "native/chat/multimedia-message.react.js", "diff": "import invariant from 'invariant';\nimport * as React from 'react';\n-import { StyleSheet, View } from 'react-native';\n+import { View } from 'react-native';\n-import type { Media, Corners } from 'lib/types/media-types';\nimport type {\nMultimediaMessageInfo,\nLocalMessageInfo,\n@@ -13,7 +12,6 @@ import type { ThreadInfo } from 'lib/types/thread-types';\nimport type { MessagePendingUploads } from '../input/input-state';\nimport { type VerticalBounds } from '../types/layout-types';\n-import type { ViewStyle } from '../types/styles';\nimport { ComposedMessage, clusterEndHeight } from './composed-message.react';\nimport { failedSendHeight } from './failed-send.react';\nimport {\n@@ -21,14 +19,13 @@ import {\ninlineSidebarMarginBottom,\ninlineSidebarMarginTop,\n} from './inline-sidebar.react';\n+import {\n+ getMediaPerRow,\n+ InnerMultimediaMessage,\n+ spaceBetweenImages,\n+} from './inner-multimedia-message.react';\nimport { authorNameHeight } from './message-header.react';\n-import MultimediaMessageMultimedia from './multimedia-message-multimedia.react';\nimport sendFailed from './multimedia-message-send-failed';\n-import {\n- allCorners,\n- filterCorners,\n- getRoundedContainerStyle,\n-} from './rounded-corners';\ntype ContentSizes = {|\n+imageHeight: number,\n@@ -49,22 +46,6 @@ export type ChatMultimediaMessageInfoItem = {|\n+pendingUploads: ?MessagePendingUploads,\n|};\n-function getMediaPerRow(mediaCount: number) {\n- if (mediaCount === 0) {\n- return 0; // ???\n- } else if (mediaCount === 1) {\n- return 1;\n- } else if (mediaCount === 2) {\n- return 2;\n- } else if (mediaCount === 3) {\n- return 3;\n- } else if (mediaCount === 4) {\n- return 2;\n- } else {\n- return 3;\n- }\n-}\n-\n// Called by MessageListContainer\n// The results are merged into ChatMultimediaMessageInfoItem\nfunction multimediaMessageContentSizes(\n@@ -129,8 +110,6 @@ function multimediaMessageItemHeight(item: ChatMultimediaMessageInfoItem) {\nreturn height;\n}\n-const borderRadius = 16;\n-\ntype Props = {|\n...React.ElementConfig<typeof View>,\n+item: ChatMultimediaMessageInfoItem,\n@@ -140,10 +119,6 @@ type Props = {|\nclass MultimediaMessage extends React.PureComponent<Props> {\nrender() {\nconst { item, focused, verticalBounds, ...viewProps } = this.props;\n- const containerStyle = {\n- height: item.contentHeight,\n- width: item.contentWidth,\n- };\nreturn (\n<ComposedMessage\nitem={item}\n@@ -151,118 +126,13 @@ class MultimediaMessage extends React.PureComponent<Props> {\nfocused={focused}\n{...viewProps}\n>\n- <View style={containerStyle}>{this.renderContent()}</View>\n+ <InnerMultimediaMessage item={item} verticalBounds={verticalBounds} />\n</ComposedMessage>\n);\n}\n-\n- renderContent(): React.Node {\n- const { messageInfo } = this.props.item;\n- invariant(messageInfo.media.length > 0, 'should have media');\n- if (messageInfo.media.length === 1) {\n- return this.renderImage(messageInfo.media[0], 0, allCorners);\n- }\n-\n- const mediaPerRow = getMediaPerRow(messageInfo.media.length);\n-\n- const rows = [];\n- for (let i = 0; i < messageInfo.media.length; i += mediaPerRow) {\n- const rowMedia = messageInfo.media.slice(i, i + mediaPerRow);\n-\n- const firstRow = i === 0;\n- const lastRow = i + mediaPerRow >= messageInfo.media.length;\n-\n- const row = [];\n- let j = 0;\n- for (; j < rowMedia.length; j++) {\n- const media = rowMedia[j];\n- const firstInRow = j === 0;\n- const lastInRow = j + 1 === rowMedia.length;\n- const inLastColumn = j + 1 === mediaPerRow;\n- const corners = {\n- topLeft: firstRow && firstInRow,\n- topRight: firstRow && inLastColumn,\n- bottomLeft: lastRow && firstInRow,\n- bottomRight: lastRow && inLastColumn,\n- };\n- const style = lastInRow ? null : styles.imageBeforeImage;\n- row.push(this.renderImage(media, i + j, corners, style));\n- }\n- for (; j < mediaPerRow; j++) {\n- const key = `filler${j}`;\n- const style =\n- j + 1 < mediaPerRow\n- ? [styles.filler, styles.imageBeforeImage]\n- : styles.filler;\n- row.push(<View style={style} key={key} />);\n- }\n-\n- const rowStyle = lastRow ? styles.row : [styles.row, styles.rowAboveRow];\n- rows.push(\n- <View style={rowStyle} key={i}>\n- {row}\n- </View>,\n- );\n- }\n- return <View style={styles.grid}>{rows}</View>;\n}\n- renderImage(\n- media: Media,\n- index: number,\n- corners: Corners,\n- style?: ViewStyle,\n- ): React.Node {\n- const filteredCorners = filterCorners(corners, this.props.item);\n- const roundedStyle = getRoundedContainerStyle(\n- filteredCorners,\n- borderRadius,\n- );\n- const { pendingUploads } = this.props.item;\n- const mediaInfo = {\n- ...media,\n- corners: filteredCorners,\n- index,\n- };\n- const pendingUpload = pendingUploads && pendingUploads[media.id];\n- return (\n- <MultimediaMessageMultimedia\n- mediaInfo={mediaInfo}\n- verticalBounds={this.props.verticalBounds}\n- style={[style, roundedStyle]}\n- postInProgress={!!pendingUploads}\n- pendingUpload={pendingUpload}\n- item={this.props.item}\n- key={index}\n- />\n- );\n- }\n-}\n-\n-const spaceBetweenImages = 4;\n-const styles = StyleSheet.create({\n- filler: {\n- flex: 1,\n- },\n- grid: {\n- flex: 1,\n- justifyContent: 'space-between',\n- },\n- imageBeforeImage: {\n- marginRight: spaceBetweenImages,\n- },\n- row: {\n- flex: 1,\n- flexDirection: 'row',\n- justifyContent: 'space-between',\n- },\n- rowAboveRow: {\n- marginBottom: spaceBetweenImages,\n- },\n-});\n-\nexport {\n- borderRadius as multimediaMessageBorderRadius,\nMultimediaMessage,\nmultimediaMessageContentSizes,\nmultimediaMessageItemHeight,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-tooltip-button.react.js", "new_path": "native/chat/multimedia-tooltip-button.react.js", "diff": "@@ -11,8 +11,8 @@ import type { AppNavigationProp } from '../navigation/app-navigator.react';\nimport type { TooltipRoute } from '../navigation/tooltip.react';\nimport { useSelector } from '../redux/redux-utils';\nimport InlineMultimedia from './inline-multimedia.react';\n+import { multimediaMessageBorderRadius } from './inner-multimedia-message.react';\nimport { MessageHeader } from './message-header.react';\n-import { multimediaMessageBorderRadius } from './multimedia-message.react';\nimport { getRoundedContainerStyle } from './rounded-corners';\n/* eslint-disable import/no-named-as-default-member */\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Introduce inner multimedia message Summary: Split multimedia message and create a new component which will be rendered by the tooltip. Test Plan: Open a thread with mutimedia message and check if it's rendered correctly Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1632
129,191
07.07.2021 11:03:03
-7,200
869bd0b9929872aed61662d17360714f8b30d576
[native] Change MultimediaMessage to be a functional component Summary: This allows us using hooks. Navigation and route props will be used in next diffs. Test Plan: Open a thread with multimedia message and check if it's correct Reviewers: ashoat Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/chat/multimedia-message.react.js", "new_path": "native/chat/multimedia-message.react.js", "diff": "// @flow\n+import type {\n+ LeafRoute,\n+ NavigationProp,\n+ ParamListBase,\n+} from '@react-navigation/native';\n+import { useNavigation, useRoute } from '@react-navigation/native';\nimport invariant from 'invariant';\nimport * as React from 'react';\nimport { View } from 'react-native';\n@@ -110,15 +116,27 @@ function multimediaMessageItemHeight(item: ChatMultimediaMessageInfoItem) {\nreturn height;\n}\n-type Props = {|\n+type BaseProps = {|\n...React.ElementConfig<typeof View>,\n+item: ChatMultimediaMessageInfoItem,\n+focused: boolean,\n+verticalBounds: ?VerticalBounds,\n|};\n+type Props = {|\n+ ...BaseProps,\n+ +navigation: NavigationProp<ParamListBase>,\n+ +route: LeafRoute<>,\n+|};\nclass MultimediaMessage extends React.PureComponent<Props> {\nrender() {\n- const { item, focused, verticalBounds, ...viewProps } = this.props;\n+ const {\n+ item,\n+ focused,\n+ verticalBounds,\n+ navigation,\n+ route,\n+ ...viewProps\n+ } = this.props;\nreturn (\n<ComposedMessage\nitem={item}\n@@ -132,8 +150,18 @@ class MultimediaMessage extends React.PureComponent<Props> {\n}\n}\n+const MultimediaMessageComponent: React.ComponentType<BaseProps> = React.memo<BaseProps>(\n+ function ConnectedMultimediaMessage(props: BaseProps) {\n+ const navigation = useNavigation();\n+ const route = useRoute();\n+ return (\n+ <MultimediaMessage {...props} navigation={navigation} route={route} />\n+ );\n+ },\n+);\n+\nexport {\n- MultimediaMessage,\n+ MultimediaMessageComponent as MultimediaMessage,\nmultimediaMessageContentSizes,\nmultimediaMessageItemHeight,\nsendFailed as multimediaMessageSendFailed,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Change MultimediaMessage to be a functional component Summary: This allows us using hooks. Navigation and route props will be used in next diffs. Test Plan: Open a thread with multimedia message and check if it's correct Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1633
129,191
07.07.2021 12:12:04
-7,200
0ba8cee32d9a10682803e90c00f0132fffbc633a
[native] Introduce multimedia message utils Summary: There are a couple of functions defined next to components and it causes circular dependencies. This diff moves the functions to one common place. Test Plan: Test multimedia message functionality. Reviewers: ashoat Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-item-height-measurer.react.js", "new_path": "native/chat/chat-item-height-measurer.react.js", "diff": "@@ -16,7 +16,7 @@ import { composedMessageMaxWidthSelector } from './composed-message-width';\nimport { dummyNodeForRobotextMessageHeightMeasurement } from './inner-robotext-message.react';\nimport { dummyNodeForTextMessageHeightMeasurement } from './inner-text-message.react';\nimport { MessageListContextProvider } from './message-list-types';\n-import { multimediaMessageContentSizes } from './multimedia-message.react';\n+import { multimediaMessageContentSizes } from './multimedia-message-utils';\ntype Props = {|\n+measurement: MeasurementTask,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/failed-send.react.js", "new_path": "native/chat/failed-send.react.js", "diff": "@@ -16,7 +16,7 @@ import { type InputState, InputStateContext } from '../input/input-state';\nimport { useSelector } from '../redux/redux-utils';\nimport { useStyles } from '../themes/colors';\nimport type { ChatMessageInfoItemWithHeight } from './message.react';\n-import multimediaMessageSendFailed from './multimedia-message-send-failed';\n+import { multimediaMessageSendFailed } from './multimedia-message-utils';\nimport textMessageSendFailed from './text-message-send-failed';\nconst failedSendHeight = 22;\n" }, { "change_type": "MODIFY", "old_path": "native/chat/inner-multimedia-message.react.js", "new_path": "native/chat/inner-multimedia-message.react.js", "diff": "@@ -8,29 +8,17 @@ import type { Corners, Media } from 'lib/types/media-types';\nimport type { VerticalBounds } from '../types/layout-types';\nimport type { ViewStyle } from '../types/styles';\nimport MultimediaMessageMultimedia from './multimedia-message-multimedia.react';\n-import type { ChatMultimediaMessageInfoItem } from './multimedia-message.react';\n+import {\n+ getMediaPerRow,\n+ spaceBetweenImages,\n+ type ChatMultimediaMessageInfoItem,\n+} from './multimedia-message-utils';\nimport {\nallCorners,\nfilterCorners,\ngetRoundedContainerStyle,\n} from './rounded-corners';\n-function getMediaPerRow(mediaCount: number) {\n- if (mediaCount === 0) {\n- return 0; // ???\n- } else if (mediaCount === 1) {\n- return 1;\n- } else if (mediaCount === 2) {\n- return 2;\n- } else if (mediaCount === 3) {\n- return 3;\n- } else if (mediaCount === 4) {\n- return 2;\n- } else {\n- return 3;\n- }\n-}\n-\nconst borderRadius = 16;\ntype Props = {|\n@@ -131,7 +119,6 @@ class InnerMultimediaMessage extends React.PureComponent<Props> {\n}\n}\n-const spaceBetweenImages = 4;\nconst styles = StyleSheet.create({\nfiller: {\nflex: 1,\n@@ -155,7 +142,5 @@ const styles = StyleSheet.create({\nexport {\nInnerMultimediaMessage,\n- getMediaPerRow,\n- spaceBetweenImages,\nborderRadius as multimediaMessageBorderRadius,\n};\n" }, { "change_type": "MODIFY", "old_path": "native/chat/message.react.js", "new_path": "native/chat/message.react.js", "diff": "@@ -17,11 +17,11 @@ import type { NavigationRoute } from '../navigation/route-names';\nimport { type VerticalBounds } from '../types/layout-types';\nimport type { LayoutEvent } from '../types/react-native';\nimport type { ChatNavigationProp } from './chat.react';\n-import type { ChatMultimediaMessageInfoItem } from './multimedia-message.react';\nimport {\n- MultimediaMessage,\nmultimediaMessageItemHeight,\n-} from './multimedia-message.react';\n+ type ChatMultimediaMessageInfoItem,\n+} from './multimedia-message-utils';\n+import MultimediaMessage from './multimedia-message.react';\nimport type { ChatRobotextMessageInfoItemWithHeight } from './robotext-message.react';\nimport {\nRobotextMessage,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-message-multimedia.react.js", "new_path": "native/chat/multimedia-message-multimedia.react.js", "diff": "@@ -32,7 +32,7 @@ import { type Colors, useColors } from '../themes/colors';\nimport { type VerticalBounds } from '../types/layout-types';\nimport type { ViewStyle } from '../types/styles';\nimport InlineMultimedia from './inline-multimedia.react';\n-import type { ChatMultimediaMessageInfoItem } from './multimedia-message.react';\n+import type { ChatMultimediaMessageInfoItem } from './multimedia-message-utils';\n/* eslint-disable import/no-named-as-default-member */\nconst { Value, sub, interpolate, Extrapolate } = Animated;\n" }, { "change_type": "DELETE", "old_path": "native/chat/multimedia-message-send-failed.js", "new_path": null, "diff": "-// @flow\n-\n-import type { ChatMultimediaMessageInfoItem } from './multimedia-message.react';\n-\n-export default function multimediaMessageSendFailed(\n- item: ChatMultimediaMessageInfoItem,\n-): boolean {\n- const { messageInfo, localMessageInfo, pendingUploads } = item;\n- const { id: serverID } = messageInfo;\n- if (serverID !== null && serverID !== undefined) {\n- return false;\n- }\n-\n- const { isViewer } = messageInfo.creator;\n- if (!isViewer) {\n- return false;\n- }\n-\n- if (localMessageInfo && localMessageInfo.sendFailed) {\n- return true;\n- }\n-\n- for (const media of messageInfo.media) {\n- const pendingUpload = pendingUploads && pendingUploads[media.id];\n- if (pendingUpload && pendingUpload.failed) {\n- return true;\n- }\n- }\n-\n- return !pendingUploads;\n-}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/chat/multimedia-message-utils.js", "diff": "+// @flow\n+\n+import invariant from 'invariant';\n+\n+import type {\n+ LocalMessageInfo,\n+ MultimediaMessageInfo,\n+} from 'lib/types/message-types';\n+import type { ThreadInfo } from 'lib/types/thread-types';\n+\n+import type { MessagePendingUploads } from '../input/input-state';\n+import { clusterEndHeight } from './composed-message.react';\n+import { failedSendHeight } from './failed-send.react';\n+import {\n+ inlineSidebarHeight,\n+ inlineSidebarMarginBottom,\n+ inlineSidebarMarginTop,\n+} from './inline-sidebar.react';\n+import { authorNameHeight } from './message-header.react';\n+\n+type ContentSizes = {|\n+ +imageHeight: number,\n+ +contentHeight: number,\n+ +contentWidth: number,\n+|};\n+export type ChatMultimediaMessageInfoItem = {|\n+ ...ContentSizes,\n+ +itemType: 'message',\n+ +messageShapeType: 'multimedia',\n+ +messageInfo: MultimediaMessageInfo,\n+ +localMessageInfo: ?LocalMessageInfo,\n+ +threadInfo: ThreadInfo,\n+ +startsConversation: boolean,\n+ +startsCluster: boolean,\n+ +endsCluster: boolean,\n+ +threadCreatedFromMessage: ?ThreadInfo,\n+ +pendingUploads: ?MessagePendingUploads,\n+|};\n+\n+const spaceBetweenImages = 4;\n+\n+function getMediaPerRow(mediaCount: number): number {\n+ if (mediaCount === 0) {\n+ return 0; // ???\n+ } else if (mediaCount === 1) {\n+ return 1;\n+ } else if (mediaCount === 2) {\n+ return 2;\n+ } else if (mediaCount === 3) {\n+ return 3;\n+ } else if (mediaCount === 4) {\n+ return 2;\n+ } else {\n+ return 3;\n+ }\n+}\n+\n+function multimediaMessageSendFailed(\n+ item: ChatMultimediaMessageInfoItem,\n+): boolean {\n+ const { messageInfo, localMessageInfo, pendingUploads } = item;\n+ const { id: serverID } = messageInfo;\n+ if (serverID !== null && serverID !== undefined) {\n+ return false;\n+ }\n+\n+ const { isViewer } = messageInfo.creator;\n+ if (!isViewer) {\n+ return false;\n+ }\n+\n+ if (localMessageInfo && localMessageInfo.sendFailed) {\n+ return true;\n+ }\n+\n+ for (const media of messageInfo.media) {\n+ const pendingUpload = pendingUploads && pendingUploads[media.id];\n+ if (pendingUpload && pendingUpload.failed) {\n+ return true;\n+ }\n+ }\n+\n+ return !pendingUploads;\n+}\n+\n+// The results are merged into ChatMultimediaMessageInfoItem\n+function multimediaMessageContentSizes(\n+ messageInfo: MultimediaMessageInfo,\n+ composedMessageMaxWidth: number,\n+): ContentSizes {\n+ invariant(messageInfo.media.length > 0, 'should have media');\n+\n+ if (messageInfo.media.length === 1) {\n+ const [media] = messageInfo.media;\n+ const { height, width } = media.dimensions;\n+\n+ let imageHeight = height;\n+ if (width > composedMessageMaxWidth) {\n+ imageHeight = (height * composedMessageMaxWidth) / width;\n+ }\n+ if (imageHeight < 50) {\n+ imageHeight = 50;\n+ }\n+\n+ let contentWidth = height ? (width * imageHeight) / height : 0;\n+ if (contentWidth > composedMessageMaxWidth) {\n+ contentWidth = composedMessageMaxWidth;\n+ }\n+\n+ return { imageHeight, contentHeight: imageHeight, contentWidth };\n+ }\n+\n+ const contentWidth = composedMessageMaxWidth;\n+\n+ const mediaPerRow = getMediaPerRow(messageInfo.media.length);\n+ const marginSpace = spaceBetweenImages * (mediaPerRow - 1);\n+ const imageHeight = (contentWidth - marginSpace) / mediaPerRow;\n+\n+ const numRows = Math.ceil(messageInfo.media.length / mediaPerRow);\n+ const contentHeight =\n+ numRows * imageHeight + (numRows - 1) * spaceBetweenImages;\n+\n+ return { imageHeight, contentHeight, contentWidth };\n+}\n+\n+// Given a ChatMultimediaMessageInfoItem, determines exact height of row\n+function multimediaMessageItemHeight(\n+ item: ChatMultimediaMessageInfoItem,\n+): number {\n+ const { messageInfo, contentHeight, startsCluster, endsCluster } = item;\n+ const { creator } = messageInfo;\n+ const { isViewer } = creator;\n+ let height = 5 + contentHeight; // 5 from marginBottom in ComposedMessage\n+ if (!isViewer && startsCluster) {\n+ height += authorNameHeight;\n+ }\n+ if (endsCluster) {\n+ height += clusterEndHeight;\n+ }\n+ if (multimediaMessageSendFailed(item)) {\n+ height += failedSendHeight;\n+ }\n+ if (item.threadCreatedFromMessage) {\n+ height +=\n+ inlineSidebarHeight + inlineSidebarMarginTop + inlineSidebarMarginBottom;\n+ }\n+ return height;\n+}\n+\n+export {\n+ multimediaMessageContentSizes,\n+ multimediaMessageItemHeight,\n+ multimediaMessageSendFailed,\n+ getMediaPerRow,\n+ spaceBetweenImages,\n+};\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-message.react.js", "new_path": "native/chat/multimedia-message.react.js", "diff": "@@ -6,115 +6,16 @@ import type {\nParamListBase,\n} from '@react-navigation/native';\nimport { useNavigation, useRoute } from '@react-navigation/native';\n-import invariant from 'invariant';\nimport * as React from 'react';\nimport { View } from 'react-native';\n-import type {\n- MultimediaMessageInfo,\n- LocalMessageInfo,\n-} from 'lib/types/message-types';\n-import type { ThreadInfo } from 'lib/types/thread-types';\n-\n-import type { MessagePendingUploads } from '../input/input-state';\nimport { type VerticalBounds } from '../types/layout-types';\n-import { ComposedMessage, clusterEndHeight } from './composed-message.react';\n-import { failedSendHeight } from './failed-send.react';\n+import { ComposedMessage } from './composed-message.react';\n+import { InnerMultimediaMessage } from './inner-multimedia-message.react';\nimport {\n- inlineSidebarHeight,\n- inlineSidebarMarginBottom,\n- inlineSidebarMarginTop,\n-} from './inline-sidebar.react';\n-import {\n- getMediaPerRow,\n- InnerMultimediaMessage,\n- spaceBetweenImages,\n-} from './inner-multimedia-message.react';\n-import { authorNameHeight } from './message-header.react';\n-import sendFailed from './multimedia-message-send-failed';\n-\n-type ContentSizes = {|\n- +imageHeight: number,\n- +contentHeight: number,\n- +contentWidth: number,\n-|};\n-export type ChatMultimediaMessageInfoItem = {|\n- ...ContentSizes,\n- +itemType: 'message',\n- +messageShapeType: 'multimedia',\n- +messageInfo: MultimediaMessageInfo,\n- +localMessageInfo: ?LocalMessageInfo,\n- +threadInfo: ThreadInfo,\n- +startsConversation: boolean,\n- +startsCluster: boolean,\n- +endsCluster: boolean,\n- +threadCreatedFromMessage: ?ThreadInfo,\n- +pendingUploads: ?MessagePendingUploads,\n-|};\n-\n-// Called by MessageListContainer\n-// The results are merged into ChatMultimediaMessageInfoItem\n-function multimediaMessageContentSizes(\n- messageInfo: MultimediaMessageInfo,\n- composedMessageMaxWidth: number,\n-): ContentSizes {\n- invariant(messageInfo.media.length > 0, 'should have media');\n-\n- if (messageInfo.media.length === 1) {\n- const [media] = messageInfo.media;\n- const { height, width } = media.dimensions;\n-\n- let imageHeight = height;\n- if (width > composedMessageMaxWidth) {\n- imageHeight = (height * composedMessageMaxWidth) / width;\n- }\n- if (imageHeight < 50) {\n- imageHeight = 50;\n- }\n-\n- let contentWidth = height ? (width * imageHeight) / height : 0;\n- if (contentWidth > composedMessageMaxWidth) {\n- contentWidth = composedMessageMaxWidth;\n- }\n-\n- return { imageHeight, contentHeight: imageHeight, contentWidth };\n- }\n-\n- const contentWidth = composedMessageMaxWidth;\n-\n- const mediaPerRow = getMediaPerRow(messageInfo.media.length);\n- const marginSpace = spaceBetweenImages * (mediaPerRow - 1);\n- const imageHeight = (contentWidth - marginSpace) / mediaPerRow;\n-\n- const numRows = Math.ceil(messageInfo.media.length / mediaPerRow);\n- const contentHeight =\n- numRows * imageHeight + (numRows - 1) * spaceBetweenImages;\n-\n- return { imageHeight, contentHeight, contentWidth };\n-}\n-\n-// Called by Message\n-// Given a ChatMultimediaMessageInfoItem, determines exact height of row\n-function multimediaMessageItemHeight(item: ChatMultimediaMessageInfoItem) {\n- const { messageInfo, contentHeight, startsCluster, endsCluster } = item;\n- const { creator } = messageInfo;\n- const { isViewer } = creator;\n- let height = 5 + contentHeight; // 5 from marginBottom in ComposedMessage\n- if (!isViewer && startsCluster) {\n- height += authorNameHeight;\n- }\n- if (endsCluster) {\n- height += clusterEndHeight;\n- }\n- if (sendFailed(item)) {\n- height += failedSendHeight;\n- }\n- if (item.threadCreatedFromMessage) {\n- height +=\n- inlineSidebarHeight + inlineSidebarMarginTop + inlineSidebarMarginBottom;\n- }\n- return height;\n-}\n+ type ChatMultimediaMessageInfoItem,\n+ multimediaMessageSendFailed,\n+} from './multimedia-message-utils';\ntype BaseProps = {|\n...React.ElementConfig<typeof View>,\n@@ -140,7 +41,7 @@ class MultimediaMessage extends React.PureComponent<Props> {\nreturn (\n<ComposedMessage\nitem={item}\n- sendFailed={sendFailed(item)}\n+ sendFailed={multimediaMessageSendFailed(item)}\nfocused={focused}\n{...viewProps}\n>\n@@ -150,7 +51,7 @@ class MultimediaMessage extends React.PureComponent<Props> {\n}\n}\n-const MultimediaMessageComponent: React.ComponentType<BaseProps> = React.memo<BaseProps>(\n+const ConnectedMultimediaMessage: React.ComponentType<BaseProps> = React.memo<BaseProps>(\nfunction ConnectedMultimediaMessage(props: BaseProps) {\nconst navigation = useNavigation();\nconst route = useRoute();\n@@ -160,9 +61,4 @@ const MultimediaMessageComponent: React.ComponentType<BaseProps> = React.memo<Ba\n},\n);\n-export {\n- MultimediaMessageComponent as MultimediaMessage,\n- multimediaMessageContentSizes,\n- multimediaMessageItemHeight,\n- sendFailed as multimediaMessageSendFailed,\n-};\n+export default ConnectedMultimediaMessage;\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-tooltip-modal.react.js", "new_path": "native/chat/multimedia-tooltip-modal.react.js", "diff": "@@ -7,7 +7,7 @@ import {\ntooltipHeight,\ntype TooltipParams,\n} from '../navigation/tooltip.react';\n-import type { ChatMultimediaMessageInfoItem } from './multimedia-message.react';\n+import type { ChatMultimediaMessageInfoItem } from './multimedia-message-utils';\nimport MultimediaTooltipButton from './multimedia-tooltip-button.react';\nimport { navigateToSidebar } from './sidebar-navigation';\n" }, { "change_type": "MODIFY", "old_path": "native/media/image-modal.react.js", "new_path": "native/media/image-modal.react.js", "diff": "@@ -21,7 +21,7 @@ import Animated from 'react-native-reanimated';\nimport { type MediaInfo, type Dimensions } from 'lib/types/media-types';\nimport { useIsReportEnabled } from 'lib/utils/report-utils';\n-import type { ChatMultimediaMessageInfoItem } from '../chat/multimedia-message.react';\n+import type { ChatMultimediaMessageInfoItem } from '../chat/multimedia-message-utils';\nimport SWMansionIcon from '../components/swmansion-icon.react';\nimport ConnectedStatusBar from '../connected-status-bar.react';\nimport type { AppNavigationProp } from '../navigation/app-navigator.react';\n" }, { "change_type": "MODIFY", "old_path": "native/media/video-playback-modal.react.js", "new_path": "native/media/video-playback-modal.react.js", "diff": "@@ -13,7 +13,7 @@ import Video from 'react-native-video';\nimport { useIsAppBackgroundedOrInactive } from 'lib/shared/lifecycle-utils';\nimport type { MediaInfo } from 'lib/types/media-types';\n-import type { ChatMultimediaMessageInfoItem } from '../chat/multimedia-message.react';\n+import type { ChatMultimediaMessageInfoItem } from '../chat/multimedia-message-utils';\nimport ConnectedStatusBar from '../connected-status-bar.react';\nimport type { AppNavigationProp } from '../navigation/app-navigator.react';\nimport { OverlayContext } from '../navigation/overlay-context';\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Introduce multimedia message utils Summary: There are a couple of functions defined next to components and it causes circular dependencies. This diff moves the functions to one common place. Test Plan: Test multimedia message functionality. Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1634
129,191
07.07.2021 12:19:55
-7,200
198ff4026d384ba972a74e60574f188cfc6d833a
[native] Extract stableKey to a common place Summary: This function will be used in two places so I extracted it to a common place Test Plan: Open multimedia modal. Reviewers: ashoat Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/chat/multimedia-message-multimedia.react.js", "new_path": "native/chat/multimedia-message-multimedia.react.js", "diff": "@@ -12,7 +12,6 @@ import * as React from 'react';\nimport { View, StyleSheet } from 'react-native';\nimport Animated from 'react-native-reanimated';\n-import { messageKey } from 'lib/shared/message-utils';\nimport { type MediaInfo } from 'lib/types/media-types';\nimport { type PendingMultimediaUpload } from '../input/input-state';\n@@ -32,7 +31,10 @@ import { type Colors, useColors } from '../themes/colors';\nimport { type VerticalBounds } from '../types/layout-types';\nimport type { ViewStyle } from '../types/styles';\nimport InlineMultimedia from './inline-multimedia.react';\n-import type { ChatMultimediaMessageInfoItem } from './multimedia-message-utils';\n+import {\n+ type ChatMultimediaMessageInfoItem,\n+ getMediaKey,\n+} from './multimedia-message-utils';\n/* eslint-disable import/no-named-as-default-member */\nconst { Value, sub, interpolate, Extrapolate } = Animated;\n@@ -71,11 +73,6 @@ class MultimediaMessageMultimedia extends React.PureComponent<Props, State> {\n};\n}\n- static getStableKey(props: Props) {\n- const { item, mediaInfo } = props;\n- return `multimedia|${messageKey(item.messageInfo)}|${mediaInfo.index}`;\n- }\n-\nstatic getOverlayContext(props: Props) {\nconst { overlayContext } = props;\ninvariant(\n@@ -92,7 +89,7 @@ class MultimediaMessageMultimedia extends React.PureComponent<Props, State> {\nif (\noverlay.routeName === ImageModalRouteName &&\noverlay.presentedFrom === props.route.key &&\n- overlay.routeKey === MultimediaMessageMultimedia.getStableKey(props)\n+ overlay.routeKey === getMediaKey(props.item, props.mediaInfo)\n) {\nreturn overlay.position;\n}\n@@ -196,7 +193,7 @@ class MultimediaMessageMultimedia extends React.PureComponent<Props, State> {\nmediaInfo.type === 'video'\n? VideoPlaybackModalRouteName\n: ImageModalRouteName,\n- key: MultimediaMessageMultimedia.getStableKey(this.props),\n+ key: getMediaKey(item, mediaInfo),\nparams: {\npresentedFrom: this.props.route.key,\nmediaInfo,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-message-utils.js", "new_path": "native/chat/multimedia-message-utils.js", "diff": "import invariant from 'invariant';\n+import { messageKey } from 'lib/shared/message-utils';\n+import type { MediaInfo } from 'lib/types/media-types';\nimport type {\nLocalMessageInfo,\nMultimediaMessageInfo,\n@@ -147,10 +149,18 @@ function multimediaMessageItemHeight(\nreturn height;\n}\n+function getMediaKey(\n+ item: ChatMultimediaMessageInfoItem,\n+ mediaInfo: MediaInfo,\n+): string {\n+ return `multimedia|${messageKey(item.messageInfo)}|${mediaInfo.index}`;\n+}\n+\nexport {\nmultimediaMessageContentSizes,\nmultimediaMessageItemHeight,\nmultimediaMessageSendFailed,\ngetMediaPerRow,\nspaceBetweenImages,\n+ getMediaKey,\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Extract stableKey to a common place Summary: This function will be used in two places so I extracted it to a common place Test Plan: Open multimedia modal. Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1635
129,191
07.07.2021 13:50:09
-7,200
1a7d3f84b54058fe929084be1bf85a2d587da5e3
[native] Add on press props Summary: Add an option to provide onPress callbacks. We will use onLongPress later to display a tooltip. Test Plan: Check if opening image modal still works. Reviewers: ashoat Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/chat/inline-multimedia.react.js", "new_path": "native/chat/inline-multimedia.react.js", "diff": "// @flow\nimport * as React from 'react';\n-import { View, StyleSheet, Text, TouchableWithoutFeedback } from 'react-native';\n+import { View, StyleSheet, Text } from 'react-native';\nimport * as Progress from 'react-native-progress';\nimport Icon from 'react-native-vector-icons/Feather';\nimport IonIcon from 'react-native-vector-icons/Ionicons';\n@@ -92,7 +92,6 @@ function InlineMultimedia(props: Props) {\n}\nreturn (\n- <TouchableWithoutFeedback>\n<View style={styles.expand}>\n<GestureTouchableOpacity\nonPress={props.onPress}\n@@ -103,7 +102,6 @@ function InlineMultimedia(props: Props) {\n{progressIndicator ? progressIndicator : playButton}\n</GestureTouchableOpacity>\n</View>\n- </TouchableWithoutFeedback>\n);\n}\n" }, { "change_type": "MODIFY", "old_path": "native/chat/inner-multimedia-message.react.js", "new_path": "native/chat/inner-multimedia-message.react.js", "diff": "// @flow\nimport invariant from 'invariant';\nimport * as React from 'react';\n-import { StyleSheet, View } from 'react-native';\n+import { StyleSheet, TouchableWithoutFeedback, View } from 'react-native';\nimport type { Corners, Media, MediaInfo } from 'lib/types/media-types';\n@@ -30,6 +30,8 @@ type Props = {|\n) => void,\n+clickable: boolean,\n+setClickable: (boolean) => void,\n+ +onPress?: () => void,\n+ +onLongPress?: () => void,\n|};\nclass InnerMultimediaMessage extends React.PureComponent<Props> {\nrender() {\n@@ -38,7 +40,14 @@ class InnerMultimediaMessage extends React.PureComponent<Props> {\nheight: item.contentHeight,\nwidth: item.contentWidth,\n};\n- return <View style={containerStyle}>{this.renderContent()}</View>;\n+ return (\n+ <TouchableWithoutFeedback\n+ onPress={this.props.onPress}\n+ onLongPress={this.props.onLongPress}\n+ >\n+ <View style={containerStyle}>{this.renderContent()}</View>\n+ </TouchableWithoutFeedback>\n+ );\n}\nrenderContent(): React.Node {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Add on press props Summary: Add an option to provide onPress callbacks. We will use onLongPress later to display a tooltip. Test Plan: Check if opening image modal still works. Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1638
129,191
07.07.2021 13:56:50
-7,200
3d2525896eef05f26ec39e1882e0b3499ac94dc7
[native] Render the whole message as a tooltip button Summary: Render inner multimedia message and modify navigation props to contain exactly the info that is needed Test Plan: Tested with the next diff Reviewers: ashoat Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/chat/multimedia-tooltip-button.react.js", "new_path": "native/chat/multimedia-tooltip-button.react.js", "diff": "// @flow\nimport * as React from 'react';\n-import { View, StyleSheet } from 'react-native';\nimport Animated from 'react-native-reanimated';\n-import { messageID } from 'lib/shared/message-utils';\n-\n-import { InputStateContext } from '../input/input-state';\nimport type { AppNavigationProp } from '../navigation/app-navigator.react';\nimport type { TooltipRoute } from '../navigation/tooltip.react';\nimport { useSelector } from '../redux/redux-utils';\n-import InlineMultimedia from './inline-multimedia.react';\n-import { multimediaMessageBorderRadius } from './inner-multimedia-message.react';\n+import { InnerMultimediaMessage } from './inner-multimedia-message.react';\nimport { MessageHeader } from './message-header.react';\n-import { getRoundedContainerStyle } from './rounded-corners';\n/* eslint-disable import/no-named-as-default-member */\nconst { Value } = Animated;\n/* eslint-enable import/no-named-as-default-member */\n+function noop() {}\n+\ntype Props = {|\n+navigation: AppNavigationProp<'MultimediaTooltipModal'>,\n+route: TooltipRoute<'MultimediaTooltipModal'>,\n@@ -27,9 +23,9 @@ type Props = {|\nfunction MultimediaTooltipButton(props: Props): React.Node {\nconst windowWidth = useSelector((state) => state.dimensions.width);\nconst { progress } = props;\n- const { initialCoordinates, verticalOffset } = props.route.params;\n+ const { initialCoordinates } = props.route.params;\nconst headerStyle = React.useMemo(() => {\n- const bottom = initialCoordinates.height + verticalOffset;\n+ const bottom = initialCoordinates.height;\nreturn {\nopacity: progress,\nposition: 'absolute',\n@@ -37,55 +33,25 @@ function MultimediaTooltipButton(props: Props): React.Node {\nwidth: windowWidth,\nbottom,\n};\n- }, [\n- initialCoordinates.height,\n- initialCoordinates.x,\n- progress,\n- verticalOffset,\n- windowWidth,\n- ]);\n-\n- const { mediaInfo, item } = props.route.params;\n- const { id: mediaID } = mediaInfo;\n- const ourMessageID = messageID(item.messageInfo);\n- const inputState = React.useContext(InputStateContext);\n- const pendingUploads =\n- inputState &&\n- inputState.pendingUploads &&\n- inputState.pendingUploads[ourMessageID];\n- const pendingUpload = pendingUploads && pendingUploads[mediaID];\n- const postInProgress = !!pendingUploads;\n-\n- const roundedStyle = getRoundedContainerStyle(\n- mediaInfo.corners,\n- multimediaMessageBorderRadius,\n- );\n+ }, [initialCoordinates.height, initialCoordinates.x, progress, windowWidth]);\n+ const { item, verticalBounds } = props.route.params;\nconst { navigation } = props;\nreturn (\n<React.Fragment>\n<Animated.View style={headerStyle}>\n<MessageHeader item={item} focused={true} display=\"modal\" />\n</Animated.View>\n- <View style={[styles.media, roundedStyle]}>\n- <InlineMultimedia\n- mediaInfo={mediaInfo}\n+ <InnerMultimediaMessage\n+ item={item}\n+ verticalBounds={verticalBounds}\n+ clickable={false}\n+ setClickable={noop}\nonPress={navigation.goBackOnce}\nonLongPress={navigation.goBackOnce}\n- postInProgress={postInProgress}\n- pendingUpload={pendingUpload}\n- spinnerColor=\"white\"\n/>\n- </View>\n</React.Fragment>\n);\n}\n-const styles = StyleSheet.create({\n- media: {\n- flex: 1,\n- overflow: 'hidden',\n- },\n-});\n-\nexport default React.memo<Props>(MultimediaTooltipButton);\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-tooltip-modal.react.js", "new_path": "native/chat/multimedia-tooltip-modal.react.js", "diff": "// @flow\n-import type { MediaInfo } from 'lib/types/media-types';\n-\nimport {\ncreateTooltip,\ntooltipHeight,\ntype TooltipParams,\n} from '../navigation/tooltip.react';\n+import type { VerticalBounds } from '../types/layout-types';\nimport type { ChatMultimediaMessageInfoItem } from './multimedia-message-utils';\nimport MultimediaTooltipButton from './multimedia-tooltip-button.react';\nimport { navigateToSidebar } from './sidebar-navigation';\nexport type MultimediaTooltipModalParams = TooltipParams<{|\n+item: ChatMultimediaMessageInfoItem,\n- +mediaInfo: MediaInfo,\n- +verticalOffset: number,\n+ +verticalBounds: VerticalBounds,\n|}>;\nconst spec = {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Render the whole message as a tooltip button Summary: Render inner multimedia message and modify navigation props to contain exactly the info that is needed Test Plan: Tested with the next diff Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1639
129,191
07.07.2021 14:14:48
-7,200
3e0529c1ef977c3f19189d28c4889adcebbb280a
[native] Open modal on long press Summary: Measure the message and navigate to the modal. Test Plan: Long press a multimedia message with multiple images and check if the whole message was highlighted. Reviewers: ashoat Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/chat/message.react.js", "new_path": "native/chat/message.react.js", "diff": "@@ -92,6 +92,7 @@ class Message extends React.PureComponent<Props> {\n<MultimediaMessage\nitem={this.props.item}\nfocused={this.props.focused}\n+ toggleFocus={this.props.toggleFocus}\nverticalBounds={this.props.verticalBounds}\n/>\n);\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-message.react.js", "new_path": "native/chat/multimedia-message.react.js", "diff": "@@ -7,12 +7,17 @@ import type {\n} from '@react-navigation/native';\nimport { useNavigation, useRoute } from '@react-navigation/native';\nimport * as React from 'react';\n-import { View } from 'react-native';\n+import { StyleSheet, View } from 'react-native';\n+import { messageKey } from 'lib/shared/message-utils';\n+import { useCanCreateSidebarFromMessage } from 'lib/shared/thread-utils';\nimport type { MediaInfo } from 'lib/types/media-types';\n+import { OverlayContext } from '../navigation/overlay-context';\n+import type { OverlayContextType } from '../navigation/overlay-context';\nimport {\nImageModalRouteName,\n+ MultimediaTooltipModalRouteName,\nVideoPlaybackModalRouteName,\n} from '../navigation/route-names';\nimport { type VerticalBounds } from '../types/layout-types';\n@@ -24,17 +29,21 @@ import {\ngetMediaKey,\nmultimediaMessageSendFailed,\n} from './multimedia-message-utils';\n+import { multimediaTooltipHeight } from './multimedia-tooltip-modal.react';\ntype BaseProps = {|\n...React.ElementConfig<typeof View>,\n+item: ChatMultimediaMessageInfoItem,\n+focused: boolean,\n+ +toggleFocus: (messageKey: string) => void,\n+verticalBounds: ?VerticalBounds,\n|};\ntype Props = {|\n...BaseProps,\n+navigation: NavigationProp<ParamListBase>,\n+route: LeafRoute<>,\n+ +overlayContext: ?OverlayContextType,\n+ +canCreateSidebarFromMessage: boolean,\n|};\ntype State = {|\n+clickable: boolean,\n@@ -43,6 +52,7 @@ class MultimediaMessage extends React.PureComponent<Props, State> {\nstate: State = {\nclickable: true,\n};\n+ view: ?React.ElementRef<typeof View>;\nsetClickable = (clickable: boolean) => {\nthis.setState({ clickable });\n@@ -69,13 +79,99 @@ class MultimediaMessage extends React.PureComponent<Props, State> {\n});\n};\n+ visibleEntryIDs() {\n+ const result = [];\n+\n+ if (this.props.item.threadCreatedFromMessage) {\n+ result.push('open_sidebar');\n+ } else if (this.props.canCreateSidebarFromMessage) {\n+ result.push('create_sidebar');\n+ }\n+\n+ return result;\n+ }\n+\n+ onLayout = () => {};\n+\n+ viewRef = (view: ?React.ElementRef<typeof View>) => {\n+ this.view = view;\n+ };\n+\n+ onLongPress = () => {\n+ const visibleEntryIDs = this.visibleEntryIDs();\n+ if (visibleEntryIDs.length === 0) {\n+ return;\n+ }\n+\n+ const {\n+ view,\n+ props: { verticalBounds },\n+ } = this;\n+ if (!view || !verticalBounds) {\n+ return;\n+ }\n+\n+ if (!this.state.clickable) {\n+ return;\n+ }\n+ this.setClickable(false);\n+\n+ const { item } = this.props;\n+ if (!this.props.focused) {\n+ this.props.toggleFocus(messageKey(item.messageInfo));\n+ }\n+\n+ this.props.overlayContext?.setScrollBlockingModalStatus('open');\n+\n+ view.measure((x, y, width, height, pageX, pageY) => {\n+ const coordinates = { x: pageX, y: pageY, width, height };\n+\n+ const multimediaTop = pageY;\n+ const multimediaBottom = pageY + height;\n+ const boundsTop = verticalBounds.y;\n+ const boundsBottom = verticalBounds.y + verticalBounds.height;\n+\n+ const belowMargin = 20;\n+ const belowSpace = multimediaTooltipHeight + belowMargin;\n+ const { isViewer } = item.messageInfo.creator;\n+ const aboveMargin = isViewer ? 30 : 50;\n+ const aboveSpace = multimediaTooltipHeight + aboveMargin;\n+\n+ let location = 'below',\n+ margin = belowMargin;\n+ if (\n+ multimediaBottom + belowSpace > boundsBottom &&\n+ multimediaTop - aboveSpace > boundsTop\n+ ) {\n+ location = 'above';\n+ margin = aboveMargin;\n+ }\n+\n+ this.props.navigation.navigate({\n+ name: MultimediaTooltipModalRouteName,\n+ params: {\n+ presentedFrom: this.props.route.key,\n+ item,\n+ initialCoordinates: coordinates,\n+ verticalBounds,\n+ location,\n+ margin,\n+ visibleEntryIDs,\n+ },\n+ });\n+ });\n+ };\n+\nrender() {\nconst {\nitem,\nfocused,\n+ toggleFocus,\nverticalBounds,\nnavigation,\nroute,\n+ overlayContext,\n+ canCreateSidebarFromMessage,\n...viewProps\n} = this.props;\nreturn (\n@@ -85,24 +181,44 @@ class MultimediaMessage extends React.PureComponent<Props, State> {\nfocused={focused}\n{...viewProps}\n>\n+ <View style={styles.expand} onLayout={this.onLayout} ref={this.viewRef}>\n<InnerMultimediaMessage\nitem={item}\nverticalBounds={verticalBounds}\nonPressMultimedia={this.onPressMultimedia}\nclickable={this.state.clickable}\nsetClickable={this.setClickable}\n+ onLongPress={this.onLongPress}\n/>\n+ </View>\n</ComposedMessage>\n);\n}\n}\n+const styles = StyleSheet.create({\n+ expand: {\n+ flex: 1,\n+ },\n+});\n+\nconst ConnectedMultimediaMessage: React.ComponentType<BaseProps> = React.memo<BaseProps>(\nfunction ConnectedMultimediaMessage(props: BaseProps) {\nconst navigation = useNavigation();\nconst route = useRoute();\n+ const overlayContext = React.useContext(OverlayContext);\n+ const canCreateSidebarFromMessage = useCanCreateSidebarFromMessage(\n+ props.item.threadInfo,\n+ props.item.messageInfo,\n+ );\nreturn (\n- <MultimediaMessage {...props} navigation={navigation} route={route} />\n+ <MultimediaMessage\n+ {...props}\n+ navigation={navigation}\n+ route={route}\n+ overlayContext={overlayContext}\n+ canCreateSidebarFromMessage={canCreateSidebarFromMessage}\n+ />\n);\n},\n);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Open modal on long press Summary: Measure the message and navigate to the modal. Test Plan: Long press a multimedia message with multiple images and check if the whole message was highlighted. Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1640
129,191
09.07.2021 16:10:20
-7,200
a54630f74e4c13109dac42f4eaed5cc25a9ebdc2
[native] Delete onLongPress prop from InlineMultimedia Summary: It's no longer needed. OnLongPress is handled on message level instead. Test Plan: Flow Reviewers: ashoat Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/chat/inline-multimedia.react.js", "new_path": "native/chat/inline-multimedia.react.js", "diff": "@@ -17,7 +17,6 @@ import Multimedia from '../media/multimedia.react';\ntype Props = {|\n+mediaInfo: MediaInfo,\n+onPress: () => void,\n- +onLongPress?: () => void,\n+postInProgress: boolean,\n+pendingUpload: ?PendingMultimediaUpload,\n+spinnerColor: string,\n@@ -93,11 +92,7 @@ function InlineMultimedia(props: Props) {\nreturn (\n<View style={styles.expand}>\n- <GestureTouchableOpacity\n- onPress={props.onPress}\n- onLongPress={props.onLongPress}\n- style={styles.expand}\n- >\n+ <GestureTouchableOpacity onPress={props.onPress} style={styles.expand}>\n<Multimedia mediaInfo={mediaInfo} spinnerColor={props.spinnerColor} />\n{progressIndicator ? progressIndicator : playButton}\n</GestureTouchableOpacity>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Delete onLongPress prop from InlineMultimedia Summary: It's no longer needed. OnLongPress is handled on message level instead. Test Plan: Flow Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1649