Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: New navigation system #16785

Merged
merged 145 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
0c34535
feat: Add searchbar to top of conversation list (WPB-5949) (#16676)
thisisamir98 Feb 8, 2024
2a799d3
feat: Add sidebar with existing options (WPB-5944) (#16784)
thisisamir98 Feb 15, 2024
f1445a1
feat: add badges to new navigation sidebar (WPB-6651) (#16849)
thisisamir98 Feb 15, 2024
534edde
feat: add favorites, groups & directs tabs (WPB-5946) (#16861)
thisisamir98 Feb 21, 2024
eafb71a
feat: move connect and archives to new navigation system (WPB-6778) (…
thisisamir98 Mar 4, 2024
40299eb
Merge branch 'dev' of github.com:wireapp/wire-webapp into new-navigation
thisisamir98 Mar 8, 2024
15090a1
runfix: address new navigation styling in dark mode (WPB-6811) (#17058)
V-Gira Mar 13, 2024
0fa132e
feat: migrate preferences to new sidebar navigation (#17016)
thisisamir98 Mar 15, 2024
ab68922
feat: implement support tab (#17082)
thisisamir98 Mar 18, 2024
7a2525a
feat: user details in new nav structure (#17075)
przemvs Mar 19, 2024
c40b110
feat: New navigation code and design improvements (#17113)
przemvs Mar 20, 2024
8a8032d
feat: Conversation Sidebar code improvements (#17114)
przemvs Mar 20, 2024
ac96617
feat: Empty state for conversations (#17125)
przemvs Mar 22, 2024
7d43067
Merge branch 'dev' into new-navigation
przemvs Mar 26, 2024
a34fcc3
feat: Conversation sidebar header (#17170)
przemvs Mar 28, 2024
a8a5593
feat: sidebar toggle (#17115)
thisisamir98 Mar 28, 2024
88d5299
feat: add support for folders (#17174)
thisisamir98 Mar 28, 2024
7189d27
runfix: address darkmode color values (#17179)
V-Gira Mar 28, 2024
e8867aa
runfix: adjust responsive design to new sidebar (WPB-7212) (#17201)
V-Gira Apr 2, 2024
5e15c2b
runfix: show preferences titlebar back button (WPB-7212) (#17206)
V-Gira Apr 3, 2024
cc1e94d
feat: Navigation folders empty state support (#17203)
thisisamir98 Apr 3, 2024
8c705ea
runfix: use fading scrollbar for new sidebar (WPB-7412) (#17215)
V-Gira Apr 5, 2024
ae53d0a
Merge branch 'dev' into new-navigation
przemvs Apr 5, 2024
499585f
runfix: prevent loading of unreachable users (WPB-7377) (#17216)
V-Gira Apr 8, 2024
df1a259
fix: new navigation improvements (#17238)
przemvs Apr 10, 2024
b1e500c
fix: update header height (#17240)
przemvs Apr 10, 2024
7fe895e
feat: update collapsible sidebar implementation (#17218)
thisisamir98 Apr 11, 2024
1de900e
feat: add link to folders support page (#17214)
thisisamir98 Apr 11, 2024
acc2f2a
Merge branch 'dev' of github.com:wireapp/wire-webapp into new-navigation
thisisamir98 Apr 11, 2024
857d63a
runfix: use fading scrollbar for new sidebar (WPB-7412) (#17252)
V-Gira Apr 12, 2024
e8b41d1
feat: Add profile picture to new sidebar (#17255)
przemvs Apr 12, 2024
42f9520
fix: Hide none status availability (#17271)
przemvs Apr 15, 2024
d89d84c
feat: support for folders in collapsed sidebar (#17251)
thisisamir98 Apr 16, 2024
d5c7c9f
feat: always show archive tab in sidebar
thisisamir98 Apr 19, 2024
7b68634
feat: left sidebar improvements (#17291)
przemvs Apr 22, 2024
6ef3daa
Merge branch 'dev' into new-navigation
przemvs Apr 22, 2024
3d7989d
Merge branch 'dev' into new-navigation
przemvs Apr 23, 2024
5919bf3
feat: User Availability state (#17304)
przemvs Apr 23, 2024
80f9cd6
feat: Preferences header background (WPB-8832) (#17313)
przemvs Apr 23, 2024
8e34cc4
feat: new badge without number (#17342)
thisisamir98 Apr 29, 2024
ebedb6a
runfix: address responsivness of new navigation v2 (WPB-7212) (#17374)
V-Gira May 7, 2024
295cbb2
runfix: adress responsivness of the preferences sections (WPB-7214) (…
V-Gira May 15, 2024
44ea28e
fix: align setting header to the left (WPB-8832) (#17410)
V-Gira May 15, 2024
fb29f8b
feat: implement archives empty state (#17381)
thisisamir98 May 17, 2024
70816c9
feat: remove create group & create gust room from connect tab (#17421)
thisisamir98 May 17, 2024
e787673
runfix: use correct conversation icon (WPB-7373) (#17439)
V-Gira May 22, 2024
09ca18a
fix: search for people only in the connect tab (WPB-6561) (#17450)
V-Gira May 23, 2024
ae2bf8b
Revert "fix: Incoming connection request is not highlighted (#17449)"
V-Gira May 26, 2024
059c769
Merge branch 'new-navigation' into v/new-nav-unit-tests
V-Gira May 26, 2024
7d6a1cb
runfix: don't escape folder name char (#17479)
PatrykBuniX May 28, 2024
8325db2
fix: enable search in folders (#17493)
thisisamir98 May 30, 2024
89bd4c0
Merge pull request #17491 from wireapp/v/merge-dev-nnav
V-Gira May 30, 2024
86db84f
test: address unit tests failure in new navigation (WPB-9453) (#17490)
V-Gira May 31, 2024
9d6b91d
runfix: remove groups from open conversation on search (#17494)
V-Gira May 31, 2024
9d42070
fix: Incoming connection request is not highlighted (#17449) (#17503)
V-Gira Jun 3, 2024
25cb93f
chore: Implement locators for automation on the new navigation (WPB-9…
V-Gira Jun 4, 2024
1e91cf2
runfix: address design review (WPB-8687 7374 7357) (#17510)
V-Gira Jun 4, 2024
74a28e0
Merge branch 'dev' into v/merge-dev
V-Gira Jun 4, 2024
a794b35
Merge branch 'dev' into v/merge-dev
V-Gira Jun 5, 2024
e593816
Merge pull request #17514 from wireapp/v/merge-dev
V-Gira Jun 5, 2024
3567934
Merge branch 'dev' into v/publish-new-nav
V-Gira Jun 5, 2024
a62455e
Merge pull request #17516 from wireapp/v/publish-new-nav
V-Gira Jun 5, 2024
47f97bc
Merge branch 'dev' into v/merge-dev-new-nav
V-Gira Jun 5, 2024
36748aa
Merge pull request #17517 from wireapp/v/merge-dev-new-nav
V-Gira Jun 5, 2024
eede19d
fix: Filter conversation doesnt work properly (#17519)
przemvs Jun 6, 2024
8c0a146
runfix: address new navigation bug reports (#17523)
V-Gira Jun 7, 2024
b6af672
Merge branch 'dev' into v/merge-dev
V-Gira Jun 7, 2024
ac8f000
Merge pull request #17528 from wireapp/v/merge-dev
V-Gira Jun 7, 2024
0d5c78c
feat: Add support for new nav shortcuts (#17549)
thisisamir98 Jun 11, 2024
31615a9
Merge branch dev of github.com:wireapp/wire-webapp into new-navigation
thisisamir98 Jun 11, 2024
35c8d46
Merge branch 'new-navigation' of github.com:wireapp/wire-webapp into …
thisisamir98 Jun 11, 2024
aaa41aa
update test
thisisamir98 Jun 11, 2024
5b935bf
Merge branch 'dev' into new-navigation
atomrc Jun 11, 2024
fb5aa26
Merge branch 'dev' into new-navigation
atomrc Jun 13, 2024
bfdb65a
Merge branch 'dev' into new-navigation
atomrc Jun 13, 2024
bcb0360
feat: indicate slow network connection [WPB-9679] (#17557)
PatrykBuniX Jun 14, 2024
8091858
Merge branch 'dev' into chore/merge-dev
PatrykBuniX Jun 17, 2024
fcd3cd4
Merge pull request #17594 from wireapp/chore/merge-dev
PatrykBuniX Jun 17, 2024
a05c734
chore: update edge target in publish workflow
tlebon Jun 17, 2024
33175b7
runfix: misaligned import/export view (#17595)
PatrykBuniX Jun 17, 2024
021f2d1
runfix: slow internet dark mode (#17596)
PatrykBuniX Jun 17, 2024
05fa288
runfix: change dark mode slow indicator styles (#17600)
PatrykBuniX Jun 17, 2024
826af6a
feat: auto clear navigation search input on Escape press (#17602)
thisisamir98 Jun 18, 2024
40045de
feat: Clicking enter key on search input selecting first conversation…
przemvs Jun 18, 2024
728e82e
feat: persist sidebar open/close state (#17559)
thisisamir98 Jun 18, 2024
3f4f755
Merge branch 'dev' into new-navigation
atomrc Jun 18, 2024
9c419c1
Merge branch 'dev' into new-navigation
przemvs Jun 19, 2024
b78b47d
runfix: Missing OutlineCheck Icon (#17609)
przemvs Jun 19, 2024
f98daf4
merge dev into new-navigation
przemvs Jun 19, 2024
11a513f
Merge branch 'dev' into new-navigation
atomrc Jun 19, 2024
db438c5
Merge branch 'dev' into new-navigation
atomrc Jun 19, 2024
6921a18
chore: merge dev new nav (#17639)
PatrykBuniX Jun 24, 2024
3f22851
runfix: implement missing locator for automation (WPB-9506) (#17641)
V-Gira Jun 24, 2024
2d00228
Merge branch 'dev' into chore/merge-dev
atomrc Jun 25, 2024
0d06f05
chore: merge `dev` branch
atomrc Jun 25, 2024
0168550
Merge branch 'dev' into new-navigation
atomrc Jun 26, 2024
f9020ee
Merge branch 'dev' into new-navigation
atomrc Jun 26, 2024
280dcc2
Merge branch 'dev' into new-navigation
atomrc Jun 26, 2024
357954b
feat: update translations (#17623)
thisisamir98 Jun 26, 2024
61bc6a2
Merge branch 'dev' into v/merge-dev
V-Gira Jun 26, 2024
50fc82f
chore: merge branch 'dev' into new-navigation
V-Gira Jun 26, 2024
0cdb89a
Merge branch 'dev' of github.com:wireapp/wire-webapp into new-navigation
thisisamir98 Jun 27, 2024
dc8222a
Merge branch 'new-navigation' of github.com:wireapp/wire-webapp into …
thisisamir98 Jun 27, 2024
337a83e
Merge branch 'dev' into v/merge-dev
V-Gira Jun 28, 2024
b43a767
Merge pull request #17660 from wireapp/v/merge-dev
V-Gira Jun 28, 2024
1a76931
runfix: set sidebar tab to recent on starting a new conversation (WPB…
V-Gira Jul 1, 2024
b782429
feat: Address smaller UI issues in the new navigation (WPB-9694) (#17…
thisisamir98 Jul 1, 2024
74e8b05
runfix: address small ui fixes design review (WPB-9694) (#17679)
V-Gira Jul 2, 2024
41c36eb
feat: Move minimized calling view to the bottom of the conversation l…
przemvs Jul 3, 2024
ae9c545
chore: update config on ci (#17682)
PatrykBuniX Jul 3, 2024
2689225
fix: remove unused component (#17681)
przemvs Jul 3, 2024
cb4b463
runfix: address archived conversations bugs (WPB-9493 WPB-9768) (#17683)
V-Gira Jul 3, 2024
92d5880
runfix: update config version for staging manually
PatrykBuniX Jul 3, 2024
cad7552
fix: Ensure folder list popup appears when sidebar is force collapsed…
thisisamir98 Jul 3, 2024
e1f3670
chore: add new-navigation to ci job (#17687)
PatrykBuniX Jul 3, 2024
e9f1a7a
feat: add multi window support to context menu (#17686)
PatrykBuniX Jul 3, 2024
10ebff4
fix: remove name from minimized cell (#17688)
przemvs Jul 4, 2024
97b08b8
Merge branch 'dev' of github.com:wireapp/wire-webapp into new-navigation
thisisamir98 Jul 4, 2024
4ccfbd6
Merge branch 'new-navigation' of github.com:wireapp/wire-webapp into …
thisisamir98 Jul 4, 2024
02d23e4
chore: use different string identifier for connect tab search (#17689)
V-Gira Jul 4, 2024
e2b5cb5
runfix: switch to the recent tab on conversation creation (WPB-9509) …
V-Gira Jul 4, 2024
44091b4
runfix: switch to the folder tab on adding to folder (WPB-9510) (#17694)
V-Gira Jul 4, 2024
5871853
fix: Opening conversation clicking on notification (#17691)
przemvs Jul 4, 2024
034042e
feat: Missin indicator on settings button when new device was added (…
przemvs Jul 4, 2024
62ec5a5
fix: revert minimized calling cell (#17696)
przemvs Jul 5, 2024
7a647b8
Merge branch 'dev' into new-navigation
V-Gira Jul 5, 2024
91dc1ff
feat: Set default sidebar status to open (#17721)
thisisamir98 Jul 8, 2024
33a834b
Merge branch 'dev' of github.com:wireapp/wire-webapp into new-navigation
thisisamir98 Jul 8, 2024
eb879c1
Merge branch 'new-navigation' of github.com:wireapp/wire-webapp into …
thisisamir98 Jul 8, 2024
7060e37
fix: Opening the preferences as a temporary user shows the new naviga…
przemvs Jul 11, 2024
1bf822f
chore: merge dev to new-nav (#17740)
PatrykBuniX Jul 11, 2024
c92f315
fix: Archiving a convo with unread messages does not remove the unrea…
przemvs Jul 12, 2024
4ccb808
fix: Update conversation list in folder after remove conversation (#1…
przemvs Jul 12, 2024
8a7df3b
Merge pull request #17745 from wireapp/dev
PatrykBuniX Jul 12, 2024
1c39586
fix: Correct behavior for CMD/CTRL+k shortcut in new navigation setti…
thisisamir98 Jul 15, 2024
e751e79
runfix: switch to the recent tab on conversation creation with a serv…
V-Gira Jul 16, 2024
ff61fa8
runfix: slow connection indicator misaligned in preferences
PatrykBuniX Jul 16, 2024
abd6b13
Merge pull request #17761 from wireapp/runfix/slow-connection-prefere…
PatrykBuniX Jul 16, 2024
662e10f
runfix: align slow connection indication for temp user (#17762)
PatrykBuniX Jul 16, 2024
5b451a1
runfix: re-implement indicator on settings button when a new device i…
V-Gira Jul 16, 2024
d4a5110
Merge branch 'dev' of github.com:wireapp/wire-webapp into new-navigation
thisisamir98 Jul 17, 2024
1b6ca20
chore: auto-deploy dev on the edge environment
V-Gira Jul 18, 2024
8cbacb1
Merge branch 'dev' into v/merge-dev
V-Gira Jul 18, 2024
4a9a3e7
Merge pull request #17776 from wireapp/v/merge-dev
V-Gira Jul 18, 2024
5bc8d8a
fix: Restore opening conversation clicking on notification (#17777)
przemvs Jul 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
pull_request:
# we want to run the CI on every PR targetting those branches
branches: [master, dev, release/*]
branches: [master, dev, release/*, new-navigation]

push:
# We also run CI on dev in order to update the coverage monitoring
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ jobs:
- name: Install JS dependencies
run: yarn --immutable

- name: Update configuration
run: yarn configure

- name: Test
run: |
set -o pipefail
Expand Down Expand Up @@ -284,14 +287,11 @@ jobs:
map: |
{
"dev": {
"targets": "[\"wire-webapp-dev\"]"
"targets": "[\"wire-webapp-dev\", \"wire-webapp-edge\"]"
},
"master": {
"targets": "[\"wire-webapp-main\"]"
},
"new-navigation": {
"targets": "[\"wire-webapp-edge\"]"
},
"production": {
"targets": "[\"wire-webapp-prod\"]"
},
Expand Down
8 changes: 4 additions & 4 deletions charts/webapp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
replicaCount: 1
resources:
requests:
memory: "128Mi"
cpu: "100m"
memory: '128Mi'
cpu: '100m'
limits:
memory: "512Mi"
cpu: "1"
memory: '512Mi'
cpu: '1'
image:
repository: quay.io/wire/webapp
# tag: override version defined in Chart.appVersion
Expand Down
3 changes: 3 additions & 0 deletions server/config/client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
SHOW_LOADING_INFORMATION: env.FEATURE_SHOW_LOADING_INFORMATION == 'true',
USE_CORE_CRYPTO: env.FEATURE_USE_CORE_CRYPTO == 'true',
MAX_USERS_TO_PING_WITHOUT_ALERT:
(env.FEATURE_MAX_USERS_TO_PING_WITHOUT_ALERT && Number(env.FEATURE_MAX_USERS_TO_PING_WITHOUT_ALERT)) || 4,

Check warning on line 70 in server/config/client.config.ts

View workflow job for this annotation

GitHub Actions / test

No magic number: 4
},
MAX_GROUP_PARTICIPANTS: (env.MAX_GROUP_PARTICIPANTS && Number(env.MAX_GROUP_PARTICIPANTS)) || 500,
MAX_VIDEO_PARTICIPANTS: (env.MAX_VIDEO_PARTICIPANTS && Number(env.MAX_VIDEO_PARTICIPANTS)) || 4,
Expand Down Expand Up @@ -96,6 +96,7 @@
FEDERATION_STOP: env.URL_SUPPORT_FEDERATION_STOP,
HISTORY: env.URL_SUPPORT_HISTORY,
INDEX: env.URL_SUPPORT_INDEX,
FOLDERS: env.URL_SUPPORT_FOLDERS,
LEARN_MORE_ABOUT_GUEST_LINKS: env.URL_LEARN_MORE_ABOUT_GUEST_LINKS,
LEGAL_HOLD_BLOCK: env.URL_SUPPORT_LEGAL_HOLD_BLOCK,
MICROPHONE_ACCESS_DENIED: env.URL_SUPPORT_MICROPHONE_ACCESS_DENIED,
Expand All @@ -108,6 +109,8 @@
PRIVACY_WHY: env.URL_SUPPORT_PRIVACY_WHY,
SCREEN_ACCESS_DENIED: env.URL_SUPPORT_SCREEN_ACCESS_DENIED,
SYSTEM_KEYCHAIN_ACCESS: env.URL_SUPPORT_SYSTEM_KEYCHAIN_ACCESS,
URL_SUPPORT_FAVORITES: env.URL_SUPPORT_FAVORITES,
URL_SUPPORT_FOLDERS: env.URL_SUPPORT_FOLDERS,
},
TEAMS_BASE: env.URL_TEAMS_BASE,
TEAMS_CREATE: env.URL_TEAMS_CREATE,
Expand Down
4 changes: 4 additions & 0 deletions server/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ export type Env = {
/** Sets Support URLs to specific pages */
URL_SUPPORT_INDEX: string;

URL_SUPPORT_FOLDERS: string;

URL_SUPPORT_BUG_REPORT: string;

URL_SUPPORT_CALLING: string;
Expand Down Expand Up @@ -255,6 +257,8 @@ export type Env = {

URL_SUPPORT_SYSTEM_KEYCHAIN_ACCESS: string;

URL_SUPPORT_FAVORITES: string;

URL_LEARN_MORE_ABOUT_GUEST_LINKS: string;

URL_SUPPORT_NON_FEDERATING_INFO: string;
Expand Down
9 changes: 4 additions & 5 deletions src/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,10 @@
"conversationAssetUploading": "Uploading…",
"conversationAudioAssetRestricted": "Receiving audio messages is prohibited",
"conversationButtonSeparator": "or",
"conversationClassified": "Security level: VS-NfD",
"conversationConnectWithNewUsers": "Connect with People",
"conversationFavoritesTabEmptyMessage": "Select your favorite conversations, and you’ll find them here \uD83D\uDC4D",
"conversationGroupEmptyMessage": "You are not part of any group conversation yet.",
"conversationClassified": "Security level: VS-NfD",
"conversationConnectionAccepted": "Connected",
"conversationConnectionBlocked": "Blocked",
"conversationConnectionCancelRequest": "Cancel connection request",
Expand Down Expand Up @@ -466,15 +468,13 @@
"conversationDirectEmptyMessage": "You have no contacts yet. Search for people on {{brandName}} and get connected.",
"conversationEditTimestamp": "Edited: {{date}}",
"conversationFavoritesTabEmptyLinkText": "How to label conversations as favorites",
"conversationFavoritesTabEmptyMessage": "Select your favorite conversations, and you’ll find them here 👍",
"conversationFederationIndicator": "Federated",
"conversationFileAssetRestricted": "Receiving files is prohibited",
"conversationFoldersEmptyText": "Add your conversations to folders to stay organized.",
"conversationFoldersEmptyTextLearnMore": "Learn more",
"conversationFooterArchive": "Archive",
"conversationFooterContacts": "Contacts",
"conversationGroupCreate": "Group",
"conversationGroupEmptyMessage": "You are not part of any group conversation yet.",
"conversationGuestIndicator": "Guest",
"conversationImageAssetRestricted": "Receiving images is prohibited",
"conversationJoin.existentAccountJoinInBrowser": "Join in the browser",
Expand Down Expand Up @@ -1358,12 +1358,12 @@
"roleAdmin": "Admin",
"roleOwner": "Owner",
"rolePartner": "External",
"searchArchivedConversations": "Search archived conversations",
"searchConnect": "Connect",
"searchConnectWithOtherDomain": "Connect with other domain",
"searchConnections": "Connections",
"searchContacts": "Contacts",
"searchConversations": "Search conversations",
"searchArchivedConversations": "Search archived conversations",
"searchConversationsNoResult": "No results found",
"searchConversationsNoResultConnectSuggestion": "Connect with new users or start a new conversation",
"searchCreateGroup": "Create group",
Expand Down Expand Up @@ -1400,7 +1400,6 @@
"searchServiceConfirmButton": "Open Conversation",
"searchServicePlaceholder": "Search by name",
"searchServices": "Services",
"searchTeamGroups": "Team conversations",
"searchTeamMembers": "Team members",
"searchTopPeople": "Top people",
"searchTrySearch": "Find people by\nname or username",
Expand Down
60 changes: 60 additions & 0 deletions src/script/components/AvailabilityIcon/Availability.styles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Wire
* Copyright (C) 2024 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*
*/

import {CSSObject} from '@emotion/react';

import {Availability as AvailabilityProp} from '@wireapp/protocol-messaging';

import {AVATAR_SIZE} from 'Components/Avatar';
import {CSS_SQUARE} from 'Util/CSSMixin';

const availabilityStateColors: Partial<Record<AvailabilityProp.Type, string>> = {
[AvailabilityProp.Type.AVAILABLE]: 'var(--green-500)',
[AvailabilityProp.Type.AWAY]: 'var(--red-500)',
[AvailabilityProp.Type.BUSY]: 'var(--amber-500)',
};

const getSquareIconSize = (): Partial<Record<AVATAR_SIZE, number>> => ({
[AVATAR_SIZE.X_SMALL]: 6,
[AVATAR_SIZE.SMALL]: 7,
[AVATAR_SIZE.MEDIUM]: 10,
[AVATAR_SIZE.LARGE]: 12,
});

export const iconStyles = (availabilityState: AvailabilityProp.Type, avatarSize: AVATAR_SIZE): CSSObject => {
const squareIconSize = getSquareIconSize();

return {
...CSS_SQUARE(squareIconSize?.[avatarSize] || 8),
fill: availabilityStateColors[availabilityState],
stroke: availabilityStateColors[availabilityState],
borderRadius: '50%',
};
};

export const AvailabilityIcon: CSSObject = {
background: 'var(--app-bg)',
border: '2px solid var(--app-bg)',
borderRadius: '50%',
display: 'grid',
placeContent: 'center',
position: 'absolute',
bottom: '-2px',
right: '-2px',
};
68 changes: 68 additions & 0 deletions src/script/components/AvailabilityIcon/Availability.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Wire
* Copyright (C) 2024 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*
*/

import {ReactNode} from 'react';

import {Availability as AvailabilityProp} from '@wireapp/protocol-messaging';

import {AVATAR_SIZE} from 'Components/Avatar';

import * as styles from './Availability.styles';

import * as Icon from '../Icon';

const availabilityIconBaseProps = {
'data-uie-name': 'status-availability-icon',
};

const availabilityIconRenderer: Record<AvailabilityProp.Type, (avatarSize: AVATAR_SIZE) => ReactNode> = {
[AvailabilityProp.Type.AVAILABLE]: avatarSize => (
<Icon.AvailabilityAvailableIcon
{...availabilityIconBaseProps}
css={styles.iconStyles(AvailabilityProp.Type.AVAILABLE, avatarSize)}
data-uie-value="available"
/>
),
[AvailabilityProp.Type.AWAY]: avatarSize => (
<Icon.AvailabilityAwayIcon
{...availabilityIconBaseProps}
css={styles.iconStyles(AvailabilityProp.Type.AWAY, avatarSize)}
data-uie-value="away"
/>
),
[AvailabilityProp.Type.BUSY]: avatarSize => (
<Icon.AvailabilityBusyIcon
{...availabilityIconBaseProps}
css={styles.iconStyles(AvailabilityProp.Type.BUSY, avatarSize)}
data-uie-value="busy"
/>
),
[AvailabilityProp.Type.NONE]: () => null,
};

interface AvailabilityIconProps {
availability: AvailabilityProp.Type;
avatarSize: AVATAR_SIZE;
}

export const AvailabilityIcon = ({availability, avatarSize}: AvailabilityIconProps) => (
<div css={styles.AvailabilityIcon} data-uie-name="status-availability" data-uie-value={availability}>
{availabilityIconRenderer[availability](avatarSize)}
</div>
);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Wire
* Copyright (C) 2018 Wire Swiss GmbH
* Copyright (C) 2024 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -17,11 +17,4 @@
*
*/

.availability-state {
display: flex;
align-items: center;

.conversation-badges {
margin-left: 4px;
}
}
export * from './Availability';
7 changes: 4 additions & 3 deletions src/script/components/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
*/

import {FC, HTMLProps, MouseEvent as ReactMouseEvent, KeyboardEvent as ReactKeyBoardEvent} from 'react';
import {HTMLProps, MouseEvent as ReactMouseEvent, KeyboardEvent as ReactKeyBoardEvent} from 'react';

import {useKoSubscribableChildren} from 'Util/ComponentUtil';
import {handleKeyDown, isKeyboardEvent} from 'Util/KeyboardUtil';
Expand Down Expand Up @@ -79,17 +79,18 @@ export interface AvatarProps extends HTMLProps<HTMLDivElement> {
noFilter?: boolean;
isResponsive?: boolean;
onAvatarClick?: (participant: User | ServiceEntity) => void;
hideAvailabilityStatus?: boolean;
}

const Avatar: FC<AvatarProps> = ({
const Avatar = ({
avatarSize = AVATAR_SIZE.LARGE,
noBadge = false,
noFilter = false,
onAvatarClick,
participant,
isResponsive = false,
...props
}) => {
}: AvatarProps) => {
const handleAvatarInteraction = (
event: ReactMouseEvent<HTMLDivElement, MouseEvent> | ReactKeyBoardEvent<HTMLDivElement>,
) => {
Expand Down
1 change: 0 additions & 1 deletion src/script/components/Avatar/AvatarWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const AvatarWrapper: React.FunctionComponent<AvatarWrapperProps> = ({
...CSS_SQUARE(avatarDiameter),
color,
display: 'inline-block',
overflow: 'hidden',
position: 'relative',
transform: 'translateZ(0)',
userSelect: 'none',
Expand Down
Loading
Loading