Commit Graph

1358 Commits

Author SHA1 Message Date
Jonathan Rainville 2a9f9118a1 fix: fix settings not being refetched when they had been edited before 2021-03-24 12:06:24 -05:00
Pascal Precht e1a4a47636 fix(Chat): disable HoverHandler when profile popup or context menu are open
Alright, this is an interesting one:

As described in #1829, when the profile popup is opened within the chat view,
users are still able to click *through* the popup on message, which then puts them in
an active state.

I've done a bunch of debugging as described [here](https://github.com/status-im/status-desktop/issues/1829#issuecomment-804748148) and after doing some
further debugging, I found out that `isMessageActive` isn't really the culprit here.

What causes this effect is the `HoverHandler` that's attached to the `CompactMessage` item.
`HoverHandler` is a standard QML type that emits `hoverChanged` signals so one can do things like
applying hover effects on elements, which is exactly what we do:

```
HoverHandler {
  onHoverChanged: {
    root.isHovered = hovered  // `root` being the message item
  }
}
```

I assume we went with this handler because putting a `MouseArea` in there instead, which fills
the entire message component pretty much eliminates all existing mouse handlers attached to
other child components, such as the profile image or the username of the message, which also
open a message context menu.

It turns out that, having a `HoverHandler` as described above, actually activates it when the
user clicks with the left mouse button as well (not just on hover). That's what causes the "click-through"
effect. This can be verified by setting `acceptedButtons` to `Qt.RightButton`, basically telling
the handler that only right clicks will activate it.

I then tried using `Qt.NoButtons` instead so that no button clicks and only hovers will activate
the handler, but that didn't seem to have any effect at all. It still defaults to `Qt.LeftButton`.

So the last resort was to disable the `HoverHandler` altogether, whenever either the profile popup,
or the message context menu (for emojis etc) is open.

Unfortunately, we don't have access to the profile popup in the compact message component, because it's
detached from the component tree. Therefore, I've introduced a new property `profilePopupOpened` on
the chat layout, which we can read from instead.

Fixes #1829
2021-03-23 10:32:31 -04:00
Pascal Precht a030a4fadc refactor: make add new contact modal looks the same as new chat modal
Closes #1660 #2086
2021-03-22 15:55:13 -04:00
Pascal Precht e2113553b9 feat(PrivateChatPopupSearchResults): introduce reset() and config API
This commit introduces a `reset()` function so that search results inside
the application can be easily reset. It also introduces a `resultClickable`
flag which allows consumers of this component to decide whether a search result
is clickable and emits a dedicated event.

This is useful when UIs should only allow actions via the result icon button
(as it's the case with the new add-to-contact modal).
2021-03-22 15:49:47 -04:00
Jonathan Rainville 7fb9578285 feat: highlite mentions in the chat input as well 2021-03-22 15:49:21 -04:00
Pascal Precht d2b9d54c4b fix: ensure lists and radio button groups look concise throughout app
Fixes #1992
2021-03-19 16:17:14 -04:00
Pascal Precht a27f9cf25d fix(StatusRadioButtonRow): ensure checked state is propagated properly
There were cases in which this component was used and its `checked` state wasn't
properly emitted to the underlying component.

This commit fixes that by ensuring the `MouseArea` only alters the radio button's
`checked` state and let the radio button handle the event propagation.
2021-03-19 16:17:14 -04:00
Pascal Precht accf92be2f fix(Separator): ensure custom color works as expected
This was a regression introduced in https://github.com/status-im/status-desktop/pull/2065.
The new wrapping Rectangle would get the color that is possibily passed down
to Separator. Instead it should get properly bound to the actual separator.
2021-03-19 15:54:27 -04:00
Jonathan Rainville 98ef76d3c8 chore: hide edit community button until the feature is implemented 2021-03-18 14:52:28 -04:00
Pascal Precht 29c7f7b91d uiux(Profile): adjust layout max width of profile sections
Closes #1994
2021-03-18 14:50:58 -04:00
Pascal Precht 010a7e0d8e feat(Communities): open member profile on memberlist click 2021-03-18 14:47:36 -04:00
Pascal Precht 6b6a318a8c
refactor(Communities): make member list look as intended
This change aligns the member list's look & feel of the community profile popup
with the designs by implementing the proper member list items styles, hover effects
and fine-tuning the context menu.

This commit also comments some of the actions provided by the context menu,
which aren't implemented yet. There's no point in having UI components that don't or
can't function.

Those will be re-introduced once they are actually implemented.

Closes #1959
2021-03-18 10:03:24 +01:00
Pascal Precht 05a8303d5b
feat(PopupMenu): introduce `danger` type for actions
This is needed so that "dangerous" actions, such as deleting data
or removing users from groups etc, can get a dedicated hover color as well.
2021-03-18 10:03:19 +01:00
Pascal Precht b4389402e9
refactor: make use of StatusContextMenuButton 2021-03-18 10:03:08 +01:00
Pascal Precht f497091c3e
feat: introduce new StatusContextMenuButton component
We've been implementing such a button in various ways throughout the
application. Sometimes using SVG icons and rectangles, sometimes highjacking
`StyledText` components (which was clever though).

Obviously this resulted in inconsistencies, so this commit introduces
a new dedicated component to render the three-dots button for context menus.
2021-03-18 10:03:04 +01:00
Pascal Precht d46be4f740 feat(Separator): enabled custom separator height
Sometimes, `Separator` is used inside context menus to separate groups
of actions that belong together. The separator in itself doesn't have any
padding or margins in this case because the just gets transcluded as is
in the context menu, between menu items.
There are cases in the design where a padding/margin is desired though.

This change makes that possible by wrapping the separator `Rectangle` with
another `Rectangle` which controls a custom height (if desired). The inner
rectangle is then just always vertically center.

In practice this means, existing usages of `Separator` behave exactly the same,
they don't break. In addtion one can set `Separator { height: x }` while maintaining
a 1px separator line.
2021-03-18 09:37:13 +01:00
Jonathan Rainville 23a8de0449 fix: fix community not being passed correctly to the invite bubble 2021-03-17 16:09:23 -04:00
Jonathan Rainville f3b452188a chore: extract join.status link prefixes to Constants 2021-03-17 16:09:23 -04:00
Jonathan Rainville 62d10eba49 feat: show community invite component on community link 2021-03-17 16:09:23 -04:00
Jonathan Rainville 5581fca41d feat: show default unfurling for community links 2021-03-17 16:09:23 -04:00
Jonathan Rainville c5c348b0b1 feat: add back status link whitelisting and public chat links 2021-03-17 16:09:23 -04:00
Pascal Precht 907fbc21b8 fix(Chat): don't render "Copy Link" menu item if not desired
This adjust the rules to render the copy link menu item so that it aligns
with what has been mentioned in #1943.

Fixes #1943
2021-03-17 15:28:12 -04:00
Iuri Matias 98eea14da8 fix default mode 2021-03-17 15:25:15 -04:00
Jonathan Rainville d0f141c1b8 fix: fix appSetting not defined by removing sounds from login 2021-03-17 13:35:15 -04:00
Pascal Precht 053c7fdcf3 fix: enforce compact mode
Since https://github.com/status-im/status-desktop/commit/93668ff75
we're hiding the setting to change appearance for compact normal mode
of the UI. For now, compact mode is the new default (reasoning is unclear
at this point).

Prior to this change, most likely many users are still using the
normal mode configuration, so we have to enforce compact mode for
those.
2021-03-17 13:34:42 -04:00
Pascal Precht 362ad02ffc
refactor(Communities): make membershipt request button looks as designed
The designs for the membership request button look different now, so this
commit makes use of the `StatusSettingsLineButton` to implement that new
look & feel.
2021-03-17 10:30:19 +01:00
Pascal Precht ea39ead64b
feat(StatusSettingsLineButton): make some of the component's props configurable
This helps with using this component in other places where the default
settings for some UI related properties don't match otherwise.
2021-03-17 10:30:19 +01:00
Pascal Precht 38bd5f1422
fix(Communities): remove type error in item width
There's no `parent` in that componen, which results in a QML type error
at runtime.
2021-03-17 10:30:18 +01:00
Pascal Precht 638892f21d
refactor(Communities): use StackView inside profile popup for memberlist
Prior to this commit, the community memberlist was represented in a nested modal
which doesn't adhere to the designs. Rather, the section should render inside the
existing modal, requiring it to be refactored using a `StackView`.

This commit refactors the community profile popup so that the different content
sections ("Overview" and "MemberList") are rendered inside of the popup and can
be pushed onto and popped off a stack view.

The content components (newly introduced in this commit) `CommunityProfilePopupMembersList`
and `CommunityProfilePopupOverview` need to define a `headerTitle`, `headerDescription` and
if needed `imageSource` so they can alter the modal's header.

The same pattern might be used in other places of the modal if required.

Partially fixes #1959
2021-03-17 10:29:31 +01:00
Jonathan Rainville b9594591b0 fix: fix a lot of issues relative to dark theme
Fixes #1997
2021-03-16 17:22:58 -04:00
Jonathan Rainville 9d9b0ab5e6 fix: fix chat link preview modal
Fixes #2001
Fixes icons
Fixes Icon border
Fixes button hover
Fixes list scrolling and overflow
2021-03-16 17:20:12 -04:00
Iuri Matias 9621230e6d update default settings 2021-03-16 16:51:14 -04:00
Iuri Matias 9c404a1047 show browser favourites bar by default 2021-03-16 16:51:14 -04:00
Iuri Matias 5cef8e3e60 adjust content height of sticker popup 2021-03-16 15:39:52 -04:00
Richard Ramos 4f4a3f1c30 feat: see stickers details when clicking on a sticker 2021-03-16 15:39:52 -04:00
Pascal Precht 8ad9e52abf fix(Communities): render community image in profile popup 2021-03-16 14:57:45 -04:00
Pascal Precht 79338f76be feat(ModalPopup): hide footer section if footerContent height is 0
In the recent past we've improved our `ModalPopup` to allow for a bit more control
when it comes to rendering a modal footer section with call-to-action items.

The footer section is rendered when there's `footerContent` and when the height
of the footer content is > 0. This means it's possible to also hide the footer content
section from the modal, even when there's footer content children.

However, there's a separator rendered whenver the footer is visible, regardless of its
height. This results in undesired behaviour when rendering footer children of height 0.

To avoid this, this commit adjust the condition so that the separator is only rendered
when the footer visible AND the height of it is > 0.
2021-03-16 14:29:36 -04:00
Eric Mastro f1e83f74bc feat: drag and drop images
Allow up to 5 images to be dragged and dropped in to one-on-one chats and in the timeline. Can be combined with the existing upload button. The upload file dialog has been changed to allow multiple selections. Drag and dropped images adhere to the following rules, with corresponding validations messages:
- Max 5 image
- Image size must be 0.5 MB or less
- File extension must be one of [".png", ".jpg", ".jpeg", ".heif", "tif", ".tiff"]

Drag and drop and uploaded images are now also deduplicated.
2021-03-16 13:51:37 -04:00
Iuri Matias de290727c2 update translation keys 2021-03-16 12:43:57 -04:00
Iuri Matias e6a3014d9f update description of sign out button 2021-03-16 12:43:37 -04:00
Iuri Matias 3119aebed4 re-add sign out button 2021-03-16 12:43:37 -04:00
Iuri Matias 93668ff75a hide chat mode switch for now and make compact mode the default 2021-03-16 12:43:07 -04:00
Pascal Precht e725e7982d fix(Communities): properly pass `admin` state to profile popup
This was hardcoded into `isAdmin` for some reason. It also seems that the
property isn't actually used anywhere in the profile popup, so we might
as well get rid off it.
2021-03-16 12:43:01 -04:00
rinzlxr 410851da33 fix: profile menu seperators
fixes #1991

fix: use secondary color instead
2021-03-16 12:38:17 -04:00
Iuri Matias 3878b8a662 update to beta.7.rc2 2021-03-15 15:05:33 -04:00
Pascal Precht eefd56dd28 fix(Communities): ensure app remembers hidden community intro banners
Fixes #1960
2021-03-15 14:35:31 -04:00
Pascal Precht 2e710715bc fix(Communities): ensure profile popup is hydrated with correct data
The `communityProfilePopup` relies on the currently `activeCommunity` to
get its data. Unfortunately, once read, even when `chatsModel.setActiveCommunity()`
is called which triggers `activeCommunityChanged`, the data in the popup
won't be updated. The next time one would open a community profile page,
it'd have the data that was previously received from the model.

This commit ensures that the popup is hydrated with the most recent data
by explicitly updating its properties right before it's opened.
2021-03-11 10:41:19 -05:00
Pascal Precht 51c8d86ccc fix(Communities): don't crash on rejoin attempt
Prior to this commit there was a scenario where the application would
crash due a memory bug when attempting to (re)join a community.

The scenario is as follows:

1. User creates or has been invited to community with `ON_REQUEST` permissions
2. User leaves community
3. User decides to rejoin, so she selects the community she's been part
of and hits the "Join" button

At this point Status Desktop would send a new `RequestToJoin` request, as the
community has a corresponding permissions setting.

This would then result in an `already a member` error in status-go, because
status-go checks whether the requestee is already part of the members list of
the community. The error isn't handled inside Status Desktop which causes
a crash because we're trying to access data in memory that doesn't exist.

Why is this happening?

While this might be unexpected, when leaving a community (as done on step 2 of
the mentioned scenario), users don't actually lose membership but simply
"unsubscribe" from all channels in the community in question and their `joined`
flag is set to `false`.

From that point on, re-joininng a community is done by sending a `JoinCommunity`
request (instead of `RequestToJoin`), which will then set the `joined` flag to
`true` and doesn't actually check the membership in the database.

This commit ensures we're calling the right API by checking whether not only
whether the community is needs `ON _REQUEST` permissions, but also whether the
user isn't already a member of it.

Fixes #2017
2021-03-11 10:41:19 -05:00
Pascal Precht 49b5e6c097 fix(Communities): make validation on community import work again
In https://github.com/status-im/status-desktop/commit/a90a30af1 we've introduced the functionality to import
communities through the UI via a community private key.
That private key is being validated before it gets imported.
For some reason, validation has been removed in another refactor
later on in https://github.com/status-im/status-desktop/commit/534cb23e1, rendering the import
functionality broken.

This commit re-introduces the `validate()` method to make importing
communities work again.
2021-03-11 10:00:05 -05:00
Pascal Precht 01d3369c64 fix(Communities): fallback to letter identicon if no image available
Prior to this commit, communities without an image would render invisible
in the navigation bar of the application. To avoid this, we're now falling
back to our StatusLetterIdenticon component, which renders the first letter
of the community name with the color of the community.
2021-03-11 10:00:05 -05:00