From ad59180fb81498ad5708f3bdff1d546f5657ed82 Mon Sep 17 00:00:00 2001
From: Olatoyan George <120045252+Olatoyan@users.noreply.github.com>
Date: Tue, 23 Apr 2024 12:13:48 +0100
Subject: [PATCH] Added indication in the desktop UI for back-end connectivity
(#711)
* Changed the styling of the link that takes a user to the settings page into a button
* added an indicator that shows if a user is connected to the server or not
* made a class name more descriptive and also made the text in first run message more intuitive
* changed the command to install dependencies in the README.md
* changed the class name of the first run message text to be more descriptive
* added icons in the desktop UI that shows if a file is synced successfully or not
* made the link class name in the homepage more descriptive
* fixed the hover issue on status box in the chat header pane
* fixed hovering issue on status box on macOS
---
src/interface/desktop/README.md | 10 +++-
.../desktop/assets/icons/file-not-synced.svg | 9 +++
.../desktop/assets/icons/file-synced.svg | 9 +++
src/interface/desktop/assets/khoj.css | 30 ++++++++++
src/interface/desktop/chat.html | 55 +++++++++++++++++--
src/interface/desktop/config.html | 8 +++
src/interface/desktop/renderer.js | 15 +++++
src/interface/desktop/utils.js | 11 ++++
8 files changed, 140 insertions(+), 7 deletions(-)
create mode 100644 src/interface/desktop/assets/icons/file-not-synced.svg
create mode 100644 src/interface/desktop/assets/icons/file-synced.svg
diff --git a/src/interface/desktop/README.md b/src/interface/desktop/README.md
index f7a8226d..c2f1be0d 100644
--- a/src/interface/desktop/README.md
+++ b/src/interface/desktop/README.md
@@ -1,17 +1,25 @@
# Run it locally
+
## Prerequisites
+
Install the runtime dependencies. This command should install all dev dependencies.
+
```bash
-yarn add
+yarn install
```
Run the application
+
```bash
yarn start
```
+
# Deploying the Electron App
+
## Prerequisites
+
Install the ToDesktop CLI. Full documentation can be found here: https://www.npmjs.com/package/@todesktop/cli
+
```bash
yarn global add @todesktop/cli
```
diff --git a/src/interface/desktop/assets/icons/file-not-synced.svg b/src/interface/desktop/assets/icons/file-not-synced.svg
new file mode 100644
index 00000000..227d51d3
--- /dev/null
+++ b/src/interface/desktop/assets/icons/file-not-synced.svg
@@ -0,0 +1,9 @@
+
+
+
diff --git a/src/interface/desktop/assets/icons/file-synced.svg b/src/interface/desktop/assets/icons/file-synced.svg
new file mode 100644
index 00000000..c584a86d
--- /dev/null
+++ b/src/interface/desktop/assets/icons/file-synced.svg
@@ -0,0 +1,9 @@
+
+
+
diff --git a/src/interface/desktop/assets/khoj.css b/src/interface/desktop/assets/khoj.css
index ec65ec56..521936b8 100644
--- a/src/interface/desktop/assets/khoj.css
+++ b/src/interface/desktop/assets/khoj.css
@@ -89,8 +89,38 @@ nav.khoj-nav {
grid-auto-flow: column;
grid-gap: 32px;
justify-self: right;
+ align-items: center;
+ }
+
+ .khoj-status-box {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ min-width: 52px;
+ gap: 4px;
+ -webkit-app-region: no-drag;
}
+ .khoj-status-box .khoj-status-connected {
+ height: 12px;
+ width: 12px;
+ border-radius: 50%;
+ background-color: rgb(90, 235, 90);
+ }
+ .khoj-status-box .khoj-status-not-connected {
+ height: 12px;
+ width: 12px;
+ border-radius: 50%;
+ background-color: rgb(235, 90, 90);
+ }
+
+ .khoj-status-box .khoj-status-text {
+ display: none;
+}
+.khoj-status-box:hover .khoj-status-text {
+ display: block;
+ }
+
a.khoj-nav {
display: flex;
align-items: center;
diff --git a/src/interface/desktop/chat.html b/src/interface/desktop/chat.html
index d796d930..2835f01d 100644
--- a/src/interface/desktop/chat.html
+++ b/src/interface/desktop/chat.html
@@ -888,10 +888,10 @@
}
function renderFirstRunSetupMessage() {
- first_run_message = `Hi 👋🏾, to get started:
+ first_run_message = `