Commit Graph

1352 Commits

Author SHA1 Message Date
keyan fb1e1224c1 enhance diagnostics copy 2023-09-18 18:44:30 -05:00
keyan fb3837ea0a use number formatting more places 2023-09-18 18:09:08 -05:00
ekzyis 3a7c3f7af2
Add setting to send diagnostics back to SN (#463)
* Add diagnostics settings & endpoint

Stackers can now help us to identify and fix bugs by enabling diagnostics.

This will send anonymized data to us.

For now, this is only used to send events around push notifications.

* Send diagnostics to slack

* Detect OS

* Diagnostics data is only pseudonymous, not anonymous

It's only pseudonymous since with additional knowledge (which stacker uses which fancy name), we could trace the events back to individual stackers.

Data is only anonymous if this is not possible - it must be irreversible.

* Check if window.navigator is defined

* Use Slack SDK

* Catch errors of slack requests

---------

Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-09-18 18:00:16 -05:00
rleed e5852ee0b1
Add search hints to initial search page (#497)
* add search hints

* revise hint about sub searches

---------

Co-authored-by: rleed <rleed1@pm.me>
2023-09-18 17:50:41 -05:00
SatsAllDay 786c185464
Introduce format option on `numWithUnits` fn, consumed by bounty listing (#496) 2023-09-18 17:49:13 -05:00
keyan b0737e53d1 reward errything again, fix reward parameters 2023-09-18 17:48:05 -05:00
keyan d00de65e9b add a few contributors 2023-09-18 14:20:19 -05:00
keyan ccb1c07c3f use code icon for contibutors 2023-09-18 14:17:22 -05:00
Leon Sander 2e7f7ce900
made Item.depth nullable (#493) 2023-09-18 13:57:44 -05:00
SatsAllDay bc2363dfab
Verified contributors (#474)
* `isContributor`, `hideIsContributor` user fields and basic UI decoration on profile page

* Update verified contributor decoration on profile page

* Add contributors instructions

* update setting label

* Remove `isContributor` from DB, load contributors from file into memory

* fix merge error

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-09-18 13:57:02 -05:00
SatsAllDay 8ab58fff87
Proposal: User Subscriptions: separate posts and comments (#470)
* Subscribe to user posts and comments independently

* Track when comments and posts subscriptions are set to filter out old items

* Only send push notification to subscribed user if posts/comments enabled

* Remove `posts` and `comments` boolean fields on UserSub, rely solely on timestamps
2023-09-18 13:20:02 -05:00
keyan 654ecaf00a use quote_ident 2023-09-14 10:46:59 -05:00
keyan cee00af83c fix job image upload 2023-09-14 10:35:13 -05:00
keyan 7d170a654f variable downzaps 2023-09-13 21:08:03 -05:00
keyan 25d2c58559 reward more of the post/comment tail 2023-09-13 18:36:42 -05:00
keyan 2d0f21fb20 increase disagree mult 2023-09-13 18:36:17 -05:00
keyan 4b543ae733 prevent wallet balance overflow 2023-09-12 20:21:59 -05:00
keyan 5de7573362 update daily permalink 2023-09-12 20:21:16 -05:00
keyan bd07fc7a25 fix height of foward percent on validation err 2023-09-12 17:04:49 -05:00
keyan e557882a7d don't notify about thread creation on forward 2023-09-12 16:36:52 -05:00
keyan 52d938a22a remove block from blockheight 2023-09-12 16:36:26 -05:00
keyan 79b58600e9 fix styling of forwards 2023-09-12 15:56:03 -05:00
keyan c3498be5ba signup => sign up in welcome banner 2023-09-12 14:51:55 -05:00
keyan 490edd6833 prevent horizontal layout shift when balance is hidden 2023-09-12 14:50:06 -05:00
keyan b1d6bf058e make balance hiding work on mobile using pointer events 2023-09-12 14:37:13 -05:00
ekzyis 6df654b208
Hide wallet balance (#481)
* Hide wallet balance on long press

* Use setting to hide wallet balance

* Fix layout shift on hover

* Fix SSR warning about useLayoutEffect

See https://reactjs.org/link/uselayouteffect-ssr

* Also hide balance in wallet

---------

Co-authored-by: ekzyis <ek@stacker.news>
2023-09-12 12:19:26 -05:00
SatsAllDay 1a6dc879a2
Dependency inject `me` into post validation schemas to enforce no forwarding posts to self (#485)
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-09-12 11:56:59 -05:00
SatsAllDay 16a6f93708
Add block height to price carousel (#484)
* Add block height to price carousel

source block height from mempool.space API
https://mempool.space/docs/api/rest#get-block-tip-height

* Add block height to SSR, clean up fragment query

* Cache block height for 1 minute, not 30 seconds

use `numWithUnits` for block height label

* Replace mempool.space API with LND API call

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-09-12 10:56:02 -05:00
SatsAllDay 94fbabcdf9
Notifications for when you are forwarded sats from a post (#467)
* Notifications for when you are forwarded sats from a post

Support notifications when a post for which you are forwarded gets zapped

This is controlled by a new boolean flag in user settings

* Send push notifications to forwarded users when they get forwarded sats

* Add `Promise.allSettled` per PR feedback

* Remove `FEE` act type when building forwarded zaps notifications

Don't include `FEE` actions, only `TIP` actions to avoid "0 sats forwarded" notifications

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-09-12 10:31:46 -05:00
keyan 9064224fd3 allow input character overflow for editting 2023-09-11 19:59:36 -05:00
SatsAllDay 77daa458cf
Visual Character counter for post titles, poll options (#466)
* Indicate how many chars remain for title field and poll options

Live counter update to help authors know how many more chars they have
to use in their post titles, and also poll options

* Use InputInner for consistency

* Refactor to reuse title hint across all forms

* Character(s)

* Move maxLength hint impl to InputInner, per PR feedback

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-09-11 19:20:44 -05:00
SatsAllDay cd3dbeb19b
Automatically subscribe forward users to threads (#464)
* Automatically subscribe forward users to threads

Update create and update item sql functions to subscribe forward
recipients to the post

When the post is updated, ensure that if a forward user has already unsubscribed, keep it that way. Also ensure that any forward users that are no longer forward users are removed from subscription

* Preserve thread subs from non-fwd users during post edit

* use EXISTS to make a little clearer

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-09-11 19:08:31 -05:00
rleed 1969d82741
move search bar to top of page (#433)
* move search bar to top of page

* move select inputs below search bar

* reduce complexity

* default search to zaprank

* votes => zaprank

---------

Co-authored-by: rleed <rleed1@pm.me>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-09-11 18:11:47 -05:00
rleed 2ba969ebab
Add new visitor welcome banner (#418)
* add new visitor welcome banner

* show dismissible banner on first-time login

* add mutation to hide welcome banner

* Update components/banners.js

Co-authored-by: ekzyis <27162016+ekzyis@users.noreply.github.com>

* fix error handling

* simplifications and other review suggestions

* cleanup

* restore selective display logic

* remove unnecessary query arguments

* cleanup a bit more

* don't show welcome banner to existing stackers

---------

Co-authored-by: rleed <rleed1@pm.me>
Co-authored-by: ekzyis <27162016+ekzyis@users.noreply.github.com>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-09-11 16:29:45 -05:00
ekzyis e2548e718d
Remove orientation from manifest (#483)
This overrides OS auto-rotate settings on Android. This means that the PWA does auto-rotate even if the OS setting to auto-rotate is not enabled.

This property is experimental and only supported by Chromium-based browsers anyway.

Also, you can still manually rotate if you want.

Co-authored-by: ekzyis <ek@stacker.news>
2023-09-11 14:58:41 -05:00
ekzyis 0c7d432056
Fix replying to wrong comment (#478)
Co-authored-by: ekzyis <ek@stacker.news>
2023-09-11 14:58:11 -05:00
SatsAllDay 9d05a5d09f
toast border color based on variant (#469) 2023-09-11 14:57:41 -05:00
SatsAllDay ec758b2d5f
vary push notification body for subscriptions based on whether item is post (#476) 2023-09-11 14:56:50 -05:00
keyan e6ffeb8f76 newsletter template improvements 2023-09-03 11:59:55 -05:00
keyan 89e64351dd fix boost in newsletter template gen 2023-09-02 12:24:00 -05:00
keyan 40a01789ec newsletter script 2023-09-02 12:21:00 -05:00
keyan 29d17dce21 fix invoicable modal close race condition 2023-08-31 12:26:42 -05:00
keyan b7d0a373f4 don't notify for hold invoices 2023-08-31 11:38:45 -05:00
keyan ed722fffdd remove reminder that you can overpay an invoice 2023-08-31 10:37:58 -05:00
keyan 3e0167a4aa fix merge typo 2023-08-31 10:20:01 -05:00
ekzyis 6c203a4476
Use callback to clear local storage on success (#462)
Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-08-31 10:15:52 -05:00
ekzyis 803acd1fc4
Replace FundError with InvoiceModal (#455)
* invoices are no longer deleted to prevent double-spends but marked as confirmed.
  therefore, during checkInvoice, we also check if the invoice is already confirmed.
* instead of showing FundError (with "fund wallet" and "pay invoice" as options), we now always immediately show an invoice
* since flagging, paying bounties and poll voting used FundError but only allowed spending from balance, they now also support paying per invoice

Co-authored-by: ekzyis <ek@stacker.news>
2023-08-31 10:10:24 -05:00
ekzyis ac45fdc234
Use HODL invoices (#432)
* Use HODL invoices

* Fix expiry check comparing string with Date

* Fix unconfirmed user balance for HODL invoices

This is done by syncing the data from LND to the Invoice table.

If the columns is_held and msatsReceived are set, the frontend is told that we're ready to execute the action.

We then update the user balance in the same tx as the action.

We need to still keep checking the invoice for expiration though.

* Fix worker acting upon deleted invoices

* Prevent usage of invoice after expiration

* Use onComplete from <Countdown> to show expired status

* Remove unused lnd argument

* Fix item destructuring from query

* Fix balance added to every stacker

* Fix hmac required

* Fix invoices not used when logged in

* refactor: move invoiceable code into form

* renamed invoiceHash, invoiceHmac to hash, hmac since it's less verbose all over the place
* form now supports `invoiceable` in its props
* form then wraps `onSubmit` with `useInvoiceable` and passes optional invoice options

* Show expired if expired and canceled

* Also use useCallback for zapping

* Always expire modal invoices after 3m

* little styling thing

---------

Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-08-30 21:48:49 -05:00
SatsAllDay c6dfd1e39c
Fix toast weirdness on iOS scrolling (#461)
* Fix toast weirdness on iOS scrolling

* Remove unnecessary css hacks
2023-08-30 21:16:47 -05:00
SatsAllDay 906571324a
De-dupe item-driven notifications (#457)
* De-dupe item-driven notifications

Update how we query for item-driven notifications to de-dupe them for:

1. mentions
2. replies
3. thread subscriptions
4. user subscriptions

users should recieve only 1 notification for any given item created by another user, following the above priority order

this is accomplished by querying for replies to current user, replies on subscribed threads, items from subscribed users, and mentions (if enabled for the current user), sorting those results by item id and priority order within item id based on notification type, then selecting the highest priority notification from each item id

these results are then union all'ed with all other notification types, unchanged.

* remove extra union hashing

---------

Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-08-30 20:38:31 -05:00