Commit Graph

36 Commits

Author SHA1 Message Date
Charlie Fish
6003a501c1 mute: updating UI to support new mute list
This patch depends on: Adding filtering support for MuteItem events

- Gives more specific mute reason in EventMutedBoxView
- Showing all types of mutes in MutelistView
- Allowing for adding mutes directly from MutelistView
- Allowing for choosing duration of mute in EventMenu

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
William Casarin
356ef45b91 Revert "mute: updating UI to support new mute list"
This reverts commit 75d66434f3.
2024-01-25 12:10:03 -08:00
Charlie Fish
75d66434f3 mute: updating UI to support new mute list
This patch depends on: Adding filtering support for MuteItem events

- Gives more specific mute reason in EventMutedBoxView
- Showing all types of mutes in MutelistView
- Allowing for adding mutes directly from MutelistView
- Allowing for choosing duration of mute in EventMenu

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-22 12:55:03 -08:00
Daniel D’Aquino
0f86a41c4a ui: Hide quoted or reposted notes from people whom the user has muted. (#1216)
Summary
-------

This patch fixes the issue where the user might see notes from users that they have muted, if such note has been reposted or quoted.

Furthermore, this patch introduces some improvements on some of the associated views, making them more reusable.

Testing of the fix
------------------

**PASS**

**Device:** iPhone 14 Pro simulator
**iOS:** 17.0
**Damus:** This commit
**Test steps:**

1. Create two test accounts (if not created already). We will use test account "A". Test account "B" is an external test account
2. Make some notes from test account "B" (if non existent)
3. Switch to account "A"
4. Under test account "A", follow account "B"
5. Repost a note from account "B", and quote another note from account "B"
6. Access "account B"'s timeline. Repost and quoted note should all be visible. Layout should look as usual
7. Click on the reposted note. Should appear and it should look normal
8. Click on the note with the quote. Should appear and it should look normal
9. Click on the quoted note. Should appear and it should look normal
10. Now mute account "B"
12. Go back to account "A"'s timeline
13. Repost should appear, but the reposted content should be hidden behind a mute box. Clicking on show/hide should show or hide muted content
14. Note with quoted content should appear, but the quoted content should be hidden behind a mute box. Clicking on show/hide should work as expected
15. Make sure that the layout in steps 13 and 14 look good.
16. Click on the repost to access the thread view. Should be muted as expected.
17. Add a comment to the repost. Comment should appear even if the mute box hides the main note
18. Click on the note with quote to open its thread view. Comments should appear, main note should appear, but quoted content should be behind the mute box
19. Under account "B", add a comment to the quoted notes
20. Under account "A", check in the thread view that "B"'s reply is behind a mute box
21. Reply to the note with the quote. Check that the note appears correctly and that quoted content is behind the mute box (in the post composer view)
22. Find on Nostr a post where one of the replies contains a quoted note. Mute the user of the quoted content, and check that quoted content is now in a mute box

Smoke sanity test
-----------------

**PASS**

**Device:** iPhone 14 pro simulator
**iOS:** 16.4
**Test steps:** Browse a timeline filled with real notes and comments. Go through different notes and threads, mute some users, just to make sure nothing else appears obsviously broken.

Other notes
-----------

I removed this code:

```
.frame(maxWidth: .infinity, minHeight: PFP_SIZE)
```

from `EventShell`, because it was causing the layout to break on "threaded" style event view with muted quoted content (e.g. in a reply with quoted content).

The line of code dates back to `495859e07f`, but I am not sure why this line existed in the first place, or if removing it has any negative impact.

Closes: https://github.com/damus-io/damus/issues/1216
Changelog-Fixed: Hide quoted or reposted notes from people whom the user has muted. (#1216)
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-10-02 12:34:08 -07:00
Daniel D’Aquino
b86bac2e42 ui: Show muted thread replies at the bottom of the thread view (#1522)
Testing
-------

**PASS**

**Device:** iPhone 14 Pro simulator
**iOS:** 17.0
**Damus:** This commit
**Steps:**

1. Setup accounts "A" and "B" that you control. Account "A" will be on our device under test.
2. Post something
3. Make a reply using Account A (Reply 1)
4. Make a reply using Account B (Reply 2)
5. Make another reply using account A (Reply 3)
6. Order of replies should be (top to bottom): 1, 2, 3
7. Mute user B
8. Order of replies should be: 1, 3, 2

Performance check
-----------------

**Device:** iPhone 14 Pro simulator
**iOS:** 17.0
**Damus:** This commit
**Steps:**

1. Locally change the code and add a print statement right before the sorting begins. In that print statement, include the number of events that will be sorted
2. Run Damus and go to a busy thread (I found one with 45 replies)
3. Go to the thread, and monitor the logs.
4. Navigate a bit between replies and monitor logs.

**Results:** I only saw a few print statements being printed with each navigation action, which indicates that we are not constantly re-sorting this object (which would be inefficient). Therefore, it seems like performance/efficiency would not be a problem.

Changelog-Changed: Show muted thread replies at the bottom of the thread view (#1522)
Closes: https://github.com/damus-io/damus/issues/1522
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-10-02 12:34:08 -07:00
William Casarin
69c7acea76 tests: add ndb support to tests
stops it from crashing
2023-09-21 09:10:06 -04:00
William Casarin
c71b0ee916 blocks: pass keypair instead of privkey to avoid pubkey gen
Generating a pubkey is quite slow, so pass a keypair instead of privkey
2023-08-28 11:47:29 -07:00
William Casarin
cebd1f48ca ndb: switch to nostrdb notes
This is a refactor of the codebase to use a more memory-efficient
representation of notes. It should also be much faster at decoding since
we're using a custom C json parser now.

Changelog-Changed: Improved memory usage and performance when processing events
2023-08-03 13:20:36 -07:00
William Casarin
f9d21ef901 test: rename test_event to test_note 2023-07-31 05:38:19 -07:00
William Casarin
f2cf30a728 Scroll to top for longform events only
Fixes: ad6a1962 ("Scroll to top of event instead of bottom")
2023-07-12 08:23:53 -07:00
William Casarin
601fa49a6e nozaps: don't show top zaps or zap replies
We can't associate zaps with notes anymore
2023-06-23 20:46:27 +02:00
William Casarin
0b5d68c0b8 Revert "threads: attempt to fix state jankiness"
This reverts commit f4024895ba.
2023-06-14 09:30:58 +02:00
William Casarin
f4024895ba threads: attempt to fix state jankiness
Changelog-Fixed: Fix some more thread jankiness
2023-06-14 09:20:51 +02:00
William Casarin
043eb5b436 Show zap comments in threads and show top zap
Changelog-Added: Top zaps
Changelog-Added: Show zap comments in threads
2023-06-09 10:11:25 +02:00
Bryan Montz
9847f12c95 Remove unused code
Closes: #1105
2023-05-08 11:01:04 -07:00
William Casarin
300cd87fc2 Remove EmbeddedEventView
All embedded events are now just regular event views
2023-04-18 10:42:56 -07:00
William Casarin
98d11fb71e Show full bleed images on selected events in threads
Changelog-Changed: Show full bleed images on selected events in threads
2023-04-04 10:58:16 -07:00
William Casarin
d0a6c2e2e4 Thread Caching
Changelog-Added: Threads now load instantly and are cached
2023-03-04 17:40:22 -05:00
William Casarin
10596ddb09 Relay Filters
wip
2023-02-09 14:23:18 -08:00
887eb902bf Add comments to localized strings 2023-01-08 21:57:28 -05:00
Jacob Davis
2c44366ca5 Fix padding and other minor UI improvements 2022-12-17 17:03:16 -08:00
William Casarin
7bdd8048b0 better channels
Signed-off-by: William Casarin <jb55@jb55.com>
2022-09-13 17:23:56 -07:00
William Casarin
cb70ab532c Use the t tag for hashtags
Changelog-Changed: #hashtags now use the `t` tag instead of `hashtag`
Signed-off-by: William Casarin <jb55@jb55.com>
2022-08-19 07:38:13 -07:00
William Casarin
3b7f7706b5 add tag_is_hashtag to remove some duplicate logic
Signed-off-by: William Casarin <jb55@jb55.com>
2022-08-19 07:32:26 -07:00
William Casarin
d7b5669ecf support kind 42 chat messages
Changelog-Added: Support kind 42 chat messages (ArcadeCity).
Signed-off-by: William Casarin <jb55@jb55.com>
2022-08-19 07:21:18 -07:00
William Casarin
0af91987c3 fix chatroom easteregg bug
Signed-off-by: William Casarin <jb55@jb55.com>
2022-08-10 12:11:41 -07:00
William Casarin
9420a7a0ad Show chatroom first if content contains #chat
Changelog-Added: Load chat view first if content contains #chat
Signed-off-by: William Casarin <jb55@jb55.com>
2022-08-09 16:08:05 -07:00
William Casarin
6ac4214be7 insert sort, profile updates revamp
Signed-off-by: William Casarin <jb55@jb55.com>
2022-05-09 10:33:03 -07:00
William Casarin
73652513d9 initial mention parsing
Signed-off-by: William Casarin <jb55@jb55.com>
2022-05-04 21:33:08 -07:00
William Casarin
4704431c74 image cache
Signed-off-by: William Casarin <jb55@jb55.com>
2022-05-04 18:49:40 -07:00
William Casarin
f42bc2e91e likes, mention parsing, lots of stuff
Signed-off-by: William Casarin <jb55@jb55.com>
2022-05-04 16:26:10 -07:00
William Casarin
403fa74f8d just use stack navigationview
it seems less buggy

Signed-off-by: William Casarin <jb55@jb55.com>
2022-04-30 12:15:44 -07:00
William Casarin
d574e572d4 old style navigation
Signed-off-by: William Casarin <jb55@jb55.com>
2022-04-30 11:46:56 -07:00
William Casarin
cb463c6da9 a bunch more usability improvements
Signed-off-by: William Casarin <jb55@jb55.com>
2022-04-23 18:21:45 -07:00
William Casarin
4de2ce402e fix broken nagivation
Signed-off-by: William Casarin <jb55@jb55.com>
2022-04-23 12:41:36 -07:00
William Casarin
78c5b47f11 chatroom
Signed-off-by: William Casarin <jb55@jb55.com>
2022-04-19 19:46:30 -07:00