Commit Graph

68 Commits (36c1cb47c084755ffa090931a76380252677364c)

Author SHA1 Message Date
ZauberNerd 36c1cb47c0
Implement service worker using vite-plugin-pwa 2023-07-10 00:42:54 +02:00
Cogent Apps f9122c5227
Merge branch 'main' into service-worker 2023-07-09 12:40:19 -07:00
Cogent Apps 4f5e7fbdc8
Merge pull request #166 from ZauberNerd/fix-non-serializable-error
Fix non-serializable error message
2023-07-09 12:28:07 -07:00
Cogent Apps 25fd17a554 extend browser compatability 2023-07-09 19:24:17 +00:00
ZauberNerd 0701303563
Use comlink without vite-plugin-comlink
For some reason the vite-plugin-comlink doesn't seem to work in this
constellation.
I tried to reproduce in a new vite project and there it did work.
But also, the plugin does some horrible magic by replacing a
non-existant constructor `ComLinkWorker()` with the `wrap()` method
and then the only real benefit is, that we wouldn't need to write the
`expose()` method in the worker. So for that reason I'm removing the
plugin and using the comlink package directly.
2023-07-08 15:42:43 +02:00
ZauberNerd ff9f3517ec
Replace Node.js's Buffer with native Typed Arrays on the client-side
Vite does not natively ship a Buffer polyfill and most of the
functionality that is required here, can be implemented natively (except
for the byte-wise compare, for that I had to write my own function).
2023-07-08 15:42:43 +02:00
ZauberNerd 4b91a1972b
Replace CRA proxy config with vite's proxy config 2023-07-08 15:41:28 +02:00
ZauberNerd ba6544ba53
Fix non-serializable error message
Using Redux Toolkit together with redux-persist requires some additional
configuration to disable the non-serializable error message:
https://redux-toolkit.js.org/usage/usage-guide#use-with-redux-persist
2023-07-08 11:24:04 +02:00
ZauberNerd d5131d167d
Add service worker and make PWA installable
This commit adds a service worker to make the app installable as a PWA.
In addition to caching all generated build artifacts (css and js filse)
the service worker also caches all other static files via a
stale-while-revalidate strategy (png, ico, json, css from the public
folder).
Further, this commit adds a Notification which will be shown when the
service worker updates and clicking on the button inside it causes
the service worker to update and the page to reload.

In order to make a PWA installable we need to follow some guide lines:
https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/Making_PWAs_installable

Fixes: #147
2023-07-07 22:15:19 +02:00
ZauberNerd a3da33d824
Replace create-react-app with vite
create-react-app seems to struggle a bit [1] and many folks are
recommending vite as an alternative, as that project is more active.
For me the reason to switch to vite is to reduce dependencies and speed
up the build process.

Replacing create-react-app with vite reduce the number of dependencies
from 1762 to 444.

I was also quite surprised, by how small the actual diff in this commit
is. From that perspective there is almost no discernible difference
between the two tools.

[1]: https://github.com/reactjs/react.dev/pull/5487#issuecomment-1409720741
2023-07-07 22:13:33 +02:00
ZauberNerd 0ca07ee805
Remove unused dependencies
Keeping the amount of dependencies small speeds up installations.
It also helps to reduce the clutter and to get a better overview of the
application.
2023-07-07 13:48:08 +02:00
cogentapps 23c0169c63 GPT-4 general availability 2023-07-06 20:20:22 +00:00
cogentapps 2d95041970 fix max tokens 2023-07-04 18:59:27 +00:00
cogentapps 359d3c6566 fix token slider 2023-07-04 09:44:21 +00:00
cogentapps 2d42fbd94a search adjustments 2023-07-02 08:07:17 +00:00
cogentapps 56582e6f5e make katex optional 2023-07-02 08:00:39 +00:00
cogentapps 1f739e94c4 add other gpt versions 2023-07-01 20:09:50 +00:00
Cogent Apps a9c3f38d60 fix bug in tokenizer 2023-04-29 18:52:34 +00:00
Cogent Apps 6b271a41c1 submit on ctrl-enter 2023-04-29 18:51:54 +00:00
Cogent Apps 4cf0915670 fix user-scoped options not being loaded 2023-04-29 18:30:29 +00:00
Cogent Apps 8f9ec46f9e allow services for anonymous users & gpt4 fix 2023-04-29 18:29:48 +00:00
Cogent Apps fbbb73abf9 remove tts debug code 2023-04-15 12:27:11 +00:00
Cogent Apps 8ec99aba68 build fixes 2023-04-15 10:33:19 +00:00
Cogent Apps eb58d900b5 v0.2.3 2023-04-15 10:30:02 +00:00
Cogent Apps 943bca2f4d 0.2.2 2023-04-15 10:11:51 +00:00
Cogent Apps 5860607af3 add export & link to beta 2023-04-15 10:10:53 +00:00
Cogent Apps 6fcc7494f3
Merge pull request #60 from tluyben/firstload-autoscroll2
first load auto scroll to bottom
2023-04-12 02:38:17 -07:00
Bagas Wastu 2f7747295b add enter to send checkbox 2023-03-23 12:55:04 +07:00
Cogent Apps d7251e34da speech recognition error handling & browser fixes 2023-03-21 00:11:05 +00:00
Cogent Apps 9e10796b5a fix memo deps 2023-03-20 21:28:49 +00:00
Cogent Apps 6359c9f50d fallback to whisper when speechrecognition is not available 2023-03-20 21:03:12 +00:00
Cogent Apps 1917bc19e0
possible fix for speech recognition on android 2023-03-20 08:36:20 -07:00
Cogent Apps ce63613bdf speech error handling & tweaks 2023-03-20 14:46:01 +00:00
Cogent Apps f0b22eff64 possible fix for delete button 2023-03-20 14:18:25 +00:00
Cogent Apps da0d4844f1 better error messages 2023-03-20 14:14:03 +00:00
Cogent Apps 746981ed9e update trimmer logic 2023-03-20 14:13:43 +00:00
Cogent Apps 95bf0aef6c
Merge pull request #58 from tluyben/whisper-stt-api
Whisper stt api
2023-03-20 06:06:18 -07:00
Cogent Apps b6881c69b4 add typescript tokenizer and better chat trimmer 2023-03-20 13:03:53 +00:00
Cogent Apps 216ecd5b32
fix list numbering 2023-03-19 02:46:33 -07:00
Tycho Luyben 39e175bef6 improvements, see comments: https://github.com/cogentapps/chat-with-gpt/pull/58 2023-03-19 09:33:52 +00:00
Tycho Luyben d8a497eca1 first load auto scroll to bottom 2023-03-19 07:34:13 +00:00
Tycho Luyben e3f4dfef82 whisper added 2023-03-19 07:22:23 +00:00
Tycho Luyben 172c5521a5 first framework for using the whisper openai api 2023-03-18 14:06:11 +00:00
Tycho Luyben 72cefee277 removed logging 2023-03-18 12:57:32 +00:00
Tycho Luyben 7e9f67c7b8 added the browser stt api 2023-03-18 12:49:30 +00:00
Cogent Apps 4190a0d58c 0.2.1 2023-03-18 10:04:51 +00:00
Cogent Apps 1d0c334f22 meta tags 2023-03-18 09:04:26 +00:00
Cogent Apps 1be33f5d0b add support for deleting chats 2023-03-17 20:45:27 +00:00
Cogent Apps 6415e3032c suspense 2023-03-17 19:56:59 +00:00
Cogent Apps fe8626cf9d only attempt to sync when signed in 2023-03-17 19:06:36 +00:00