Compare commits

..
Author SHA1 Message Date
Siddarth Kumar 64dba60029 first draft 2023-07-13 17:33:11 +05:30
9 changed files with 118 additions and 71 deletions
+1 -1
View File
@@ -1 +1 @@
1.24.0
1.23.0
+65
View File
@@ -0,0 +1,65 @@
# Git Etiquette Guide
To ensure smooth collaboration, we've outlined the following Git etiquette guide. This guide will help in writing concise commit messages, managing git branches, pull request descriptions, and other best practices.
## 1. Commit Messages
Your commit message should provide clear context about the change. This allows others (and future you) to understand why a particular change was made.
Here are the guidelines to write concise and meaningful commit messages:
- **Use the Imperative Mood**: Commit messages should be written in the present tense and imperative mood ("Add feature" not "Added feature" or "Adds feature").
- **First Line Should Be Summary**: The first line of your commit message should be a brief summary of the changes, kept under 50 characters whenever possible.
- **Body**: Follow this summary line with a blank line, then a more detailed explanation is always helpful but not necessary. This is often useful when the commit has significant importance or complexity.
- **Consider Including the 'Why'**: If the commit resolves an issue or bug, mention the issue number and provide a brief explanation of how the changes fix the issue.
Here's a good commit message example:
```
Fix off-by-one error in loop (issue #123)
This commit fixes an off-by-one error in the list iteration function.
This was causing an index out of bounds exception when processing the last item in the list.
Tests have been updated to catch this in the future.
```
## 2. Branch Management
Git branches should be concise and focused on a single feature, fix, or improvement. Here are a few practices:
- **Branch Name**: The branch name should be descriptive of the change and follow a specific format such as `type/description`. Example: `feature/login-system`.
- **Please don't accept branch recommendation by Github UI**: The branch name recommendation by Github UI will in most cases be a very long branch name concatenated with the issue number, which often results in branch names like this one :
`feature/Merge_yada_and_yada_yada_into_one_yada_yada_status-lol_#199021`
- **Keep Branches Short-lived**: The longer a branch lives separate from the `main` or `master` branch, the higher the possibility of merge conflicts. Aim to merge branches as soon as the work is complete and has been tested.
- **Rebase Frequently**: If your branch lives longer, rebase it frequently on top of the main branch.
## 3. Pull Requests
Pull requests (PRs) are how your changes get incorporated into the project. Here are a few key points:
- **Link PR to an Issue**: Your PR should link to the issue it resolves. This helps track the resolution of bugs or addition of features.
- **PR Description**: The PR description should outline what changes have been made and why. This should be a summary of your commits.
- **Small and Focused PRs**: Aim to keep PRs small and focused. It's easier to understand and review a PR with a handful of related changes than one with multiple unrelated changes.
Example PR description:
```
## Description
This PR implements a login system (issue #456). It adds a login and logout button, as well as an authentication system. This will allow users to create an account and sign in.
## Changes
- Add login button component
- Add logout button component
- Add authentication API integration
## Issue Related
This PR closes #456
```
## 4. Other Best Practices
- **Stay Updated**: Keep your local copy up to date with the upstream regularly.
- **Test Before Pushing**: Always test your code and make sure all tests pass before you push.
Following these guidelines ensures a smoother collaboration and maintains a clean, manageable project history. Thanks for your contributions!
+3 -4
View File
@@ -39,11 +39,10 @@
(contact.db/public-key->new-contact identity)))
(defn contact-two-names-by-identity
[contact profile identity]
(let [me? (= (:public-key profile) identity)]
[contact current-multiaccount identity]
(let [me? (= (:public-key current-multiaccount) identity)]
(if me?
[(or (:preferred-name profile)
(:display-name profile)
[(or (:preferred-name current-multiaccount)
(:primary-name contact)
(gfycat/generate-gfy identity))]
[(:primary-name contact) (:secondary-name contact)])))
+1 -3
View File
@@ -14,9 +14,7 @@
(def ^:const content-type-gap 10)
(def ^:const content-type-contact-request 11) ;; TODO: temp, will be removed
(def ^:const content-type-system-pinned-message 14)
(def ^:const content-type-system-message-mutual-event-sent 15)
(def ^:const content-type-system-message-mutual-event-accepted 16)
(def ^:const content-type-system-message-mutual-event-removed 17)
(def ^:const content-type-system-mutual-state-update 15)
;; Not implemented in status-go, only used for testing/ui work
(def ^:const content-type-gif 100)
@@ -253,10 +253,7 @@
[{:keys [type value content-type] :as message-data} _ _
{:keys [context keyboard-shown?]}]
;;TODO temporary hide mutual-state-updates https://github.com/status-im/status-mobile/issues/16254
(when-not (#{constants/content-type-system-message-mutual-event-sent
constants/content-type-system-message-mutual-event-accepted
constants/content-type-system-message-mutual-event-removed}
content-type)
(when (not= content-type constants/content-type-system-mutual-state-update)
[rn/view
(add-inverted-y-android {:background-color (colors/theme-colors colors/white colors/neutral-95)})
(cond
@@ -376,11 +373,10 @@
(- (reanimated/get-shared-value scroll-y)
keyboard-height))))
[keyboard-shown keyboard-height])
;; Note - Don't pass `behavior :height` to keyboard avoiding view,
;; It breaks composer - https://github.com/status-im/status-mobile/issues/16595
[rn/keyboard-avoiding-view
{:style (style/keyboard-avoiding-container insets)
:keyboard-vertical-offset (- (:bottom insets))}
:keyboard-vertical-offset (- (:bottom insets))
:behavior :height}
(when header-comp
[header-comp
@@ -28,12 +28,12 @@
cover {:uri (get-in (:images item) [:banner :uri])}]
(if (= view-type :card-view)
[quo/community-card-view-item (assoc item :width width :cover cover)
#(rf/dispatch [:communities/navigate-to-community (:id item)])]
#(rf/dispatch [:navigate-to :community-overview (:id item)])]
[quo/community-list-item
{:on-press (fn []
(rf/dispatch [:communities/load-category-states (:id item)])
(rf/dispatch [:dismiss-keyboard])
(rf/dispatch [:communities/navigate-to-community (:id item)]))
(rf/dispatch [:navigate-to :community-overview (:id item)]))
:on-long-press #(rf/dispatch
[:show-bottom-sheet
{:content (fn []
@@ -141,12 +141,12 @@
(merge community
(get mock-community-item-data :data)
{:cover cover})
#(rf/dispatch [:communities/navigate-to-community (:id community)])]
#(rf/dispatch [:navigate-to :community-overview (:id community)])]
[quo/community-list-item
{:on-press (fn []
(rf/dispatch [:communities/load-category-states (:id community)])
(rf/dispatch [:dismiss-keyboard])
(rf/dispatch [:communities/navigate-to-community (:id community)]))
(rf/dispatch [:navigate-to :community-overview (:id community)]))
:on-long-press #(js/alert "TODO: to be implemented")}
(merge community
(get mock-community-item-data :data))])]))
@@ -3,8 +3,6 @@
[react-native.reanimated :as reanimated]))
(def screen-padding 20)
(def flash-button-size 32)
(def flash-button-spacing 12)
(def flex-spacer {:flex 1})
@@ -71,11 +69,10 @@
{:flex-direction :row
:justify-content :space-between})
(defn camera-flash-button
[viewfinder]
(def camera-flash-button
{:position :absolute
:top (- (+ (:y viewfinder) (:height viewfinder)) flash-button-size flash-button-spacing)
:right (+ screen-padding flash-button-spacing)})
:right 20
:bottom 20})
(defn border
[border1 border2 corner]
@@ -3,22 +3,21 @@
[oops.core :as oops]
[quo2.core :as quo]
[quo2.foundations.colors :as colors]
[react-native.blur :as blur]
[react-native.camera-kit :as camera-kit]
[react-native.core :as rn]
[react-native.blur :as blur]
[react-native.hole-view :as hole-view]
[react-native.permissions :as permissions]
[react-native.platform :as platform]
[react-native.reanimated :as reanimated]
[react-native.safe-area :as safe-area]
[reagent.core :as reagent]
[status-im2.constants :as constants]
[status-im2.contexts.syncing.scan-sync-code.style :as style]
[status-im2.contexts.syncing.utils :as sync-utils]
[utils.debounce :as debounce]
[utils.i18n :as i18n]
[utils.re-frame :as rf]
[utils.transforms :as transforms]))
[status-im2.contexts.syncing.utils :as sync-utils]
[status-im.utils.platform :as platform]
[react-native.reanimated :as reanimated]
[status-im2.constants :as constants]
[utils.debounce :as debounce]))
;; Android allow local network access by default. So, we need this check on iOS only.
(defonce preflight-check-passed? (reagent/atom (if platform/ios? false true)))
@@ -176,7 +175,9 @@
[rn/view
{:style style/qr-view-finder
:on-layout (fn [event]
(let [layout (transforms/js->clj (oops/oget event "nativeEvent.layout"))
(let [layout (js->clj (oops/oget event "nativeEvent.layout")
:keywordize-keys
true)
view-finder (assoc layout :height (:width layout))]
(reset! qr-view-finder view-finder)))}])
@@ -214,7 +215,15 @@
[rn/view
[border :border-bottom-width :border-right-width :border-bottom-right-radius]
[border-tip {:right 0 :top -1}]
[border-tip {:left -1 :bottom 0}]]]]
[border-tip {:left -1 :bottom 0}]]]
[quo/button
{:icon true
:type :blur-bg
:size 32
:accessibility-label :camera-flash
:override-background-color colors/neutral-80-opa-40
:style style/camera-flash-button}
:i/flashlight-off]]
[quo/text
{:size :paragraph-2
:weight :regular
@@ -270,7 +279,7 @@
:text (i18n/label :t/error-this-is-not-a-sync-qr-code)}]))))
(defn render-camera
[show-camera? torch-mode qr-view-finder camera-ref on-read-code]
[show-camera? qr-view-finder camera-ref on-read-code show-holes?]
(when (and show-camera? (:x qr-view-finder))
[:<>
[rn/view {:style style/camera-container}
@@ -279,13 +288,16 @@
:style style/camera-style
:camera-type camera-kit/camera-type-back
:zoom-mode :off
:torch-mode torch-mode
;; https://github.com/status-im/status-mobile/issues/16243
:torch-mode :off
:scan-barcode true
:on-read-code on-read-code}]]
[hole-view/hole-view
{:style style/hole
:holes [(merge qr-view-finder
{:borderRadius 16})]}
:holes (if show-holes?
[(merge qr-view-finder
{:borderRadius 16})]
[])}
[blur/view
{:style style/absolute-fill
:blur-amount 10
@@ -295,17 +307,13 @@
(defn f-view
[{:keys [title show-bottom-view? background animated?]}]
(let [insets (safe-area/get-insets)
active-tab (reagent/atom 1)
qr-view-finder (reagent/atom {})
render-camera? (reagent/atom false)
torch? (reagent/atom false)
app-state-listener (atom nil)]
(let [insets (safe-area/get-insets)
active-tab (reagent/atom 1)
qr-view-finder (reagent/atom {})
render-camera? (reagent/atom false)]
(fn []
(let [camera-ref (atom nil)
read-qr-once? (atom false)
torch-mode (if @torch? :on :off)
flashlight-icon (if @torch? :i/flashlight-on :i/flashlight-off)
;; The below check is to prevent scanning of any QR code
;; when the user is in syncing progress screen
user-in-syncing-progress-screen? (= (rf/sub [:view-id]) :syncing-progress)
@@ -320,8 +328,9 @@
scan-qr-code-tab? (= @active-tab 1)
show-camera? (and scan-qr-code-tab?
@camera-permission-granted?
@preflight-check-passed?
(boolean (not-empty @qr-view-finder)))
@preflight-check-passed?)
show-holes? (and show-camera?
(boolean (not-empty @qr-view-finder)))
title-opacity (reanimated/use-shared-value (if animated? 0 1))
subtitle-opacity (reanimated/use-shared-value (if animated? 0 1))
content-opacity (reanimated/use-shared-value (if animated? 0 1))
@@ -352,13 +361,6 @@
0
:easing4))
(if show-camera? 500 0)))]
(rn/use-effect (fn []
(reset! app-state-listener
(.addEventListener rn/app-state
"change"
#(when (and (not= % "active") @torch?)
(reset! torch? false))))
#(.remove @app-state-listener)))
(when animated?
(reanimated/animate-shared-value-with-delay subtitle-opacity
1 constants/onboarding-modal-animation-duration
@@ -397,7 +399,7 @@
[:<>
background
(when (or (not animated?) @render-camera?)
[render-camera show-camera? torch-mode @qr-view-finder camera-ref on-read-code])
[render-camera show-camera? @qr-view-finder camera-ref on-read-code show-holes?])
[rn/view {:style (style/root-container (:top insets))}
[header
{:active-tab active-tab
@@ -417,21 +419,11 @@
:transform [{:translate-y content-translate-y}]}
{})}
(case @active-tab
1 [scan-qr-code-tab qr-view-finder]
1 [scan-qr-code-tab qr-view-finder request-camera-permission]
2 [enter-sync-code-tab]
nil)]
[rn/view {:style style/flex-spacer}]
(when show-bottom-view? [bottom-view insets bottom-view-translate-y])
(when (and (or (not animated?) @render-camera?) show-camera?)
[quo/button
{:icon true
:type :blur-bg
:size style/flash-button-size
:accessibility-label :camera-flash
:override-background-color colors/neutral-80-opa-40
:style (style/camera-flash-button @qr-view-finder)
:on-press #(swap! torch? not)}
flashlight-icon])]]))))
(when show-bottom-view? [bottom-view insets bottom-view-translate-y])]]))))
(defn view
[props]
+3 -3
View File
@@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.162.3",
"commit-sha1": "b2e56f5d2d22d7299a049f70127b415fae4da75a",
"src-sha256": "0pz8ins5gz3f19syhi5rxz4j7115lakvw90yci85ci1k7rrhjxjk"
"version": "v0.161.6",
"commit-sha1": "3170300d780e2f1479d467546d21f247f54463b5",
"src-sha256": "10nx6gw0p5hnaxic5azb9wz392fxpzmbacvkwd8n1lammkcyqh1d"
}