From e5d805e9361768b27bae80e5eefc59eb79ddc440 Mon Sep 17 00:00:00 2001 From: Flemmli97 <34157027+Flemmli97@users.noreply.github.com> Date: Mon, 6 Nov 2023 16:13:02 +0100 Subject: [PATCH 1/6] fix(sidebar): Update some layouts for search bar results (#1452) Co-authored-by: Flemmli97 Co-authored-by: Darius Clark Co-authored-by: Sara Tavares <29093946+stavares843@users.noreply.github.com> --- ui/src/layouts/chats/presentation/sidebar/search.rs | 6 ++++-- ui/src/layouts/chats/style.scss | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/src/layouts/chats/presentation/sidebar/search.rs b/ui/src/layouts/chats/presentation/sidebar/search.rs index 0a3fffdb24b..a7dad761479 100644 --- a/ui/src/layouts/chats/presentation/sidebar/search.rs +++ b/ui/src/layouts/chats/presentation/sidebar/search.rs @@ -108,10 +108,11 @@ pub fn search_friends<'a>(cx: Scope<'a, SearchProps<'a>>) -> Element<'a> { div { padding_right: "32px", aria_label: "search-result-blocked-user", + display: "flex", IconElement { size: 40, fill: "var(--text-color-muted)", - icon: Icon::NoSymbol, + icon: Icon::UserBlocked, }, } ) @@ -273,11 +274,12 @@ pub fn search_friends<'a>(cx: Scope<'a, SearchProps<'a>>) -> Element<'a> { rsx!( div { padding_right: "32px", + display: "flex", aria_label: "search-result-blocked-user-in-group", IconElement { size: 40, fill: "var(--text-color-muted)", - icon: Icon::NoSymbol, + icon: Icon::UserBlocked, }, } ) diff --git a/ui/src/layouts/chats/style.scss b/ui/src/layouts/chats/style.scss index 2b29dcd74dd..13f1ca4755a 100644 --- a/ui/src/layouts/chats/style.scss +++ b/ui/src/layouts/chats/style.scss @@ -243,6 +243,10 @@ padding-left: 16px; padding-bottom: 4px; margin-bottom: 4px; + div { + margin-top: auto; + margin-bottom: auto; + } #profile-image { margin: var(--gap-less); //TODO(Lucas): Look to it, should be width: var(--height-input); From bc981f6201c61d3b1f39a76d31c58ba8e4eba83e Mon Sep 17 00:00:00 2001 From: Flemmli97 <34157027+Flemmli97@users.noreply.github.com> Date: Mon, 6 Nov 2023 17:30:38 +0100 Subject: [PATCH 2/6] fix(ui): Change button tooltip layout (#1450) --- kit/src/elements/tooltip/style.scss | 3 +++ ui/src/layouts/chats/style.scss | 3 --- ui/src/layouts/storage/files_layout/mod.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kit/src/elements/tooltip/style.scss b/kit/src/elements/tooltip/style.scss index d1e1764d867..7af69e06d53 100644 --- a/kit/src/elements/tooltip/style.scss +++ b/kit/src/elements/tooltip/style.scss @@ -30,6 +30,9 @@ margin-top: var(--border-radius); top: 100%; } +.tooltip-arrow-top-right { + right: 0; +} .tooltip-arrow-bottom, .tooltip-arrow-bottom-left, .tooltip-arrow-bottom-right { diff --git a/ui/src/layouts/chats/style.scss b/ui/src/layouts/chats/style.scss index 13f1ca4755a..79466081da4 100644 --- a/ui/src/layouts/chats/style.scss +++ b/ui/src/layouts/chats/style.scss @@ -552,9 +552,6 @@ animation: none; } } -.tooltip-arrow-top-right { - margin-right: 50px; -} #compose { .typing-indicator { width: 100%; diff --git a/ui/src/layouts/storage/files_layout/mod.rs b/ui/src/layouts/storage/files_layout/mod.rs index 8d8f3eb951d..f7b4f83ef42 100644 --- a/ui/src/layouts/storage/files_layout/mod.rs +++ b/ui/src/layouts/storage/files_layout/mod.rs @@ -177,7 +177,7 @@ pub fn FilesLayout(cx: Scope<'_>) -> Element<'_> { aria_label: "upload-file".into(), tooltip: cx.render(rsx!( Tooltip { - arrow_position: ArrowPosition::Top, + arrow_position: ArrowPosition::TopRight, text: get_local_text("files.upload"), } )), From c8497994f9e0d8740e88f1431a752264d8a133b0 Mon Sep 17 00:00:00 2001 From: Flemmli97 <34157027+Flemmli97@users.noreply.github.com> Date: Mon, 6 Nov 2023 20:33:35 +0100 Subject: [PATCH 3/6] feat(chat): Add clear all unreads button (#1443) --- common/locales/en-US/main.ftl | 3 ++- common/src/state/action.rs | 2 ++ common/src/state/mod.rs | 1 + kit/src/components/nav/mod.rs | 33 ++++++++++++++++++++++++++------- ui/src/main.rs | 9 +++++++++ 5 files changed, 40 insertions(+), 8 deletions(-) diff --git a/common/locales/en-US/main.ftl b/common/locales/en-US/main.ftl index 203dc629f35..cf37adad674 100644 --- a/common/locales/en-US/main.ftl +++ b/common/locales/en-US/main.ftl @@ -41,7 +41,8 @@ uplink = Uplink .download-update = Download Update .date-time-format = %d/%m/%Y %I:%M %p .open-devtools = Open Console - + .clear-unreads = Clear Unreads + community = Community .invited = You're Invited! .join = Join diff --git a/common/src/state/action.rs b/common/src/state/action.rs index 2b59509c8d4..5f82ec39456 100644 --- a/common/src/state/action.rs +++ b/common/src/state/action.rs @@ -194,6 +194,8 @@ pub enum Action<'a> { ClearUnreads(Uuid), #[display(fmt = "ClearActiveUnreads")] ClearActiveUnreads, + #[display(fmt = "ClearAllUnreads")] + ClearAllUnreads, #[display(fmt = "Config {_0}")] Config(ConfigAction), } diff --git a/common/src/state/mod.rs b/common/src/state/mod.rs index e162b615fb0..307f910c4a8 100644 --- a/common/src/state/mod.rs +++ b/common/src/state/mod.rs @@ -260,6 +260,7 @@ impl State { self.clear_unreads(id); } } + Action::ClearAllUnreads => self.chats.all.values_mut().for_each(|c| c.clear_unreads()), Action::SetChatDraft(chat_id, value) => self.set_chat_draft(&chat_id, value), Action::ClearChatDraft(chat_id) => self.clear_chat_draft(&chat_id), Action::SetChatAttachments(chat_id, value) => { diff --git a/kit/src/components/nav/mod.rs b/kit/src/components/nav/mod.rs index 825f449cd37..c73c9384fd0 100644 --- a/kit/src/components/nav/mod.rs +++ b/kit/src/components/nav/mod.rs @@ -1,9 +1,13 @@ use dioxus::prelude::*; +use uuid::Uuid; -use crate::elements::{ - button::Button, - tooltip::{ArrowPosition, Tooltip}, - Appearance, +use crate::{ + components::context_menu::ContextMenu, + elements::{ + button::Button, + tooltip::{ArrowPosition, Tooltip}, + Appearance, + }, }; use common::icons::outline::Shape as Icon; pub type To = &'static str; @@ -16,6 +20,7 @@ pub struct Route<'a> { pub with_badge: Option, pub loading: Option, pub child: Option>, + pub context_items: Option>, } impl Default for Route<'_> { @@ -27,6 +32,7 @@ impl Default for Route<'_> { with_badge: None, loading: None, child: None, + context_items: None, } } } @@ -98,7 +104,8 @@ pub fn Nav<'a>(cx: Scope<'a, Props<'a>>) -> Element<'a> { let active = use_state(cx, || get_active(&cx)); let bubble = cx.props.bubble.unwrap_or_default(); let tooltip_direction = cx.props.tooltip_direction.unwrap_or(ArrowPosition::Bottom); - + // For some reason if you dont do this the first render will not have a context menu + let uuid = use_ref(cx, || Uuid::new_v4().to_string()); cx.render(rsx!( div { aria_label: "button-nav", @@ -109,6 +116,7 @@ pub fn Nav<'a>(cx: Scope<'a, Props<'a>>) -> Element<'a> { let badge = get_badge(route); let key: String = route.name.clone(); let name: String = route.name.clone(); + let name2: String = name.to_lowercase(); let aria_label: String = route.name.clone(); // todo: don't show the tooltip if bubble is true let tooltip = if cx.props.bubble.is_some() { @@ -120,7 +128,7 @@ pub fn Nav<'a>(cx: Scope<'a, Props<'a>>) -> Element<'a> { })) }; - rsx!( + let btn = rsx!( div { position: "relative", display: "inline-grid", @@ -141,7 +149,18 @@ pub fn Nav<'a>(cx: Scope<'a, Props<'a>>) -> Element<'a> { }, route.child.as_ref() } - ) + ); + match route.context_items.as_ref() { + None => btn, + Some(items) => { + rsx!(ContextMenu{ + id: format!("route-{}-{}", name2, uuid.read()), + key: "{name2}-{uuid.read()}", + items: items.clone(), + btn + }) + } + } }) } )) diff --git a/ui/src/main.rs b/ui/src/main.rs index 15776605f80..63b6bac5f0d 100644 --- a/ui/src/main.rs +++ b/ui/src/main.rs @@ -1114,6 +1114,15 @@ fn AppNav<'a>( unreads.to_string(), })) }), + context_items: (unreads > 0).then(|| { + cx.render(rsx!(ContextItem { + aria_label: "clear-unreads".into(), + text: get_local_text("uplink.clear-unreads"), + onpress: move |_| { + state.write().mutate(Action::ClearAllUnreads); + } + },)) + }), ..UIRoute::default() }; let settings_route = UIRoute { From 5814b6718099ff6ec479c2339083593513c99966 Mon Sep 17 00:00:00 2001 From: Sara Tavares <29093946+stavares843@users.noreply.github.com> Date: Mon, 6 Nov 2023 19:56:17 +0000 Subject: [PATCH 4/6] chore(docs): fix 404 in docs (#1455) --- docs/new-dev.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/new-dev.md b/docs/new-dev.md index 0b80045129b..fb22ca2f6a4 100644 --- a/docs/new-dev.md +++ b/docs/new-dev.md @@ -4,11 +4,11 @@ This document contains some useful resources for anyone wishing to contribute to ## Quick Start -1. Get a TL;DR about Satellite and Uplink from [the doc](docs/what.md) +1. Get a TL;DR about Satellite and Uplink from [the doc](https://github.com/Satellite-im/Uplink/blob/dev/docs/architecture.md) 2. Ensure you run physical and automated tests before submitting a PR for review. We work really hard to have no regressions even if a new feature may be "more important". -3. Review both open and closed [issues](https://github.com/ssatellite-im/Uplink/issues), there may be others working on a similar feature. +3. Review both open and closed [issues](https://github.com/satellite-im/Uplink/issues), there may be others working on a similar feature. 4. Be aware that unless you explicitly state otherwise, contributions you make to this project will be under the licensing rights of the original author's, Satellite.im's, specified license terms (to be outlined in the repository). From b82d656cac36542d91c0b8784ed7d5f709dae5e6 Mon Sep 17 00:00:00 2001 From: Luis E <35935591+luisecm@users.noreply.github.com> Date: Mon, 6 Nov 2023 16:13:59 -0600 Subject: [PATCH 5/6] chore(appium): remove build ubuntu step on ui automated tests (#1459) --- .github/workflows/ui-test-automation.yml | 35 +----------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/.github/workflows/ui-test-automation.yml b/.github/workflows/ui-test-automation.yml index dc5468e860e..cb7aef5e1e0 100644 --- a/.github/workflows/ui-test-automation.yml +++ b/.github/workflows/ui-test-automation.yml @@ -13,31 +13,6 @@ env: CARGO_TERM_COLOR: always jobs: - build-ubuntu: - runs-on: ubuntu-latest - steps: - - name: Checkout App directory 🔖 - uses: actions/checkout@v3 - - - name: Get latest package list - run: sudo apt-get update - - - name: Install libwebkit2gtk - run: sudo apt-get install -y build-essential pkg-config libssl-dev libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev librust-alsa-sys-dev dpkg-dev gzip webkit2gtk-driver xvfb libxdo-dev - - - name: Set up cargo cache 🛠️ - uses: Swatinem/rust-cache@v2 - - - name: Install Rust 💿 - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.70.0 - override: true - - - name: Build executable 🖥️ - run: cargo build --release -F production_mode - build-mac: runs-on: macos-13 steps: @@ -475,14 +450,7 @@ jobs: publish-results: if: always() needs: - [ - build-ubuntu, - build-mac, - build-windows, - test-mac, - test-windows-chats, - test-windows, - ] + [build-mac, build-windows, test-mac, test-windows-chats, test-windows] runs-on: ubuntu-latest permissions: checks: write @@ -574,7 +542,6 @@ jobs: remove-artifacts: needs: [ - build-ubuntu, build-mac, build-windows, test-mac, From 2a53adcf119205f103c9634558c8f6e60d222b14 Mon Sep 17 00:00:00 2001 From: Sara Tavares <29093946+stavares843@users.noreply.github.com> Date: Mon, 6 Nov 2023 22:47:17 +0000 Subject: [PATCH 6/6] chore(docs): fix 404 (#1458) --- docs/architecture.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/architecture.md b/docs/architecture.md index b9122a5cbbb..11f6feb0c0f 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -4,7 +4,7 @@ ## Background - The Uplink repository consists of two `Cargo` projects: `kit` (a library) and `uplink` (the executable). -- Uplink relies on [Warp](https://github.com/Satellite-im/Warp) and [Dioxus](https://github.com/DioxusLabs/dioxus). It is assumed the reader is familiar with the [Dioxus Documentation](https://dioxuslabs.com/guide/). +- Uplink relies on [Warp](https://github.com/Satellite-im/Warp) and [Dioxus](https://github.com/DioxusLabs/dioxus). It is assumed the reader is familiar with the [Dioxus Documentation](https://dioxuslabs.com/learn/0.4). - At a high level, Warp sends messages (it does much more), while Uplink is just the UI. Sending and receiving messages is asynchronous, and Uplink has a separate module to handle this: `warp_runner`. All the data for the Uplink UI is contained in a `State` struct. Changing the `State` struct drives the UI. When `warp_runner` handles an event from the `Warp`, `State` is modified, and the entire UI is re-rendered. ## Running the Application