1
0
mirror of git://jb55.com/damus synced 2024-09-16 02:03:45 +00:00
Commit Graph

2877 Commits

Author SHA1 Message Date
transifex-integration[bot]
f56b35972d
Translate Localizable.strings in es_419
100% translated source file: 'Localizable.strings'
on 'es_419'.
2023-10-04 16:51:33 +00:00
Daniel D’Aquino
24c2be02bb ui: Improve UX around clearing cache
Testing
-------

PASS

Device: iPhone 14 Pro simulator
iOS: Tested on iOS 17.0 and 16.4
Steps:

1. Go to appearance settings
2. Enable animations. Shows confirmation dialog. PASS
3. Click cancel. Setting is toggled back. PASS
4. Enable animations again. This time click "OK". Setting stays at what was set, and cache is visibly cleared. PASS
5. Restart app. Changes are persistent. PASS
6. Disable animations. Dialog appears like before. PASS
7. Cancel. Toggles back as expected. PASS
8. Disable animations again. This time click "OK". Cache is cleared. PASS
7. Restart app. Changes are persistent. PASS
9. Click on "clear cache". Confirmation dialog appears. PASS
10. Cancel action. We do not see cache being cleared. PASS
11. Click on "clear cache" and click "OK" this time.
12. We can see the cache being visibly cleared. It shows a loading spinner and "clearing cache", and then we see a checkmark icon with a "cache cleared" indicator. We cannot click the button again for now. PASS
13. Go to home view, scroll through some views, then come back to the setting. Clear cache button is visible again.

Closes: https://github.com/damus-io/damus/issues/1301
Changelog-Changed: Improve UX around clearing cache
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-10-03 19:17:22 -07:00
transifex-integration[bot]
5395c45df2
Translate InfoPlist.strings in sw
100% translated source file: 'InfoPlist.strings'
on 'sw'.
2023-10-03 13:51:03 +00:00
Daniel D’Aquino
1150a144bc composer: Make text editor more robust
This change makes the text editor/composer more robust and simple and solves Github issue #1558

It builds on the changes made for #1211, and on Jericho's (Jericho Hasselbush <jericho@sal-et-lucem.com>) discovery during his work on #1544

It uses setContentCompressionResistance, disabled text box scrolling, and dynamic height adjustments (based on more accurate layout calculations) to allow several improvements:
- It ensures lines get wrapped and not overflown
- It uses system native "scroll cursor into view" when typing, eliminating the need to a ghost caret
- It ensures we do not have a scroll view within a scroll view (which is confusing)
- It ensures that we set the height of the text box to its ideal value using a native layout calculation (Removes some issues with copying and pasting larger text)
- It resolves other small issues, such as #1558

Issue #1558 repro
-----------------

Result: VERIFIED

Device: iPhone 14 Pro Simulator
iOS: 17.0
Damus: `476f52562a70c2615ad084640dd1a0ba5c4c12e3`

Issue #1558 steps:

1. Type "hello world, hello @da"
2. Select "Damus" in contact list
3. Try moving cursor to the end of "world". Cursor should have gone there, but it immediately goes back to the end of "@damus " instead.

Testing for #1558
-----------------

Result: PASS

Device: iPhone 14 Pro Simulator
iOS: 17.0
Damus: This commit
Steps:

1. Type "hello world, hello @da"
2. Select "Damus" in contact list
3. Try moving cursor to the end of "world". Cursor goes there.

General functionality testing
-----------------------------

Result: CONDITIONAL PASS.
Summary: Behaviour is improved from #1211 patch, and #1558 is fixed. There are a few remaining issues, but they do not look like regressions from these changes. More details below.

Device: iPhone 14 Pro Simulator
iOS: 17.0
Damus: This commit
Coverage:

1. Basic typing works. PASS
2. Basic user tagging works. PASS
3. Typing long text line wraps the line. PASS
4. Adding newlines to the end of the text works and text is visible (i.e. Text box is expanding with text). PASS
5. Adding lots of newlines causes the text box and inner PostView content to expand, and those contents can be scrolled. PASS
6. Typing text when cursor is out of view (both up and down) causes PostView to scroll the cursor into view. PASS
7. Tagging user on a line positioned at the middle of the screen causes view to scroll cursor into view. PASS
8. Tagging user on a very long line positioned causes view to scroll cursor into view. PASS
9. Pasting very long text (5 paragraphs of Lorem Ipsum) expands the text box as necessary, wraps all long lines, scrolls cursor at the end into view. PASS
10. Scrolling through very long text shows that there is only one scroll view active (PostView's). PASS
11. Typing text that expands text box does not cause jitters. PASS
12. Typing mentions do not cause jitter. PASS
13. Adding newline from the end of a mid paragraph unfortunately still causes cursor to jump to the end of the text. This is an existing bug (https://github.com/damus-io/damus/issues/1521). EXISTING ISSUE.
14. Tagging a user at the end of a line when there are other lines below it may cause the cursor to jump a few characters forward. It is unclear whether this is a regression because prior to this change the cursor would get stuck at the end of the mention. But since this is a very specific edge case that might not be a regression, it might be a good idea to address this on a separate ticket. CONDITIONAL PASS
15. Could not run PostView unit tests due to various build errors on the test target.

Closes: https://github.com/damus-io/damus/issues/1558
Changelog-Fixed: Fix situations where the note composer cursor gets stuck in one place after tagging a user
Changelog-Fixed: Fix some note composer issues, such as when copying/pasting larger text, and make the post composer more robust.
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-10-02 13:30:08 -07:00
Daniel D’Aquino
89acde1b90 filters: Add filter to hashtag search timeline view (#1412)
Applied the content filters to the hashtag search timeline view, to filter out #nsfw-tagged posts on that view if the user has that setting enabled.

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

**PASS**

**iOS:** 17.0 (iPhone 14 Pro simulator)
**Damus:** This commit
**Test steps:**
1. Search for #sauna hashtag
2. Pick one post from results that contains multiple hashtags
3. Locally change nsfw filter in the code to another hashtag (I picked #homestead in this example) (This is to make testing easier)
4. Run app on simulator
5. Disable nsfw filtering
6. Search for the #sauna hashtag
7. Ensure that the post from step 2 is there
8. Turn on nsfw filtering
9. Search for the #sauna hashtag again. Ensure that post from step 2 is no longer visible
10. Switch keyword back to #nsfw in the code. Re-run app
11. Search for the #nsfw hashtag. No posts appear (timeline view is empty). (Not sure if this is the desired behavior, but seems reasonable)
12. Turn off nsfw filtering
13. Search for the #nsfw hashtag again. #nsfw posts should appear.

Closes: https://github.com/damus-io/damus/issues/1412
Changelog-Fixed: Apply filters to hashtag search timeline view
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
transifex-integration[bot]
ed98fd06e6 Update translations
- Translate Localizable.strings in pl_PL
- Translate Localizable.strings in sv_SE
- Translate Localizable.strings in nl
- Translate Localizable.strings in ja
- Translate Localizable.strings in hu_HU
- Translate Localizable.strings in es_ES
- Translate Localizable.strings in el_GR
- Translate Localizable.strings in de
- Translate Localizable.stringsdict in sv_SE
- Translate Localizable.stringsdict in nl
- Translate Localizable.stringsdict in ja
- Translate Localizable.stringsdict in hu_HU
- Translate Localizable.stringsdict in es_ES
- Translate Localizable.stringsdict in el_GR
- Translate Localizable.stringsdict in de
- Translate InfoPlist.strings in sv_SE
- Translate InfoPlist.strings in pl_PL
- Translate InfoPlist.strings in nl
- Translate InfoPlist.strings in ja
- Translate InfoPlist.strings in hu_HU
- Translate InfoPlist.strings in es_ES
- Translate InfoPlist.strings in el_GR
- Translate InfoPlist.strings in de
2023-10-02 12:34:08 -07:00
Fishcake
35c581066a fix video size detection, and audio track detection to work with HLS, add live stream indicator
Closes: https://github.com/damus-io/damus/pull/1560
Signed-off-by: William Casarin <jb55@jb55.com>
2023-10-02 12:34:08 -07:00
Fishcake
d6c72403a3 include m3u8 files for video playback
Closes: https://github.com/damus-io/damus/pull/1560
Signed-off-by: William Casarin <jb55@jb55.com>
2023-10-02 12:34:08 -07:00
Daniel D’Aquino
768ab3e9e4 ui: Fix issue where relays with trailing slashes cannot be removed (#1531)
Summary
-------

This fixes the issue at Github #1531 where relays with trailing slashes cannot be removed.

The root cause (Identified by @fishcakeday) was that for a relay to be removed, a certain dictionary entry containing the relay url needed to be removed prior to sending the updated relay list. However those dictionary keys used `String` objects, which cannot tell that two URLs are the same with or without a trailing slash.

To fix the issue, I have used a dictionary with the type `[RelayURL: RelayInfo]`, and made the necessary protocol conformance implementations for RelayURL. This way, URLs are handled with higher accuracy (e.g. Trailing slashes do not matter, URLs that resolve to the same location will match no matter what).

This allows us to leverage the existing parsing and handling logic that comes with the `URL` type, instead of manually handling URL strings.

Generally speaking it is preferrable to work with higher level `URL` or `RelayURL` objects than handle URLs via `String`. There is an opportunity to refactor more code, but I intentionally kept the changes to `RelayURL` limited to the functionality in this issue, because otherwise the changeset becomes very big and risky.

Issue reproduction
------------------

**Device:** iPhone 14 Pro simulator
**iOS:** 17.0
**Damus:** Local build from `476f52562` with the following local change:
``` diff

Signed-off-by: William Casarin <jb55@jb55.com>
2023-10-02 12:34:08 -07:00
Daniel D’Aquino
66d731ad0a ui: Filter out reposts where the inner event is from a person whom the user has muted. (#1216)
Issue reproduction
------------------

**Device:** iPhone 14 Pro simulator
**iOS:** 17.0
**Damus:** `bb2eb904cc`
**Steps:**

1. Repost a note from another account (Account "B")
2. Mute user "B"
3. Check home page and your own profile page. Repost shows up with a muted box.

Fix

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
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
Mazin
957ac1dc03 Add translate.nostr.wine to available translation services
Closes: https://github.com/damus-io/damus/pull/1113
Signed-off-by: William Casarin <jb55@jb55.com>
2023-10-02 12:34:08 -07:00
Terry Yiu
a58ca2918a Remove nonfunctional LibreTranslate servers
Signed-off-by: Terry Yiu <git@tyiu.xyz>
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
Suhail Saqan
8a2e87718b camera: add CameraPreview for displaying the view the camera is reading 2023-10-02 12:34:08 -07:00
Suhail Saqan
88b3c6fe8d camera: add PhotoCaptureProcessor and VideoCaptureProcessor 2023-10-02 12:34:08 -07:00
transifex-integration[bot]
94d448e8d4
Translate InfoPlist.strings in zh_TW
100% translated source file: 'InfoPlist.strings'
on 'zh_TW'.
2023-10-02 18:06:45 +00:00
transifex-integration[bot]
dda94cc1c1
Translate Localizable.strings in zh_TW
100% translated source file: 'Localizable.strings'
on 'zh_TW'.
2023-10-02 18:06:25 +00:00
transifex-integration[bot]
7f3cc8b7a1
Translate Localizable.strings in zh_CN
100% translated source file: 'Localizable.strings'
on 'zh_CN'.
2023-10-02 18:02:15 +00:00
transifex-integration[bot]
077d1aa1fd
Translate Localizable.strings in zh_CN
100% translated source file: 'Localizable.strings'
on 'zh_CN'.
2023-10-02 18:00:07 +00:00
transifex-integration[bot]
7297db946d
Translate Localizable.strings in zh_CN
100% translated source file: 'Localizable.strings'
on 'zh_CN'.
2023-10-02 17:59:57 +00:00
transifex-integration[bot]
cc59e149d5
Translate InfoPlist.strings in zh_HK
100% translated source file: 'InfoPlist.strings'
on 'zh_HK'.
2023-10-02 17:46:53 +00:00
transifex-integration[bot]
aca7dde889
Translate InfoPlist.strings in zh_CN
100% translated source file: 'InfoPlist.strings'
on 'zh_CN'.
2023-10-02 17:46:19 +00:00
transifex-integration[bot]
b2584476ac
Translate Localizable.strings in es_ES
100% translated source file: 'Localizable.strings'
on 'es_ES'.
2023-09-30 00:34:41 +00:00
transifex-integration[bot]
88fc8e41f7
Translate InfoPlist.strings in es_ES
100% translated source file: 'InfoPlist.strings'
on 'es_ES'.
2023-09-30 00:27:25 +00:00
transifex-integration[bot]
a955b7beb8
Translate Localizable.stringsdict in es_ES
100% translated source file: 'Localizable.stringsdict'
on 'es_ES'.
2023-09-30 00:05:03 +00:00
transifex-integration[bot]
36c0307ebd
Translate Localizable.strings in pl_PL
100% translated source file: 'Localizable.strings'
on 'pl_PL'.
2023-09-29 09:32:25 +00:00
transifex-integration[bot]
c0377d630b
Translate Localizable.strings in pl_PL
100% translated source file: 'Localizable.strings'
on 'pl_PL'.
2023-09-29 09:32:15 +00:00
transifex-integration[bot]
7390808630
Translate Localizable.strings in pl_PL
100% translated source file: 'Localizable.strings'
on 'pl_PL'.
2023-09-29 09:32:07 +00:00
transifex-integration[bot]
7444656043
Translate Localizable.strings in el_GR
100% translated source file: 'Localizable.strings'
on 'el_GR'.
2023-09-29 09:16:08 +00:00
transifex-integration[bot]
481280f006
Translate InfoPlist.strings in el_GR
100% translated source file: 'InfoPlist.strings'
on 'el_GR'.
2023-09-29 08:55:24 +00:00
transifex-integration[bot]
aaf587c3a9
Translate InfoPlist.strings in pl_PL
100% translated source file: 'InfoPlist.strings'
on 'pl_PL'.
2023-09-29 08:55:05 +00:00
transifex-integration[bot]
641049f6b4
Translate Localizable.stringsdict in el_GR
100% translated source file: 'Localizable.stringsdict'
on 'el_GR'.
2023-09-29 08:50:47 +00:00
transifex-integration[bot]
433d186f67
Translate Localizable.strings in nl
100% translated source file: 'Localizable.strings'
on 'nl'.
2023-09-28 08:55:56 +00:00
transifex-integration[bot]
d157d72ca1
Translate Localizable.stringsdict in sv_SE
100% translated source file: 'Localizable.stringsdict'
on 'sv_SE'.
2023-09-27 06:03:31 +00:00
transifex-integration[bot]
3a459c83df
Translate Localizable.strings in sv_SE
100% translated source file: 'Localizable.strings'
on 'sv_SE'.
2023-09-27 06:03:00 +00:00
transifex-integration[bot]
945604afce
Translate InfoPlist.strings in sv_SE
100% translated source file: 'InfoPlist.strings'
on 'sv_SE'.
2023-09-27 05:50:30 +00:00
transifex-integration[bot]
3945f20ae4
Translate Localizable.strings in hu_HU
100% translated source file: 'Localizable.strings'
on 'hu_HU'.
2023-09-26 12:07:48 +00:00
transifex-integration[bot]
f3449ecaed
Translate InfoPlist.strings in hu_HU
100% translated source file: 'InfoPlist.strings'
on 'hu_HU'.
2023-09-26 11:58:14 +00:00
transifex-integration[bot]
19857c12b7
Translate Localizable.stringsdict in hu_HU
100% translated source file: 'Localizable.stringsdict'
on 'hu_HU'.
2023-09-26 11:56:49 +00:00
transifex-integration[bot]
61612121f4
Translate InfoPlist.strings in nl
100% translated source file: 'InfoPlist.strings'
on 'nl'.
2023-09-25 15:37:45 +00:00
transifex-integration[bot]
9dac31d713
Translate Localizable.stringsdict in nl
100% translated source file: 'Localizable.stringsdict'
on 'nl'.
2023-09-25 15:37:24 +00:00
transifex-integration[bot]
9540016eee
Translate Localizable.stringsdict in de
100% translated source file: 'Localizable.stringsdict'
on 'de'.
2023-09-25 09:37:28 +00:00
transifex-integration[bot]
22fe9f3dfd
Translate InfoPlist.strings in de
100% translated source file: 'InfoPlist.strings'
on 'de'.
2023-09-25 09:36:14 +00:00
transifex-integration[bot]
c469e07ff7
Translate Localizable.strings in de
100% translated source file: 'Localizable.strings'
on 'de'.
2023-09-25 09:35:22 +00:00
transifex-integration[bot]
201e4420d1
Translate Localizable.strings in ja
100% translated source file: 'Localizable.strings'
on 'ja'.
2023-09-25 03:20:17 +00:00
transifex-integration[bot]
e7a948d362
Translate InfoPlist.strings in ja
100% translated source file: 'InfoPlist.strings'
on 'ja'.
2023-09-25 03:08:33 +00:00
transifex-integration[bot]
375d454b16
Translate Localizable.stringsdict in ja
100% translated source file: 'Localizable.stringsdict'
on 'ja'.
2023-09-25 03:06:37 +00:00
William Casarin
476f52562a nostrdb: fix profiles not updating
Send relay pool events to nostrdb as well

Whenever we send events to relays, make sure we send them to nostrdb
at the same time.

Changelog-Fixed: Fix profile not updating
2023-09-24 17:07:09 -07:00
William Casarin
f591ad2dff ndb: add process_client_event helper
This is a quick helper for the new client event processing functionality
2023-09-24 17:06:35 -07:00