Fixes#277
* fixed crash on attempting to open new instance, required refactoring BrowserWindow to global
Uncaught Exception:
ReferenceError: win is not defined
at click (C:\Users\jacks\AppData\Local\Programs\better-chatgpt\resources\app.asar\electron\index.cjs:53:9)
at MenuItem.click (node:electron/js2c/browser_init:2:30166)
at a._executeCommand (node:electron/js2c/browser_init:2:35562)
* fixed crash on attempting to open new instance, required refactoring BrowserWindow to global
Uncaught Exception:
ReferenceError: win is not defined
at click (C:\Users\jacks\AppData\Local\Programs\better-chatgpt\resources\app.asar\electron\index.cjs:53:9)
at MenuItem.click (node:electron/js2c/browser_init:2:30166)
at a._executeCommand (node:electron/js2c/browser_init:2:35562)
* fixed Electron process not closing on crash
previously left the process still existing on crash (only viewable in task manager). error behavior is the same as it was before, just now must be explicitly defined.
* hid electron menubar
* command prompt search bar automatically focused on button press
* moved clear conversation into settings, revamped to match style
* set a system role as a persistent role
Fixes https://github.com/ztjhz/BetterChatGPT/issues/130
* handle system message exceed token limit + improve logic
---------
Co-authored-by: Jing Hua <tohjinghua123@gmail.com>
* remove console log
* refactor: Add hideOnClickOutside feature to reuse code
This change abstracts the code repetition in three different files and promote the DRY principle by adding the hideOnClickOutside feature to the handleClickOutside function. The feature is designed to hide an element when clicking outside of its area.
* refactor: hooks
---------
Co-authored-by: Jing Hua <tohjinghua123@gmail.com>
* Add simple mode
The current UI is too complicated for some first time users.
This commit adds a "Advanced mode" toggle that defaults on but can be
turned off. When the toggle if switched off, the simple mode is
activated and following UI elements are hided:
- Model parameters setting
- Role switch
- Save button (This means user must save *and* submit in simple mode.)
* Simple mode: Fix ctrl-enter in non-sticky blocks
* i18n
* hide token count
* add back save button
* remove unused variables
---------
Co-authored-by: Jing Hua <tohjinghua123@gmail.com>
* google drive api
* fix: google-api
* GoogleCloudStorage
* list files api
* Google Cloud Storage
* move button to side menu
* sync status
* rename file
* show popup for those with cloud sync
* update button style
* auto close modal after logged in
* auto popup every 59min
* set as unauthenticated if update fails
* i18n
* add spin animation
* feat: Toast
* clear toast
* electron: desktop google drive integration
This update includes integration with Google Drive for desktop access,
but requires a new URL, which may cause existing chat data to be lost.
To minimize disruption, users can export their current chat data and
import it into the newer version.
* update note
* error handling
* support multiple drive files
* feat: delete drive file
* i18n
* change style
* Refact: hide dropdown prompt when clicked outside
Added an event listener to hide prompts,
when anything other than the dropdown is clicked,
implemented via a click event.
* Refact: hide palette color when clicked outside
Added an event listener to hide palette color,
when anything other than the dropdown palette is clicked,
implemented via a click event.
* Refactor: event listener conditions for dropdown
Changed the event listener conditions for mousedown events,
so they are only added when dropdown menu or color palette is visible.
* shift paletteRef position
---------
Co-authored-by: Jing Hua <tohjinghua123@gmail.com>
* Added dropdown close functionality when clicking
outside.
Added an event listener to the document that checks if the user clicks
outside the dropdown and closes it if so. This behavior is implemented
using a useRef hook and a mousedown event. The cleanup function is also
added to remove the event listener when the component unmounts.
* Optimized event listener in RoleSelector component
for improved performance.
Updated event listener for RoleSelector component
to only be added when the dropdown is opened and removed
when the dropdown is closed.
* Removed package-lock.json and yarn.lock
* Revert "Removed package-lock.json and yarn.lock"
This reverts commit f9dbf056b6003377d5bcf4f3a731afe7324f000b.
* Remove yarn.lock, package-lock.json from PR
* revert yarn.lock
* optimisation
* change React.useRef to useRef
---------
Co-authored-by: Jing Hua <tohjinghua123@gmail.com>