From 24a0d8b07388b346819ba3618e5df7aeed78711f Mon Sep 17 00:00:00 2001 From: Raghav Tirumale <62105787+MythicalCow@users.noreply.github.com> Date: Thu, 27 Jun 2024 10:20:13 -0400 Subject: [PATCH] Add OS Level Shortcut Window for Quick Access to Khoj Desktop (#815) * rough sketch of desktop shortcuts. many bugs to fix still * working MVP of desktop shortcut khoj * UI fixes * UI improvements for editable shortcut message * major rendering fix to prevent clipboard text from getting lost * UI improvements and bug fixes * UI upgrades: custom top bar, edit sent message and color matching * removed debug javascript file * font reverted to Noto Sans * cleaning up the code and removing diffs * UX fixes * cleaning up unused methods from html * front end for button to send user back to main window to continue conversation * UX fix for window and continue conversation support added * migrated common js functions into chatutils.js * Fix window closing issue in macos by 1. Use a helper function to determine if the window is open by seeing if there's a browser window with shortcut.html loaded 2. Use the event listener on the window to handle teardown * removed extra comment and renamed continue convo button --------- Co-authored-by: sabaimran --- src/interface/desktop/chat.html | 348 +------------------ src/interface/desktop/chatutils.js | 366 ++++++++++++++++++++ src/interface/desktop/main.js | 86 ++++- src/interface/desktop/preload.js | 14 + src/interface/desktop/shortcut.html | 518 ++++++++++++++++++++++++++++ 5 files changed, 981 insertions(+), 351 deletions(-) create mode 100644 src/interface/desktop/chatutils.js create mode 100644 src/interface/desktop/shortcut.html diff --git a/src/interface/desktop/chat.html b/src/interface/desktop/chat.html index 92ea90e8..1838d2cc 100644 --- a/src/interface/desktop/chat.html +++ b/src/interface/desktop/chat.html @@ -13,7 +13,7 @@ - + +
+ + +
+ + +
+ + + + + + + + +