Commit graph

236 commits

Author SHA1 Message Date
Thomas Ricouard
fd55020533 New media viewer 2023-10-16 19:08:59 +02:00
Thomas Ricouard
23a83d69cc Remove legacy migrations 2023-10-01 09:48:27 +02:00
Paul Schuetz
0b5e764556
Automatically remove spaces in server names (#1600)
* Automatically remove spaces in server names

If a server name includes a space (which can happen if the string is pasted /
autocompleted), this space is removed, which results in the app not crashing.
Fixes #1599

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Format

---------

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-10-01 09:37:09 +02:00
Thomas Ricouard
4870b202d6 Migrate TagGroup to SwiftData 2023-09-22 19:33:53 +02:00
Thomas Ricouard
527d982dce Migrate LocalTimeline to SwiftData 2023-09-22 12:49:25 +02:00
Thomas Ricouard
4189a59cf6
iOS 17+ only support + migrating to Observation framework (#1571)
* Initial iOS 17 + Observable migration

* More Observation

* More observation

* Checkpoint

* Checkpoint

* Bump version to 1.8.0

* SwiftFormat

* Fix home timeline switch on login

* Fix sidebar routerPath

* Fixes on detail view

* Remove print changes

* Simply detail view

* More opt

* Migrate DisplaySettingsLocalValues

* Better post detail transition

* Status detail animation finally right

* Cleanup
2023-09-18 07:01:23 +02:00
Thomas Ricouard
8a3c971402 Swiftformat 2023-09-16 14:15:03 +02:00
Thomas Ricouard
8e3584ee79 Upgrade to Swift tools version 5.9 + strict Swift concurrency everywhere 2023-09-15 12:46:15 +02:00
Grant McSheffrey
077b0d269d
Bugfix 1459 - Escape ~ character as markdown (#1561)
* Add simple test for escaping markdown content in statuses

* Add ~ as markdown character to be escaped in statuses

The ~ isn't documented in the original markdown syntax docs but is
commonly used (including by AttributedString) to surround text
formatted with a strikethrough.
2023-08-24 09:58:29 +02:00
Grant McSheffrey
30f9da06c8
Support status links with non-ASCII characters (Bugfix 1546) (#1550)
* Allow creation of URL objects from strings containing non-ASCII characters

Adds a new initializer for creating URL objects with a flag to specify that
non-ASCII characters found in the path or query string should first be
URL encoded.

* Add basic test for creating HTMLString objects

* Encode link paths and queries when parsing statuses

It's common to use non-ASCII characters in URLs even though they're technically
invalid characters. Every modern browser handles this by silently encoding
the invalid characters on the user's behalf. However, trying to create a URL
object with un-encoded characters will result in nil so we need to encode the
invalid characters before creating the URL object. The unencoded version
should still be shown in the displayed status.

The parsing of the URL string is a little messy because we can't use the URL
class for this scenario and need to duplicate some of its work.

* Only encode link URLs as a backup

If a URL can be created from a status href, don't try URL encoding
it as this could result in double encoding. Only encode the string
if the creation of a URL fails. This is also more efficient.
2023-08-23 07:08:12 +02:00
Alessio Maffeis
d7c3a54b56
Update placeholder text (#1516)
* Update placeholder text

* Add newline
2023-07-20 14:27:18 +02:00
Thomas Ricouard
bb4453c811 Scrollable + interactive Tag Group timeline header 2023-07-19 08:30:47 +02:00
Thomas Ricouard
a2fe0511e0 Run swiftformat 2023-07-19 07:46:25 +02:00
Alejandro Martínez
5951bcec38
Tag groups (#1506)
* Implemented tag groups

* Cleanup

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-07-19 07:44:35 +02:00
Thomas Ricouard
a97868cab7 Fixes for bluesky bridge support 2023-07-04 08:37:30 +02:00
Thomas Ricouard
8eb9daac3e Fix ISO 639 languages 2023-04-25 15:39:17 +02:00
Chris Kolbu
7391c12644
Accessibility fix for Timeline StatusRowView and Status detail (#1355)
* Add StatusRowView accessibility action to open media attachment viewer

Previously, there would be no way to open QuickLook from the timeline.

Now, we add a custom accessibility action to do this.

* Work around initial accessibility focus bug in StatusDetailView

Previously, (due to identity issues?) the focus would be set on the header view. However, moving to the next element in the focus order. would skip over a random number of elements, depending on the context of the detail view.

Now, we manually set the focus once, allowing the focus order to work as intended.

* Respect filters in Timeline combined accessibility label

* Add explicit action to show filtered warnings from `filterView`

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-04-04 08:12:25 +02:00
Thomas Ricouard
2601764b28 Poll: Support hidden votesCount close #1354 2023-04-04 08:03:33 +02:00
Chris Kolbu
db81486f14
Restore HTMLString link parsing (#1347) 2023-04-01 15:47:12 +02:00
Thomas Ricouard
d3888d8c40 Accessibility: Disable links parsing for now 2023-03-30 16:29:44 +02:00
Chris Kolbu
9e347c75b9
Timeline & Timeline detail accessibility uplift (#1323)
* Improve accessibility of StatusPollView

Previously, this view did not provide the proper context to indicate that it represented a poll.

Now, we’ve added
- A container that will stay “Active poll” or “Poll results” when the cursor first hits one of the options;
- A prefix to say “Option X of Y” before each option;
- A Selected trait on the selected option(s), if present
- Consolidating and adding an `.updatesFrequently` trait to the footer view with the countdown.

* Add poll description in StatusRowView combinedAccessibilityLabel

This largely duplicates the logic in `StatusPollView`.

* Improve accessibility of media attachments

Previously, the media attachments without alt text would not show up in the consolidated `StatusRowView`, nor would they be meaningfully explained on the status detail screen.

Now, they are presented with their attachment type.

* Change accessibilityRepresentation of AppAcountsSelectorView

* Change Notifications tab title view accessibility representation to Menu

Previously it would present as a button

* Hide layout `Rectangle`s from accessibility

* Consolidate `StatusRowDetailView` accessibility representation

* Improve readability of Poll accessibility label

* Ensure poll options don’t present as interactive when the poll is finished

* Improve accessibility of StatusRowCardView

Previously, it would present as four separate elements, including an image without a description, all interactive, none with an interactive trait.

Now, it presents as a single element with the `.link` trait

* Improve accessibility of StatusRowHeaderView

Previously, it had no traits and no actions except inherited ones.

Now it presents as a button, triggering its primary action.

It also has custom actions corresponding to its context menu

* Avoid applying the StatusRowView custom actions to every view when contained

* Provide context for the application name

* Add pauses to StatusRowView combinedAccessibilityLabel

* Hide `TimelineView.scrollToTopView` from accessibility

* Set appropriate font style on Notification header

After the change the Text needed a `.headline` style to match the prior appearance.

* Fix bug in accessibilityRepresentation of TimelineView nav bar title

Previously, it would not display the proper label for .remoteLocal filter options.

* Ensure that pop-up button nav bar titles are interactive

* Ensure TextView responds to Environment.sizeCategory

This resolves #1309

* Fix button

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-28 18:48:58 +02:00
Thomas Ricouard
efb255eb62 Display settings: keep example post on the top 2023-03-26 19:19:59 +02:00
Chris Kolbu
b2f594f174
Accessibility tweaks + Notifications and Messages tab uplift (#1292)
* Improve StatusRowView accessibility actions

Previously, there was no way to interact with links and hashtags.

Now, these are added to the Actions rotor

* Hide `topPaddingView`s from accessibility

* Fix accessible header rendering in non-filterable TimelineViews

Previously, all navigation title views were assumed to be popup buttons.

Now, we only change the representation for timelines that are filterable.

* Combine tagHeaderView text elements

Previously, these were two separate items

* Prefer shorter Quote action label

* Improve accessibility of StatusEmbeddedView

Previously, this element would be three different ones, and include all the actions on the `StatusRowView` proper. Now, it presents as one element with no actions.

* Add haptics to StatusRowView accessibility actions

* Improve accessibility of ConversationsListRow

This commit adds:
- A combined representation of the component views
- “Unread” as the first part of the label (if this is the case)
- All relevant actions as custom actions
- Reply as magic tap

* Remove StatusRowView accessibilityActions if viewModel.showActions is false

* Hide media attachments from accessibility if the view is not focused

* Combine NotificationRowView accessibility elements; add user actions

Previously, there was no real way to interact with these notifications.

Now, the notifications that show the actions row have the appropriate StatusRowView-derived actions, and new followers notifications have more actions that let you see each user’s profile.

* Prefer @Environment’s `accessibilityEnabled` over `isVoiceOverRunning`

This way we can cater for Voice Control, Full Keyboard Access and Switch Control as well.

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-24 07:52:29 +01:00
Paul Schuetz
da0b92e13d
Allow translation of an account bio/note (#1276)
The bio (note) of an account can now be translated via DeepL. If the user has
put in his own DeepL API key, that is used, otherwise, the standard one is
used. See #1267

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-03-19 16:18:13 +01:00
Thomas Ricouard
aa120a48f7 ServerError: Fix 2023-03-13 13:42:32 +01:00
Thomas Ricouard
6c307aba63 SwiftFormat 2023-03-13 13:38:28 +01:00
Peter-Josef Meisch
db5d0b9274
Display and edit filter expirations (#1141) 2023-03-03 08:15:34 +01:00
Thomas Ricouard
37ed178c3f Various fixes + fix Explore navigation 2023-03-02 20:15:07 +01:00
Thomas Ricouard
30de766777 Remove Atomics 2023-02-27 06:40:30 +01:00
Jim Dovey
d1209e6704
Updated to resolve all possible Sendability warnings from Swift 6 compatibility mode. (#1072)
Co-authored-by: Jim Dovey <jimdovey@apple.com>
2023-02-27 06:39:07 +01:00
Thomas Ricouard
347335f770 Move userMentioned outside of Status 2023-02-26 09:38:26 +01:00
Thomas Ricouard
83e4e74329 Swiftformat 2023-02-26 06:45:57 +01:00
Paul Schuetz
06629cc397
Enhance the context menu for private messages (#1053)
* Enhance the message context menu

A direct message can now directly be bookmarked, the author can be publicly
mentioned and reported.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Add options to the conversation list context menu

Since the latest message is shown in the conversation list, the user can now
interact with this message via the context menu similar to the messages in the
conversation history.
The "conversation" class had to be modified since
bookmarking and liking a message would have led to a race condition (depending
on the server) when fetching the conversations afterwards, so the only affected
the message is now immediately updated.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Remove child view models

The child views models are removed, and the list row now only uses the conversation
object managed by the list view model.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Make unmodified var let

The last state-var of a conversation isn't modified, instead, a new conversation
is created. Therefore, the var is now a let.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

---------

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-02-26 06:45:31 +01:00
Thomas Ricouard
63ff87f640 Move languages into Models 2023-02-24 08:24:51 +01:00
Thomas Ricouard
096e42b1c2 Profile edit: Add metadata editing 2023-02-24 07:55:24 +01:00
Thomas Ricouard
a4910037b8 Swiftformat . 2023-02-22 19:09:39 +01:00
Alex Grebenyuk
37a69650ef
Remove capture mode for images (#996)
* Remove capture mode for images

* Simplify how processor is created in StatusRowMediaPreviewView

* Optimize StatusViewId further
2023-02-22 07:09:56 +01:00
Thomas Ricouard
5d3b378373 Fix Equatable impl for Status and Account (thanks class) 2023-02-21 12:35:07 +01:00
Thomas Ricouard
b259b6739e Swiftformat 2023-02-21 07:23:42 +01:00
Peter-Josef Meisch
6aeb25885c
Fix display of multiple vote polls (#967)
Closes #952
2023-02-21 07:05:21 +01:00
Alex Grebenyuk
5faf793fe2
Optimize viewId (#942) 2023-02-19 07:25:27 +01:00
Thomas Ricouard
4000dc3650 Switch to targeted Swift concurrency warnings + fix them 2023-02-18 22:51:44 +01:00
Thomas Ricouard
b1424aadd0 Fix two crashes 2023-02-18 17:08:32 +01:00
Yusuke Arakawa
8d8955ee13
Fix leak memory (Thread 1: EXC_BAD_ACCESS (code=EXC_I386_GPFLT)) (#917)
Closes: #829

Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
2023-02-18 08:53:11 +01:00
Thomas Ricouard
ca4e80101f Swiftformat 2023-02-18 07:26:48 +01:00
Alex Grebenyuk
dcf03b0f88
Status as class (performance improvement) (#925)
* Status as class (performance improvement)

* Also make account class

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-02-18 07:15:57 +01:00
Gareth Simpson
c1205036a2
This simplifies the parser. Having read the spec more closely as part of investigating bug 855, I was overcomplicating it. The server promises to send html so we should render it that way, not with heuristics. (#900)
This puts in line breaks exclusively where there are <br>s and takes out other line breaks that are in the body text.

*Doesn't* fix bug 855
2023-02-17 06:31:24 +01:00
Thomas Ricouard
ac32410200 Proper threading UI 2023-02-16 17:07:52 +01:00
Yusuke Arakawa
7bbe3cbc41
Fixed non-existing Json key decoding error (#832)
Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
2023-02-14 12:19:23 +01:00
Thomas Ricouard
3d96d6997d Better handling of notifications 2023-02-13 22:30:06 +01:00
Thomas Ricouard
eb6050a38f Swiftformat 2023-02-12 16:29:41 +01:00
Thomas Ricouard
41058919bd Reworked translate: Use Mastodon API when available + always show the action in the post context menu 2023-02-12 13:22:36 +01:00
Thomas Ricouard
dbdcf4c2d6 Fix reblog 2023-02-10 18:25:38 +01:00
Thomas Ricouard
feefb02456 Status detail: Switch to List container + refactor to something much better 2023-02-10 18:21:05 +01:00
Thomas Ricouard
195ab4cd65 Faster viewID for Status 2023-02-10 07:26:41 +01:00
Thomas Ricouard
22b4044dfd Fix relative date 2023-02-09 19:25:12 +01:00
Yusuke Arakawa
dae7b85d3d
Timeline: restore the selected timeline at the next startup (#694)
* Timeline: restore the selected timeline at the next startup

Signed-off-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>

* Rename: UserDefaultas label name

Signed-off-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>

* Timeline: RawRepresentable of TimelineFilter

Signed-off-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>

* Cleanup code

* Supports RemoteTimelineFilter

* Cleanup code

* Safe saves last viewed status

---------

Signed-off-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
2023-02-09 12:27:59 +01:00
Thomas Ricouard
013410a80e Faster / Cached ServerDate decoding 2023-02-09 09:12:44 +01:00
Gareth Simpson
a43a657f1e
Add translate button to the preview post in settings (#724)
* Add translate button to the preview post in settings

* Accidental outdent.

* Add share button to placeholder status and also preview status in settings.
2023-02-09 07:38:04 +01:00
Gareth Simpson
8f6e6853aa
Add a preview toot to the top of the display settings page. (#716)
* Add a preview toot tot the top of the display settings page.

* DisplayModel doesn't need to be @State

* Disable hitTest

* Example Post

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-02-08 19:09:24 +01:00
Sean Goldin
0c359f2b79
Add direct status highlighting (#720) 2023-02-08 18:47:09 +01:00
Thomas Ricouard
eb0b1043c7 Fix instance suggestions not loading 2023-02-08 07:25:05 +01:00
Peter-Josef Meisch
1c8fabbe59
Fix Conversation.lastStatus nullability issue (#709) close #696
* Fix Conversation.lastStatus nullability issue

* Fix UI

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-02-08 06:27:44 +01:00
Gareth Simpson
7ef4b8eda7
Fix custom emoji with underscores (#687)
* Potential fix

* explainer :)
2023-02-07 07:06:30 +01:00
Thomas Ricouard
0af60c4b1e Faster HTML String disk cache 2023-02-05 21:23:47 +01:00
Thomas Ricouard
6b285cdbcf Cleanup 2023-02-04 17:17:38 +01:00
Thomas Ricouard
508b180a1d Remove extra line break from spoiler text 2023-02-04 13:36:56 +01:00
Thomas Ricouard
3c0ffdb1ae Prepare disk cache for Timeline 2023-02-04 12:17:16 +01:00
Thomas Ricouard
86937e65fe Compose: Fix editing, now keep line breaks and link close #602 2023-02-04 11:21:30 +01:00
Gareth Simpson
624d4766fa
Newer, better, faster HTML to Markdown converter (#610)
* This is a more correct html to markdown implementation.

It removes all the hacks and just uses the SwiftSoup parser correctly

It will fix issue #576 and also an unlogged issue with the old implementation that could corrupt urls with underscores in them.

* Better <br> / linefeed handling

* Cleanup

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-02-04 08:16:19 +01:00
Thomas Ricouard
4de46610e0 Handle dynamic streaming URL 2023-02-03 19:44:55 +01:00
Sean Goldin
10946fef10
Timeline highlight mentions (#595)
* Introduce fetchPages

* Set up highlighting

* Implement highlighting stage 1

* Implement highlighting stage 2

* Implement highlighting.

* Fix merge

* Add protocol

* Remove debug prints
2023-02-02 06:39:03 +01:00
Thomas Ricouard
4e77669181 Swiftformat 2023-02-01 12:49:59 +01:00
Jérôme Danthinne
f3e21a714c
Consolidate new notifications with the latest one (#563) 2023-01-31 17:43:52 +01:00
Gareth Simpson
0a0e985e33
match intended mastodon presentation (#557)
strip out <span="invisible">blah</span>
append ellipsis to <span="ellipsis">blah</span>
2023-01-31 09:02:01 +01:00
Thomas Ricouard
16636b12a9 Swift format 2023-01-30 07:27:06 +01:00
Thomas Durand
c6c066564d
Better profile header (#526)
* Prevent opening quicklook for missing avatar or header. Fixes #127

* Using theme for missing header background in profile

* fix

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-01-30 07:15:18 +01:00
Thomas Ricouard
426d2e15b2 Change timeline icon + move OpenAI icon to the accessory bar 2023-01-29 15:08:41 +01:00
Jérôme Danthinne
2360c5f4db
Fix french localizations (#476)
* Fix french plurals

* Fix english

* More French translations fixes

* Switching relative date formatter

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-01-28 18:40:23 +01:00
Gareth Simpson
1983ae0f48
This is a more conservative fix for #328 (#462) close #328
Having checked the markdown -> attributedtext conversion, lots of things I was escaping before are actually ingored.

This change only escapes things that are definitely rendered and as far as I can tell doesn't break anything now.

Test post to look at with maximal Markdown: https://mas.to/@elbrux/109743775703438333
2023-01-28 09:01:37 +01:00
Roberto Pastor
4cdd0214f4
Spanish update 27-01 (#450)
* - Updated spanish localization with new keys
- Added missing NSLocalizedString for filters

* Fixed unresolved conflict

---------

Co-authored-by: Roberto Pastor <roberto.pastor@cabify.com>
2023-01-28 06:33:58 +01:00
Thomas Ricouard
b89221a535 Code cleanup / format / lint 2023-01-27 20:36:40 +01:00
Jérôme Danthinne
bec9ab8792
Consolidated notifications (#443) close #231
* Group favorite and boost notifications

* Group notifications per page, not globally
2023-01-27 16:58:04 +01:00
Thomas Ricouard
e811d5dd39 Bump version to 1.1.2 + More fixes for iPad logged out 2023-01-26 22:07:21 +01:00
Thomas Ricouard
72fbcff1dd DM: Various UX fixes 2023-01-26 18:27:53 +01:00
Thomas Ricouard
5cd9ddd945 New account settings + create / edit server side filters 2023-01-25 21:18:34 +01:00
Jérôme Danthinne
9b3b3692ee
Support for follow requests (#376) close #321
* Support for follow requests (#321)

* Run SwiftFormat

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-01-25 13:02:28 +01:00
Gareth Simpson
ab4ac1b004
Local content settings close #338 (#362)
* Local settings for sensitive content.

* Local sensitive content settings

* Added the posting settings as well as the reading ones.

* Menu item / nav title mismatch

* Fixes

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-01-25 06:28:16 +01:00
Thomas Ricouard
5b3afc72de Fix some polls crashing at decoding 2023-01-24 21:19:14 +01:00
Thomas Ricouard
b1520c549e Various fixes due to recent merges 2023-01-24 07:19:09 +01:00
Thomas Ricouard
dd5e6b91c0 oops 2023-01-24 06:56:28 +01:00
Gareth Simpson
ffe1a1dba0
Escape markdown markup characters on their way into HTMLToMarkdown to prevent them being rendered as styled text after they come out. (#329) 2023-01-24 06:38:38 +01:00
Steve Kalkwarf
a7c7dfd24e
Make spelling of "favorite" consistent (#327)
"Favorite" was spelled using both UK English and US English variations:
113 favourite
64 favorite

I made them consistent, using the US spelling.
2023-01-24 06:35:43 +01:00
Thomas Ricouard
11a7ade82d Fix handling of Twitter link 2023-01-23 21:34:45 +01:00
Sean Goldin
6aea60b644
Fix twitter links (#316) 2023-01-23 20:51:16 +01:00
Thomas Ricouard
2a635eda21 Optimise Status models for SwiftUI 2023-01-22 20:23:41 +01:00
Thomas Ricouard
ce41e6b000 Always display relative date in the timeline 2023-01-22 20:14:05 +01:00
Thomas Ricouard
d6aa99eb57 New direct messages view close #122 2023-01-22 16:55:03 +01:00
Thomas Ricouard
eec5637c1c Composer / Share sheet: add video upload support close #154 2023-01-22 09:09:35 +01:00
Thomas Ricouard
a79c5691e0 Run SwiftFormat 2023-01-22 06:38:30 +01:00