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>