Commit Graph

325 Commits

Author SHA1 Message Date
keyan 10e8cb35df fix import on invites 2023-07-31 09:11:22 -05:00
keyan d2216e80da conform to linter 2023-07-31 08:39:10 -05:00
keyan c909efb7b7 update wallet code to prisma 5, handle prisma 5 errors on serialization 2023-07-31 08:31:40 -05:00
keyan 42bdd40f91 show errors on settings during auth linking 2023-07-30 15:39:18 -05:00
keyan 63a4a7acad fix settings hydration error 2023-07-30 14:38:50 -05:00
keyan d04dc691df provide jwt migration 2023-07-30 14:03:24 -05:00
keyan 5232b59625 upgrade to next-auth 4 (bonus: improve error pages) 2023-07-29 14:38:20 -05:00
keyan 688d67a0d6 improve service worker asset precaching and offline page 2023-07-28 10:57:12 -05:00
keyan 7542dd6cc4 upgrade to prisma 4 2023-07-26 19:18:42 -05:00
keyan 672853a7ea upgrade to prisma 3 2023-07-26 11:01:31 -05:00
keyan 8ab018af88 fix nested comment sorting 2023-07-25 19:45:35 -05:00
keyan 98552c853c fix back button behavior on select navigation 2023-07-25 15:29:45 -05:00
keyan 4bfd021342 enhance styling 2023-07-25 13:32:48 -05:00
keyan ab2046ab0b fix issues with new linting 2023-07-25 09:14:45 -05:00
keyan dae9c64e96 more package updates 2023-07-24 19:50:55 -05:00
keyan e87610c45b update packages and reduce bundle size 2023-07-24 17:50:12 -05:00
keyan 356f7e072c 50% reduction in bundle size by being careful with big imports 2023-07-24 16:06:26 -05:00
keyan 6407455def upgrade react-bootstrap 2023-07-24 13:53:53 -05:00
keyan 59f7b6ff26 Revert "Revert "shield your eyes; massive, squashed refactor; nextjs/react/react-dom/apollo upgrades""
This reverts commit 18910fa2ed.
2023-07-23 10:08:43 -05:00
keyan 18910fa2ed Revert "shield your eyes; massive, squashed refactor; nextjs/react/react-dom/apollo upgrades"
This reverts commit d0314ab73c.
2023-07-23 09:16:12 -05:00
keyan d0314ab73c shield your eyes; massive, squashed refactor; nextjs/react/react-dom/apollo upgrades 2023-07-21 17:33:11 -05:00
keyan 0ff4da1a4f fix empty signup page 2023-07-11 10:21:46 -05:00
keyan 93afd4ea9a fix credentials login/signup/link bug 2023-07-10 19:20:38 -05:00
keyan efa3172f15 top stackers sorted stat to front 2023-07-10 12:59:21 -05:00
keyan 27833c9888 attempt to fix auth linking regression 2023-07-10 12:18:17 -05:00
keyan e8aa0a4dae users? => stackers? 2023-07-09 12:53:50 -05:00
keyan 0c67808e44 make reward timer dst sensitive 2023-07-07 14:44:12 -05:00
ekzyis 3c3a97fb8e
Fix reward countdown for other time zones (#347)
Co-authored-by: ekzyis <ek@stacker.news>
2023-07-06 20:55:18 -05:00
keyan 0c51309520 enhance pwa presentation 2023-07-06 16:53:48 -05:00
keyan ec9a424bf4 reward countdown in footer 2023-07-06 12:43:51 -05:00
keyan 09d7e960cc back to lightning animation 2023-07-05 09:47:44 -05:00
keyan 3068252adf merge github master 2023-07-04 15:35:04 -05:00
ekzyis 388e00dd04
Service worker rework, Web Target Share API & Web Push API (#324)
* npm uninstall next-pwa

next-pwa was last updated in August 2022.
There is also an issue which mentions that next-pwa is abandoned (?): https://github.com/shadowwalker/next-pwa/issues/482

But the main reason for me uninstalling it is that it adds a lot of preconfigured stuff which is not necessary for us.
It even lead to a bug since pages were cached without our knowledge.

So I will go with a different PWA approach. This different approach should do the following:
- make it more transparent what the service worker is doing
- gives us more control to configure the service worker and thus making it easier

* Use workbox-webpack-plugin

Every other plugin (`next-offline`, `next-workbox-webpack-plugin`, `next-with-workbox`, ...) added unnecessary configuration which felt contrary to how PWAs should be built.
(PWAs should progressivly enhance the website in small steps, see https://web.dev/learn/pwa/getting-started/#focus-on-a-feature)

These default configurations even lead to worse UX since they made invalid assumptions about stacker.news:
We _do not_ want to cache our start url and we _do not_ want to cache anything unless explicitly told to.
Almost every page on SN should be fresh for the best UX.

To achieve this, by default, the service worker falls back to the network (as if the service worker wasn't there).

Therefore, this should be the simplest configuration with a valid precache and cache busting support.

In the future, we can try to use prefetching to improve performance of navigation requests.

* Add support for Web Share Target API

See https://developer.chrome.com/articles/web-share-target/

* Use Web Push API for push notifications

I followed this (very good!) guide: https://web.dev/notifications/

* Refactor code related to Web Push

* Send push notification to users on events

* Merge notifications

* Send notification to author of every parent recursively

* Remove unused userId param in savePushSubscription

As it should be, the user id is retrieved from the authenticated user in the backend.

* Resubscribe user if push subscription changed

* Update old subscription if oldEndpoint was given

* Allow users to unsubscribe

* Use LTREE operator instead of recursive query

* Always show checkbox for push notifications

* Justify checkbox to end

* Update title of first push notification

* Fix warning from uncontrolled to controlled

* Add comment about Notification.requestPermission

* Fix timestamp

* Catch error on push subscription toggle

* Wrap function bodies in try/catch

* Use Promise.allSettled

* Filter subscriptions by user notification settings

* Fix user notification filter

* Use skipWaiting

---------

Co-authored-by: ekzyis <ek@stacker.news>
2023-07-04 14:36:07 -05:00
keyan b6628eb159 july 4th festivities 2023-07-03 14:46:54 -05:00
keyan 747371a4e4 snl live banner 2023-06-20 09:57:06 -05:00
keyan 59ee15b551 new user email copy 2023-06-19 17:42:47 -05:00
keyan cc6dc8c68b add daily discussion thread permalink 2023-06-19 14:40:24 -05:00
keyan 3e4161ae8c tip -> zap 2023-06-19 13:21:55 -05:00
keyan f0f51438c4 add top posts/comments to subs 2023-06-12 19:40:18 -05:00
keyan ed938527fd simply respect notification alert message 2023-06-12 15:37:12 -05:00
keyan 342a165ced refine cancel button 2023-06-12 14:39:27 -05:00
ekzyis 069417d130
Enable push notifications in settings (#301)
* Enable push notifications in settings

* Fix checkbox still checked after user denied permission

The error was related to me thinking that the value prop does anything. It didn't.
The value of the checkbox is handled by formik.
So the solution was to hook into formik and use the handler which actually changes the value.

* Add double opt-in to /notifications

* Better styling of alert in /notifications

---------

Co-authored-by: ekzyis <ek@stacker.news>
2023-06-12 13:03:44 -05:00
ekzyis e243c1c224
Add cancel button for editing all post types + bio (#310)
* Add cancel button when editing any post type

* Add cancel button when editing bio

---------

Co-authored-by: ekzyis <ek@stacker.news>
2023-06-12 12:35:28 -05:00
ekzyis 3ee16422f7
Fix code style (#303)
Co-authored-by: ekzyis <ek@stacker.news>
2023-06-05 14:07:29 -05:00
keyan d4988694c8 make room in header to pwa back button 2023-06-01 19:34:26 -05:00
ekzyis 88372b6a9e
Use fallback instead of 500 if callback malformed (#296)
Co-authored-by: ekzyis <ek@stacker.news>
2023-05-31 19:48:14 -05:00
ekzyis e97509eea7
Use PWA with display: standalone (#292)
* Use next-pwa

* Use standalone + back button

* Use Notification API

* Use custom service worker

* Use url_handlers

* Add offline page

* Use smaller icon in notification

* Only prompt for notifications if logged in

* small enhancements to standalone pwa

* remove unused back arrow

---------

Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-05-31 17:28:33 -05:00
keyan 244cff14b0 fix for user stat dashboard 2023-05-21 12:08:41 -05:00
keyan 4aee2c745f stats are averages now 2023-05-19 18:12:48 -05:00
keyan 0a3f5fd201 materialize dashboard in views 2023-05-19 17:38:39 -05:00