1
0
mirror of git://jb55.com/damus synced 2024-09-29 00:10:43 +00:00
Commit Graph

585 Commits

Author SHA1 Message Date
Daniel D’Aquino
79fef51f68 Improve Video visibility tracking and automatic play/pause
The DamusAVPlayerView (along with other classes) play or pause based on
their Y position relative to the user's viewport. This is ideal for a
vertical feed of notes.

However, this does not work well on a horizontal carousel, such as when
viewing videos on the full-screen carousel and swiping left/right.

This commit adds a new tracking method based on onAppear/onDisappear
triggers from a lazy stack (which only loads when it is visible), and
applied it to videos shown on a full screen carousel, so that videos
pause when we swipe away from the video.

Incidentally, this also fixes an issue I was seeing where a full screen
video would disappear as soon as I rotated the phone to landscape mode.

Testing
--------

Device: iPhone 13 Mini
iOS: 17.3.1
Damus: This version
Coverage:
1. Scroll down a feed full of videos and make sure videos still autoplay when passing through them. PASS
2. Check videos on the feed are muted by default. PASS
3. Check mute button on the video still works. PASS
4. Check clicking on the video brings it to a full-screen carousel view. PASS
5. Check that videos play unmuted by default on full-screen carousel view. PASS
6. Check that all playback controls work on the full-screen carousel view. PASS
7. Check that clicking outside the video shows/hides the carousel overlays. PASS
8. Check that a summary of the note shows up. PASS
9. Check that clicking on that note takes the user to the thread view. PASS
10. Check that changing phone orientation between portrait and landscape on both full-screen carousel AND full-screen video modes will work as expected. PASS
11. Check close button on full-screen carousel works. PASS
12. Check that swiping the video away exits full-screen carousel. PASS
13. Check that full-screen carousel works with images. PASS
14. Check that a carousel with multiple images/videos can be swiped left and right. PASS
15. Check that swiping away from a video on a full-screen carousel will pause it. PASS
16. Check that clicking on an unmuted video on the feed won't cause double-audio issues. PASS
17. Check that full-screen carousel view looks good on both dark and light modes. PASS

Closes: https://github.com/damus-io/damus/issues/1530
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Link: 20240318222048.14226-6-daniel@daquino.me
Signed-off-by: William Casarin <jb55@jb55.com>
2024-03-20 09:55:48 +00:00
Daniel D’Aquino
671b0b67ce Add playback controls to videos
This commit includes several UX changes to give users better control
over video playback. It also, by design, work arounds a SwiftUI quirk*

Here are the changes to the UX:

1. Videos on the feed only have a mute/unmute button
2. When the user clicks on the video, they are taken to a full screen carousel view (similar to when you click on an image)
3. The full-screen carousel view shows all video playback controls (through a specific SwiftUI hack)
4. If the carousel has multiple videos/images, the user can swipe between them normally as expected

Other UI changes that were made:

- The full screen carousel now uses dark mode (black background, white close button)

* The SwiftUI quirk is that when video views are placed within a TabView with ".page" tab view style, the tabview consumes most of the user gestures, making the video playback controls unusable.

Changelog-Changed: Improve UX around video playback
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Link: 20240318222048.14226-3-daniel@daquino.me
Signed-off-by: William Casarin <jb55@jb55.com>
2024-03-20 09:55:48 +00:00
ericholguin
5e530bfc9c ui: Wallet View redesign + Mutiny Wallet integration
This patch redesigns the wallet view to more closely match Rob's design.
In addition this patch allows users to connect to Mutiny Wallet by clicking a button.

iPhone SE (3rd generation) Dark Mode:
https://v.nostr.build/K9lk.mp4

iPhone 15 Pro Max Light Mode:
https://v.nostr.build/9mKA.mp4

Connected Alby Wallet:
https://i.nostr.build/kyd5.png

Changelog-Added: Connect to Mutiny Wallet Button
Changelog-Changed: Moved paste nwc button to main wallet view
Changelog-Changed: Errors with an NWC will show as an alert
Changelog-Fixed: Issue where NWC Scanner view would not dismiss after a failed scan/paste
Signed-off-by: ericholguin <ericholguin@apache.org>
Reviewed-by: William Casarin <jb55@jb55.com>
Link: 20240310223713.4541-1-ericholguin@apache.org
Signed-off-by: William Casarin <jb55@jb55.com>
2024-03-11 10:12:05 +00:00
ericholguin
0719e94fbc ux: Relay View Improvements
This patch removes the Recommended Relay View and the old representation of recommended relays.
Adds a tab view style to the Relay Config View allowing the user to switch between their connected relays
and recommended relays. They can add and remove from the recommended view as well. For users logged in with
a pubkey the add button will no longer be displayed.

Testing
——
iPhone 15 Pro Max (17.0) Light Mode:
https://v.nostr.build/QGMZ.mp4

iPhone SE (3rd generation) (16.4) Dark Mode:
https://v.nostr.build/Wlw3.mp4
——

Changelog-Changed: Relay config view user interface

Signed-off-by: ericholguin <ericholguin@apache.org>
Link: 20240307152808.47929-1-ericholguin@apache.org
Signed-off-by: William Casarin <jb55@jb55.com>
2024-03-11 10:03:49 +00:00
William Casarin
122775e586 Kick off v1.8 (1)
Signed-off-by: William Casarin <jb55@jb55.com>
2024-03-11 09:59:21 +00:00
William Casarin
d83d618829 Merge branch 'v1.7-madeira-release' 2024-03-11 09:58:50 +00:00
William Casarin
669ca0d91c v1.7.2
Fix a few appstore iap-subscription purple ux issues

Signed-off-by: William Casarin <jb55@jb55.com>
2024-03-11 09:38:29 +00:00
William Casarin
9511ba767a Merge branch 'v1.7-madeira-release' 2024-03-04 17:28:01 +00:00
William Casarin
d9f78cf805 v1.7.1 (12)
subscriber EULA and privacy policy notices on purple subscription
page

Signed-off-by: William Casarin <jb55@jb55.com>
2024-03-04 16:40:55 +00:00
William Casarin
c6e37bd864 refactor: introduce PurpleBackdrop
We mainly want to use this to improve previews for now, but might be
useful in the future.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-03-04 14:03:53 +00:00
William Casarin
184fc865bb Bump to 1.7.1
Nothing has changed, but we need to submit a new minor version with
the subscription products since we missed those in the 1.7 appstore
release.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-03-02 09:16:07 +00:00
kernelkind
6de44223f2 add performance upgrades to media picker
- Use jpeg instead of png data when processing a UIImage.
- Make processing of media occur after user confirms upload selection when possible for better responsiveness.
- Reduce redundant data fetching.

Lightning-address: kernelkind@getalby.com
Signed-off-by: kernelkind <kernelkind@gmail.com>
Link: 20240228033235.66935-2-kernelkind@gmail.com
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-29 12:12:22 +00:00
William Casarin
75d87fee9d Merge tag 'v1.7-rc2'
v1.7 Madeira release RC2

55c26d22cb v1.7 (11)
4c8134908c Enable IAP feature for release
3ac7d75235 Add UI error message when IAP succeeds but receipt verification fails
b49a5f4d29 Purple: Improve UX on Damus Purple renewals
3569919eaf Add Damus Purple impending expiry notification support
2024-02-29 03:11:15 -08:00
Daniel D’Aquino
55c26d22cb v1.7 (11) 2024-02-28 23:41:56 -08:00
Daniel D’Aquino
3569919eaf Add Damus Purple impending expiry notification support
This commit adds Damus Purple expiry notification support.

How it works: Whenever the app initiates or enters the foreground, it
checks the user's account expiry, and calculates what notifications to
display (It is functional, not imperative, to better match how
the notifications view works)

The notification handlers work the same as every other notification
handler for Nostr events. However, local iOS notifications were not
implemented to maintain these reminders more discreet.

Current limitations:
- Notifications cannot be dismissed
- Notifications are dismissed only when Damus Purple is extended
- After making a purchase, notifications are not dismissed right away
- Bell icon with purple badge shows up on every app restart if user's account is expired

Testing
-------

Device: iPhone 13 Mini
iOS: 17.3.1
Damus: This commit
damus-api: d3801376fa204433661be6de8b7974f12b0ad25f
Setup:
- Local servers Setup
- Debug endpoints enabled for changing expiry date on the fly
Coverage:
1. Expired account
  1. Starting the app on home screen shows bell icon with purple badge. PASS
  2. 4 notifications appear on notifications view (7,3,1,0 days to expiry). PASS
  3. Notifications appear in correct chronological order. PASS
  4. Notifications look consistent in appearance. PASS
  5. Expiry notifications' text size follows text size settings. PASS
  6. Clicking on notification CTA takes user to account info page. PASS
2. Non-expired account (set expiry, restart app)
  1. No expiry notifications, no bell icon. PASS
3. Expiry in 6 days (set expiry, restart app)
  1. Starting the app on home screen shows bell icon with purple badge. PASS
  2. Starting the app on the notification screen renders notifications the same way. PASS
  3. Only one notification (7 days remaining) appears. PASS
4. Expiry in 2 days. PASS
5. General
  1. Clicking bell icon clears away "new notifications" badge. PASS
  2. Performance of notifications view does not seem affected. PASS
  3. Performance of app on startup does not seem affected. PASS
6. IAP
  1. Active IAP + expiry date in 2 days does not trigger reminder notification (Because it is auto-renewed). PASS

Closes: https://github.com/damus-io/damus/issues/1973
Changelog-Added: Notification reminders for Damus Purple impending expiration
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2024-02-28 23:20:48 -08:00
William Casarin
55000e9d4d Merge improved mute functionality from Charlie
This merge adds a bunch of new features from charlie's work on the new
mutelist changes:

- Muted words

- Mute performance optimizations

- New mute list UI

I needed to make a few changes to fix the tests in this merge. Otherwise
it seems to work ok!

Thank to Charlie for getting all of this working after many rounds of
review!

* branch `mute` of https://github.com/damus-io/damus:
  mute: fix bug with duplicate Indefinite items in MuteDurationMenu
  mute: fix mute hashtag from search view if no existing mutelist
  mute: integrate new MutelistManager
  mute: adding MutelistManager.swift
  mute: add maybe_get_content function to NdbNote
  mute: fix bug where mutes can't be added without existing mutelist
  mute: fix issue with not being able to change mute duration
  mute: don't mutate string when adding hashtag
  mute: implement fast MuteItem decoder
  tags: add u64 decoding function
  mute: migrating muted_threads to new mute list
  mute: adding ability to mute hashtag from SearchView
  mute: updating UI to support new mute list
  mute: adding filtering support for MuteItem events
  mute: receiving New Mute List Type
  mute: migrate Lists.swift to use new MuteItem
  mute: add new UI views for new mute list
  mute: adding new structs/enums for new mute list

Changelog-Added: Add ability to mute words, add new mutelist interface (Charlie)
2024-02-26 12:02:41 -08:00
Charlie Fish
a9baef7a21 mute: adding MutelistManager.swift
This patch adds MutelistManager which contains separate sets for each
type of muted item.

Whenever we receive a new event we parse it into those sets.

When checking to see if an event is muted, we simply check in each of
those sets if it contains the given mute. For words/phrases we have to
loop through each item in the set to see if the event contains the given
word.

In future patches I will be implementing and integrating this new
MutelistManager.

Lighting-Address: fishcharlie@strike.me
Signed-off-by: Charlie Fish <contact@charlie.fish>
Reviewed-by: William Casarin <jb55@jb55.com>
Link: 20240210163650.42884-3-contact@charlie.fish
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-26 11:29:41 -08:00
kernelkind
2be83560bc refactor: rename ImagePicker -> MediaPicker
The responsibility of MediaPicker is to 'pick' all sorts of media, not
just images.

Lightning-address: kernelkind@getalby.com
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-20 11:19:21 -08:00
kernelkind
904ae6c24d picker: upgrade to newer image picker controller
Upgrade the ImagePicker to use PHPickerViewController instead of
UIImagePickerController for the photo library since the
PHPickerViewController allows for more options for how the user
shares their media, such as whether location data should be
included.

Create a CameraController since PHPickerViewController is only used for
the photo library. After capturing media with the camera, it will be
saved to the user's photo library and the photo library view will
appear for the user to select the media they captured. The user can then
toggle whether they would like apple to strip their media of location
data before handing it off to Damus.

Lightning-address: kernelkind@getalby.com
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-20 11:18:05 -08:00
kernelkind
8d815fe4d6 privacy: add function to strip location data from photos
Add a function to strip GPS data from images before uploading to
hosting service.

Lightning-address: kernelkind@getalby.com
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-20 11:17:57 -08:00
kernelkind
58326f679e translate: implement string distance for close matches
Implement the levenshtein string distance algorithm for determining
if the translation is too similar to the original content.

Closes: https://github.com/damus-io/damus/issues/1996

Lightning-address: kernelkind@getalby.com
Signed-off-by: kernelkind <kernelkind@gmail.com>
Reviewed-by: William Casarin <jb55@jb55.com>
Link: 20240214032018.57812-1-kernelkind@gmail.com
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-19 13:10:13 -08:00
ericholguin
90180202b6 nip48: initial support
This patch adds a new ProxyView which is added to the Event Shell
whenever an event has the proxy tag. It includes images of the protocol
logos that are listed in the NIP docs.

Reviewed-by: William Casarin <jb55@jb55>.com
Link: 20240205032400.7069-1-ericholguin@apache.org
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-19 12:11:47 -08:00
Daniel D’Aquino
d694c26b83 iap: move StoreKit logic out of DamusPurpleView and into a new PurpleStoreKitManager
This commit moves most of StoreKit-specific logic that was embedded into
DamusPurpleView and places it into a new PurpleStoreKitManager struct,
to make code more reusable and readable by separating view concerns from
StoreKit-specific concerns.

Most of the code here should be in feature parity with the previous
behavior. However, a few logical improvements were made alongside this
refactoring:

- Improved StoreKit transaction update monitoring logic: Previously the
  view would stop listening for purchase updates after the first update.
  However, I made the program continuously listen for purchase updates,
  as recommended by Apple's documentation
  (https://developer.apple.com/documentation/storekit/transaction/3851206-updates)

- Improved/simplified logic around getting extra information from the
  products: Information and the handling of product information was
  spread in a few separate places. I incorporated those bits of
  information into central and uniform interfaces on DamusPurpleType, to
  simplify logic and future changes.

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-19 10:38:43 -08:00
Daniel D’Aquino
2525799c8a refactor: split views from DamusPurpleView into separate files
This refactoring commit splits several view blocks from DamusPurpleView
into separate files.

- New view structs were defined within the DamusPurpleView namespace, to
  avoid polluting the global namespace

- No logical changes were made. The functionality should have stayed
  equivalent

- Changes were made conservatively, and as semantically as possible, to
  make the code easier to work with.

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-19 10:38:21 -08:00
Daniel D’Aquino
b3b6fdc29e refactor: move primitive views from DamusPurpleView into a separate file
This refactoring commit moves primitive, low complexity, helper views
from DamusPurpleView into a separate file, to reduce complexity on
DamusPurpleView.swift.

Although functions were changed into View structs, no logical changes
were made. (New version is functionally equivalent)

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-19 10:38:13 -08:00
William Casarin
881dae0954 v1.7 (10)
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-11 08:52:03 -08:00
William Casarin
4defab73d0 v1.7 (9)
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-01 11:28:32 -08:00
William Casarin
4a40c9987d v1.7 (8)
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-01 10:46:21 -08:00
William Casarin
28d6715fda v1.7 (7)
Signed-off-by: William Casarin <jb55@jb55.com>
2024-01-31 09:24:55 -08:00
William Casarin
66f17ecd96 v1.7 (6)
Signed-off-by: William Casarin <jb55@jb55.com>
2024-01-30 16:26:23 -08:00
Daniel D’Aquino
5f9477d55b purple: notify main DamusPurpleView when user gets a subsscription
Previously, if the user had the DamusPurpleView open and bought the
subscription, the DamusPurpleView would not change. It would stay in the
marketing pitch screen.

This commit makes sure that this view is automatically updated as soon
as the user sees the welcome screen, so that they can see their account
info in case they have DamusPurpleView open.

Testing
--------

PASS

iOS: 17.2
Damus: This commit
damus-api: Varying versions around `9a6af62`
Coverage:
1. Checked the entire LN flow through the local test environment using the simulator
2. Checked all LN flow views on both light and dark mode to ensure it looks good
3. Checked the entire LN flow using the staging environment using a physical iOS device

Closes: https://github.com/damus-io/damus/issues/1899
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-01-30 10:29:49 -08:00
Daniel D’Aquino
263389b2e6 purple: add translation setup view the onboarding
This commit changes the welcome view into a multi-step onboarding
process, where it makes it more clear that translations are unlocked,
and provides the user with some choices to set it up or not.

This flow also makes the translation setup possible on the LN flow

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-01-30 10:29:49 -08:00
Daniel D’Aquino
e649c49981 purple: adapt to integrate better with the LN flow
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-01-30 10:29:48 -08:00
Daniel D’Aquino
dd240899cf purple: improve environment handling
This commit improves the handling of different Purple environments:

- 3 environments were added (test, staging, production) to fulfill all
  testing needs

- Damus website constants were also added (This will become important
  for the next few commits)

- Toggle settings were replaced with a picker, where the user can select
  one of the 3 environments (test, staging, production)

- Damus purple page and website address links can now be obtained
  directly from the DamusPurple struct, which improves flexibility and
  reduces complexity for code that consumes these constants.

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-01-30 10:29:48 -08:00
William Casarin
83d2fbf7fd project: remove TXNDEBUG 2024-01-28 15:13:55 -08:00
William Casarin
beb3605411 v1.7 (5) 2024-01-26 14:06:21 -08:00
William Casarin
f190b6414c debug: enable txndebug 2024-01-26 14:02:29 -08:00
William Casarin
5b820d6920 1.7 (4) 2024-01-26 12:00:27 -08:00
William Casarin
98359beb04 v1.7 (3) 2024-01-26 11:14:44 -08:00
William Casarin
fbdc5446f0 project: clean up some stuff 2024-01-26 10:55:16 -08:00
William Casarin
deedf5577d Revert "camera: switch to new custom view"
This reverts commit ca779d472d.
2024-01-25 14:11:31 -08:00
William Casarin
4ddf647d5f Revert "camera: add ability to preview media taken with camera"
This reverts commit c67741983e.
2024-01-25 14:11:31 -08:00
Charlie Fish
71c9bd63fc mute: migrating muted_threads to new mute list
This patch depends on: Adding ability to mute hashtag from SearchView

This is the last patch for the new mute list feature

- Removing MutedThreadsManager
- Adding system to migrate existing muted threads to new mute list

Closes: https://github.com/damus-io/damus/issues/1718
Closes: https://github.com/damus-io/damus/issues/856
Lighting Address: fishcharlie@strike.me
Signed-off-by: Charlie Fish <contact@charlie.fish>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-01-25 12:12:59 -08:00
Charlie Fish
6d2c382469 mute: add new UI views for new mute list
- Adding MuteDurationMenu & AddMuteItemView
    - In a future patch I will update AddMuteItemView to actually update and relay the new mute list

Related: https://github.com/damus-io/damus/issues/1718
Related: https://github.com/damus-io/damus/issues/856
Lighting Address: fishcharlie@strike.me

Signed-off-by: Charlie Fish <contact@charlie.fish>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-01-25 12:12:59 -08:00
Charlie Fish
068b89d087 mute: adding new structs/enums for new mute list
- Adding MuteItem & DamusDuration
- Changing RefId hashtag associated type from TagElem to Hashtag
    - This is done because in MuteItem, we can not create a RefId.hashtag TagElem instance since we don’t have a note associated with a given hashtag mute item.

Related: https://github.com/damus-io/damus/issues/1718
Related: https://github.com/damus-io/damus/issues/856
Lighting Address: fishcharlie@strike.me

Signed-off-by: Charlie Fish <contact@charlie.fish>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-01-25 12:12:57 -08:00
William Casarin
f13267aeb2 Revert "mute: adding new structs/enums for new mute list"
This reverts commit 50f45288ce.
2024-01-25 12:11:34 -08:00
William Casarin
e6598928d0 Revert "mute: add new UI views for new mute list"
This reverts commit 9f332a148f.
2024-01-25 12:10:34 -08:00
William Casarin
719cec449c Revert "mute: migrating muted_threads to new mute list"
This reverts commit f341a37902.
2024-01-25 12:09:49 -08:00
William Casarin
0f307ab8d5 project: only bump damus build from project 2024-01-24 10:01:00 -08:00
William Casarin
63ad13a2d5 v1.7 (2) 2024-01-24 09:41:14 -08:00